era

era(params, stream, levtype, daterange=None, yearrange=None, monthrange=None, years=None, months=None, format='netcdf', forecast=False, step=12, levrange=None, levs=None, grid=None, hours=(0, 6, 12, 18), hour=None, res=None, box=None, filename='era.nc')[source]

Retrieves ERA reanalysis data using the provided API. User must have, in home directory, a file named .ecmwfapirc. See API documentation, but should look like:

{
"url"   : "https://api.ecmwf.int/v1",
"key"   : "abcdefghijklmnopqrstuvwxyz",
"email" : "email@gmail.com"
}

with the key found on your user/profile page on the ECMWF website.

Parameters
  • params (str or list of str) – Variable name. Gets translated to MARS id name by dictionary below. Add to this from the online GRIB table. Pay attention to available groups. If not available for the group you selected (e.g. pressure levs, moda), get ERROR 6 (MARS_EXPECTED_FIELDS). For rates of change of parameterized processes (i.e. diabatic) see this link.

  • stream ({‘oper’, ‘moda’, ‘mofm’, ‘mdfa’, ‘mnth’}) – The data stream.

  • levtype ({‘ml’, ‘pl’, ‘sfc’, ‘pt’, ‘pv’}) – Level type: model, pressure, surface, potential temperature, and 2PVU surface, respectively.

  • levrange (float or (float, float), optional) – Individual level or range of levels.

  • levs (float or ndarray, optional) – Individual level or list of levels.

  • yearrange (int or (int, int)) – Individual year or range of years.

  • years (int or ndarray, optional) – Individual year or list of years.

  • monthrange (int or (int, int), optional) – Individual month or range of months.

  • months (int or ndarray, optional) – Individual month or list of months.

  • daterange ((datetime.datetime, datetime.datetime), optional) – Range of dates.

  • hours ({0, 6, 12, 18} or list thereof, optional) – Hour(s) (UTC) of observation.

  • forecast (bool, optional) – Whether we want forecast 'fc' or analysis 'an' data. Note that some data is only available in 'fc' mode, e.g. diabatic heating.

  • grid (str, optional) – The grid type. Default is N32 which returns data on 64 latitudes.

  • res (float, optional) – Alternative to grid that specifies the desired output grid resolution in degrees. ERA-Interim has a few valid preset resolutions and will choose the resolution that most closely matches the input.

  • box (str or length-4 list of float, optional) – String name for particular region, e.g. 'europe', or the west, south, east, and north boundaries, respectively.

  • format ({‘grib1’, ‘grib2’, ‘netcdf’}, optional) – Output format.

  • filename (str, optional) – Name of file output.

Notes

Some fields (seems true for most model fields) are not archived as monthly means for some reason! Have no idea why because it would need almost zero storage requirements.