pvlib.iotools.get_era5#

pvlib.iotools.get_era5(latitude, longitude, start, end, variables, api_key, 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 the full ERA5 dataset. See [3] for the available variables. Data are available on a 0.25° x 0.25° grid.

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', 'temp_air']. Both pvlib and ERA5 names can be used. See [1] for additional options.

  • api_key (str) – ECMWF CDS API key.

  • 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 start of the interval.

  • meta (dict) – Metadata.

References