Page tree
Skip to end of metadata
Go to start of metadata

(warning) Note:

  • The instructions below apply only to ERA5 test data.
  • For the final release of ERA5 data there will be a different procedure

Steps:

1. Create an ECMWF User account

The instructions below assume the following :

  1. You are familiar with ECMWF Web API ie the programmatic way to download ECMWF public datasets.
  2. You have an ECMWF user account.

2. Accept the terms and conditions (licence) for ERA5 test data

ERA5 test dataset is public and free of charge however you need to accept the ERA5 Test terms & Conditions (Licence)

3. Check data availability

(info) ERA5 test data is available from: 2016-01-01 to: 2016-02-29 (ie 2 months)

(lightbulb) Before you start downloading data we strongly recommend you to visit the ERA5 Test Catalogue. Navigate through the contents of the dataset, select the data you are interested in and check the availability .

(thumbs up) After each selection the pages are updated dynamically to reflect the data availability in MARS.

Also read the ERA5_test data documentation .

4. Create your Web API retrieval script

(lightbulb) To create a Web API retrieval script visit ERA5 Test Catalogue as described above, make your selections and click on the View the MARS request.
This will show you a Python script based on your selection. Copy the script, adapt it as required, and run it from Python.

(info) For your convenience some static examples are provided below, however we strongly recommend you to use the dynamic interface above.

(info) Please note that the default output file format is GRIB. For an output in netCDF add "format":"netcdf" in the retrieval script (see example below).

 

Examples:

Example 1: Daily surface instantaneous data (temperature and wind speed)

This script retrieves minimum and maximum 2m temperature and 10m u and v wind components, on surface level, as hourly data, over a five day period.

 

#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
    
server = ECMWFDataServer()
    
server.retrieve({
    'dataset'   : "era5_test",
    'stream'    : "oper",	# 'oper' specifies the high resolution daily data, as opposed to monthly means, wave, eda edmm, etc.
    'type'      : "an",    # We want instantaneous parameters, which are archived as type Analysis ('an') as opposed to forecast (fc)
    'levtype'   : "sfc",   # Surface level, as opposed to pressure level (pl) or model level (ml)
    'param'     : "2t/10u/10v",   # For parameter codes see the ECMWF parameter database at http://apps.ecmwf.int/codes/grib/param-db
    'grid'      : "0.3/0.3",     # The spatial resolution in ERA5 is 31 km globally on a Gaussian grid. Here we use lat/long with 0.3 degrees, which is approximately the equivalent of 31km.
    'time'      : "00/to/23/by/1",  # ERA5 provides hourly analysis
    'date'      : "2016-01-01/to/2016-01-05",
    'target'    : "era5_test_2016-01-01to2016-01-05_hourly.grib" # Default output format is GRIB
 })

Example 2: Daily surface accumulated data (total precipitation)

This script retrieves total precipitation, on surface level, over a five day period, from day 1, 06:00 to day 5, 06:00, in NetCDF format.

The accumulations in ERA5 are since the ppp (previous post processing), not from the beginning of the forecast (like ERA-Interim).

Accumulations are in the hour ending at the forecast step.

Thus, to get a five day period (day 1, 06:00 to day 5, 06:00) we have to specify for each day start times 06 and 18, each with the accumulations for hours 1 to 12. Post download we have to sum all values up.

#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
    
server = ECMWFDataServer()
    
server.retrieve({    
    'dataset'   : "era5_test",  
    'stream'    : "oper",						# 'oper' specifies the high resolution daily data, as opposed to monthly means, wave, eda edmm, etc.
    'type'      : "fc",        					# In ERA5_test accumulated data is specified as 'fc'.
    'levtype'   : "sfc",						# Surface level
    'param'     : "tp",    						# We want total precipitation (tp). For parameter codes see the ECMWF parameter database at http://apps.ecmwf.int/codes/grib/param-db
    'date'      : "2016-01-01/to/2016-01-05", 	# Specify the time period for the data
    'time'      : "06/18",  					# Accumulated data (type fc) is available for start time 06 and 18, here we use both
	'step'		: "1/to/12/by/1",			   	# In the 'oper' stream the accumulations are hourly, in the hour ending at the forecast step. Here we get 12 individual hourly accumulations (starting from 06:00 and 18:00 as specified in 'time'). The maximum accumulation step is 18 hours.
    'grid'      : "0.3/0.3",     		# The spatial resolution in ERA5 is 31 km globally on a Gaussian grid. Here we use lat/long with 0.3 degrees, which is approximately the equivalent of 31km.
    'target'    : "era5_test_2016-01-01to2016-01-05_TPrec.nc",	# Specify the output file name
    'format'    : "netcdf"						# Here we want NetCDF files. If you want GRIB files (the default file format) remove this line
 })

Example 3: Wave data

This script retrieves the Maximum individual wave height (parameter ID 140218), Mean wave direction (140230) and Model bathymetry (140219), for a single day, at midday, in GRIB format.

#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer

server = ECMWFDataServer()

server.retrieve({
  'dataset' : "era5_test",
  'stream' : "wave",
  'type' : "an",
#  'levtype' : "sfc",  # It is not strictly necessary to specify 'levtype' because wave defaults to 'levtype'='sfc'.
#  The following is the list of wave fields on surface level, see https://software.ecmwf.int/wiki/display/CKB/ERA5_test+data+documentation table 6.  We only omit the parameter 140251 (2D wave spectra), see next example. 
  'param' : "140218/140230/140219",
  'time' : "12",
  'date' : "2016-01-01",
  'target' : "era5_test_2016-01-01_12Z_waveAN.grib"
})

Example 4: Wave spectra

This script retrieves wave spectra, over a five day period, daily at midnight and midday, in GRIB format.

 

#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer

server = ECMWFDataServer()

server.retrieve({
  'dataset' : "era5_test",
  'stream' : "wave",
  'type' : "an",
# 'levtype' : "sfc",					# It is not strictly necessary to specify 'levtype' because wave defaults to 'levtype'='sfc'.
  'param' : "2dfd",						# 2D wave spectra. shortName 2dfd - see http://apps.ecmwf.int/codes/grib/param-db?id=140251 . You could also use paramId 251.140 (but not 140251). 
  'time' : "00:00:00/12:00:00",
  'date' : "2016-01-01/to/2016-01-05",
  'frequency' : "1/to/30", 				# wave spectra are available for 30 frequencies. You could also say 'frequency' : "all".
  'direction' : "1/to/24", 				# wave spectra are available for 24 directions.  You could also say 'direction' : "all".
  'target' : "era5_test_2016-01-01_2016-01-05_0012Z_wavespectraAN.grib"
})

Known Issues

  • Due to an error in the sea-surface temperature field for 29 February 2016 , the quality of some atmospheric parameters is affected for this date. This will be rectified in the official ERA5 release.

Support