API

era5cli.info

Print ERA5 information on available variables and levels.

class info.Info(infoname: str)[source]

Bases: object

Print ERA5 information on available variables and levels.

Parameters:infoname (str) – Name of information that needs to be printed. Supported are ‘levels’, ‘2Dvars’, ‘3Dvars’, ‘ERA5land’, and any variable or pressure level defined in era5cli.inputref
Raises:AttributeError – If infoname is not any of the supported strings.
infolist = None

List with information to be printed.

Type:list
infoname = None

Name of information that needs to be printed.

Type:str
infotype = None

Type of information that needs to be printed.

Type:str
list()[source]

Print a list of available variables or pressure levels.

Prints a list of available variables or pressure levels. The output is printed in multiple columns if the size of the terminal supports it.

vars()[source]

Return the variable name or pressure level.

Print in which list the given variable occurs.

era5cli.fetch

Fetch ERA5 variables.

class fetch.Fetch(years: list, months: list, days: list, hours: list, variables: list, outputformat: str, outputprefix: str, period: str, ensemble: bool, area=None, statistics=None, synoptic=None, pressurelevels=None, merge=False, threads=None, prelimbe=False, land=False)[source]

Bases: object

Fetch ERA5 data using cdsapi.

Parameters:
  • years (list(int)) – List of years to download data for.
  • months (list(int)) – List of months to download data for (1-12).
  • days (list(int), None) – List of days of the month to download data for (1-31).
  • hours (list(int)) – List of time of day in hours to download data for (0-23). When downloading synoptic monthly data, this parameter is used to list the synoptic hours to download data for.
  • variables (list(str)) – List of variable names to download data for. See the Copernicus Climate Data Store website for available variables.
  • area (None, list(float)) – Coordinates in case extraction of a subregion is requested. Specified as [lat_max, lon_min, lat_min, lon_max] (counterclockwise coordinates, starting at the top), with longitude in the range -180, +180 and latitude in the range -90, +90. For example: [90, -180, -90, 180]. Requests are rounded down to two decimals. By default, the entire available area will be returned.
  • outputformat (str) – Output file type: ‘netcdf’ or ‘grib’.
  • outputprefix (str) – Prefix to be used for the output filename.
  • period (str) – Execute the data fetch process for this data type: ‘hourly’ or ‘monthly’.
  • ensemble (bool) – Whether to download high resolution realisation (HRES) or a reduced resolution ten member ensemble (EDA). If True the reduced resolution is fetched. ensemble = True is incompatible with land = True.
  • statistics (None, bool) – When downloading hourly ensemble data, choose whether or not to download statistics (ensemble mean and ensemble spread).
  • synoptic (None, bool) – Whether to get monthly averaged by hour of day (synoptic = True) or monthly means of daily means (synoptic = False).
  • pressurelevels (None, list(int)) – List of pressure level(s) to download 3D variables for. See the Copernicus Climate Data Store website for available pressure levels.
  • merge (bool) – Merge yearly output files (merge = True), or split output files into separate files for every year (merge = False).
  • threads (None, int) – Number of parallel threads to use when downloading. Defaults to a single process.
  • dryrun (bool) – Whether to print the cdsapi request to the screen, or make the request to start downloading the data. dryrun = True will print the request to stdout. By default, the data will be downloaded.
  • prelimbe (bool) – Whether to download the preliminary back extension (1950-1978). Note that in this case, years nust be between 1950 and 1978. prelimbe = True is incompatible with land = True.
  • land (bool) – Whether to download data from the ERA5-Land dataset. Note that the ERA5-Land dataset starts in 1981. land = True is incompatible with the use of prelimbe = True and ensemble = True.
area = None

Coordinates specifying the subregion that will be extracted. Default is None for whole available area.

Type:list(float)
days = None

List of zero-padded strings of days (e.g. [‘01’, ‘02’,…, ‘31’]).

Type:list(str)
ensemble = None

Whether to download high resolution realisation (HRES) or a reduced resolution ten member ensemble (EDA). True downloads the reduced resolution ensemble.

Type:bool
fetch(dryrun=False)[source]

Split calls and fetch results.

Parameters:dryrun (bool) – Boolean indicating if files should be downloaded. By default files will be downloaded. For a dryrun the cdsapi request will be written to stdout.
hours = None

00 formatted time strings (e.g. [‘00:00’, ‘01:00’, …, ‘23:00’]).

Type:list(str)
Type:List of xx
land = None

Whether to download from the ERA5-Land dataset.

Type:bool
merge = None

Merge yearly output files if True.

Type:bool
months = None

List of zero-padded strings of months (e.g. [‘01’, ‘02’,…, ‘12’]).

Type:list(str)
outputformat = None

File format of output file.

Type:str
outputprefix = None

Prefix of output filename.

Type:str
period = None

Frequency of output data (monthly or daily).

Type:str
prelimbe = None

Whether to select from the ERA5 preliminary back extension which supports years from 1950 to 1978

Type:bool
pressure_levels = None

List of pressure levels.

Type:list(int)
statistics = None

When downloading hourly ensemble data, choose whether or not to download statistics (mean and spread).

Type:bool
synoptic = None

Whether to get monthly averaged by hour of day (synoptic=True) or monthly means of daily means (synoptic=False).

Type:bool
threads = None

number of parallel threads to use for downloading.

Type:int
variables = None

List of variables.

Type:list(str)
years = None

List of years.

Type:list(int)