ERA5

pansat.products.reanalysis.era5

This module defines the ERA5 product class, which represents all supported ERA5 products.

class pansat.products.reanalysis.era5.ERA5Product(tsteps, levels, variables, domain=None)

The ERA5 class defines a generic interface for ERA5 products.

tsteps

“monthly” or “hourly” to choose resolution of output timesteps

Type

str

levels

“surface”, “pressure” or “land”. <surface> contains surface data and column-integrated values, pressure levels contains data throughout the atmosphere column and <land> contains data from surface to soil depth

Type

str

name

The full name of the product according to Copernicus webpage

Type

str

variables

List of variable names provided by this product.

Type

list

domain

list of strings to select region [lat1, lat2, lon1, lon2] if None: global data will be downloaded

Type

list

__init__(tsteps, levels, variables, domain=None)

Initialize self. See help(type(self)) for accurate signature.

__str__()

The full product name.

_get_provider()

Find a provider that provides the product.

property default_destination

The default destination for ERA5 product is ERA5/<product_name>>

download(start, end, destination=None)

Download data product for given time range.

Parameters
  • start_time (datetime) – datetime object defining the start date of the time range.

  • end_time (datetime) – datetime object defining the end date of the of the time range.

  • destination (str or pathlib.Path) – The destination where to store the output data.

Returns

name list of all downloaded files for data product

Return type

downloaded(list)

filename_to_date(filename)

Extract timestamp from filename.

Parameters

filename (str) – Filename of a ERA5 product.

Returns

datetime object representing the timestamp of the filename.

matches(filename)

Determines whether a given filename matches the pattern used for the product.

Parameters

filename (str) – The filename

Returns

True if the filename matches the product, False otherwise.

classmethod open(filename)

Opens a given file of NCEP product class as xarray.

Parameters

filename (str) – name of the file to be opened

Returns

xarray dataset object for opened file

Return type

datasets(xarray.Dataset)

exception pansat.products.reanalysis.era5.NoAvailableProviderError

Exception indicating that no suitable provider could be found for a product.

__weakref__

list of weak references to the object (if defined)