pvlib.iotools.get_era5#

pvlib.iotools.get_era5(latitude, longitude, start, end, variables, api_key, dataset='reanalysis-era5-single-levels-timeseries', map_variables=True, timeout=60, url='https://cds.climate.copernicus.eu/api/retrieve/v1/')[source]#

Retrieve ERA5 reanalysis data from the ECMWF’s Copernicus Data Store.

A CDS API key is needed to access this API. Register for one at [1].

This API [2] provides a subset of parameters of the full ERA5 datasets, see [3] for available variables. A comparison of ERA5 and ERA5-land is available in [4].

Parameters:
  • latitude (float) – In decimal degrees, north is positive (ISO 19115).

  • longitude (float) – In decimal degrees, east is positive (ISO 19115).

  • start (datetime like or str) – First day of the requested period. Assumed to be UTC if not localized.

  • end (datetime like or str) – Last day of the requested period. Assumed to be UTC if not localized.

  • variables (list of str) – List of variable names to retrieve, for example ['ghi', 'bhi', 'temp_air']. Both pvlib and ERA5 names can be used. See [1] for additional options.

  • api_key (str) – ECMWF CDS API key.

  • dataset (str, default "reanalysis-era5-single-levels-timeseries") – The dataset to query. May be either "reanalysis-era5-single-levels-timeseries" or "reanalysis-era5-land-timeseries". See [4] for details.

  • map_variables (bool, default True) – When true, renames columns of the DataFrame to pvlib variable names where applicable. Also converts units of some variables. See variable VARIABLE_MAP and UNITS.

  • timeout (int, default 60) – Number of seconds to wait for the requested data to become available before timeout.

  • url (str, optional) – API endpoint URL.

Raises:

Exception – If timeout is reached without the job finishing.

Returns:

  • data (pd.DataFrame) – Time series data. The index corresponds to the end of the interval.

  • meta (dict) – Metadata.

Notes

Data are returned for the grid point nearest to the requested location. The ERA5 dataset is available on a 0.25° x 0.25° grid, whereas ERA5-Land is available on a finer 0.1° x 0.1° grid [4].

ERA5-Land only covers land surfaces. For locations near the coast, the nearest grid point may lie over water, in which case ERA5-Land returns only missing values (NaN) without raising an error. Similarly, for ERA5 the nearest grid point may be over water and therefore not representative of conditions on land, e.g., for air temperature. Check the returned meta['latitude'] and meta['longitude'], and consider adjusting the requested coordinates slightly inland.

References