This package retrieves and loads data from the CERA-20C reanalysis.

To retrieve the data, it uses the ECMWF Public data API. You will need to install a key and the client libraries as described in the API documentation. Note that this is the same system used by - the same key and libraries will let you use that as well.

Only hourly data is supported (no daily or monthly averages) for 7 surface variables:

  • Mean-sea-level pressure: ‘mslp’
  • 2m air temperature: ‘air.2m’
  • Precipitation rate: ‘prate’
  • 10m meridional wind: ‘uwnd.10m’
  • 10m zonal wind: ‘vwnd.10m’
  • Sea-surface temperature: ‘sst’
  • Sea-ice coverage: ‘icec’

Data retrieved is stored in directory $SCRATCH/CERA_20C - the ‘SCRATCH’ environment variable must be set. Data is retrieved in 1-month batches:

For example:

import as cera20c

Will retrieve precipitation rate data for the whole of March 1969, and


will then load the precipitation rates at quarter past 3pm on March 12 1969 from the retrieved dataset as a iris.cube.Cube. Note that as CERA only provides data at 3-hourly intervals, the value for 15.25 will be interpolated between the 15:00 and 18:00 outputs. Also, as CERA is an ensemble dataset, the result will include all 10 ensemble members., year, month)[source]

Get all data for one variable, for one month, from ECMWF’s archive.

Data wil be stored locally in directory $SCRATCH/CERA-20C, to be retrieved by load(). If the local file that would be produced already exists, this function does nothing.

  • variable (str) – Variable to fetch (e.g. ‘prmsl’)
  • year (int) – Year to get data for.
  • month (int) – Month to get data for (1-12).

StandardError – If Variable is not a supported value., year, month, day, hour, fc_init=None)[source]

Load requested data from disc, interpolating if necessary.

Data must be available in directory $SCRATCH/CERA-20C, previously retrieved by fetch().

  • variable (str) – Variable to fetch (e.g. ‘prmsl’)
  • year (int) – Year to get data for.
  • month (int) – Month to get data for (1-12).
  • day (int) – Day to get data for (1-31).
  • hour (float) – Hour to get data for (0-23.99). Note that this isn’t an integer, for minutes and seconds, use fractions of an hour.
  • fc_init (str) – See below

Global field of variable at time.

Return type:


Note that CERA-20C data is only output every 3 hours, so if hour%3!=0, the result will be linearly interpolated in time. If you want data after 21:00 on the last day of a month, you will need to fetch the next month’s data too, as it will be used in the interpolation.

Precipitation data in CERA is a forecast field: once a day (at 18:00) 3-hourly forecast data is calculated for the next 27 hours. So at 21:00, there are 2 sets of precipitation available: a 3-hour forecast starting at 18 that day, and a 27-hour forecast starting at 18:00 the day before; and there is a discontinuity in the fields at that time. This function will always load the shortest lead-time forecast available unless fc_init is set to ‘last’. You will only need this if you are making videos, or otherwise need time-continuous forecast fields, in which case you will need to be clever in smoothing over the discontinuity. For analysis fields (everything except prate), this issue does not arise and fc_init is ignored.

Raises:StandardError – Data not on disc - see fetch()