pvlib.iotools.get_acis_station_data#

pvlib.iotools.get_acis_station_data(station, start, end, trace_val=0.001, map_variables=True, url='https://data.rcc-acis.org/StnData', **kwargs)[source]#

Retrieve weather station climate records via the Applied Climate Information System (ACIS).

ACIS 1, 2 aggregates and provides access to climate data from many underlying sources. This function retrieves measurements from ground stations belonging to various global networks.

This function can query data from stations all over the world. The stations available in a given area can be listed using get_acis_available_stations().

Parameters
  • station (str) – Identifier code for the station to query. Identifiers from many station networks are accepted, including WBAN, COOP, FAA, WMO, GHCN, and others. See 1 and 2 for details.

  • start (datetime-like) – First day of the requested period

  • end (datetime-like) – Last day of the requested period

  • map_variables (bool, default True) – When True, rename data columns and metadata keys to pvlib variable names where applicable. See variable VARIABLE_MAP.

  • trace_val (float, default 0.001) – Value to replace “trace” values in the precipitation data

  • url (str, default: ‘https://data.rcc-acis.org/GridData’) – API endpoint URL

  • kwargs – Optional parameters passed to requests.post.

Returns

  • data (pandas.DataFrame) – Daily precipitation [mm], temperature [Celsius], snow [mm], and degree day [Celsius-days] data

  • metadata (dict) – station metadata

Raises

requests.HTTPError – A message from the ACIS server if the request is rejected

References

1(1,2)

ACIS Web Services

2(1,2)

ACIS Metadata

Examples

>>> # Using an FAA code (Chicago O'Hare airport)
>>> from pvlib.iotools import get_acis_station_data
>>> df, meta = get_acis_station_data('ORD', '2020-01-01', '2020-12-31')
>>>
>>> # Look up available stations in a lat/lon rectangle, with data
>>> # available in the specified date range:
>>> from pvlib.iotools import get_acis_available_stations
>>> stations = get_acis_available_stations([39.5, 40.5], [-80.5, -79.5],
...                                        '2020-01-01', '2020-01-03')
>>> stations['sids'][0]
['369367 2', 'USC00369367 6', 'WYNP1 7']
>>> df, meta = get_acis_station_data('369367', '2020-01-01', '2020-01-03')