...
Build a basic CDS API request.
You can use the CDS web interface to help you build your CDS API download script.
In the Download data tab, make some selections, then click the button Show API request at the bottom left and you will be presented with the script.
Copy and paste this to your preferred text editor.
Expand title Basic CDS API script example to download temperature at a given pressure level, 1000 hPa is shown HERE. Code Block language text #!/usr/bin/env python import cdsapi c = cdsapi.Client() c.retrieve( 'reanalysis-era5-pressure-levels', { 'product_type': 'reanalysis', 'variable': 'temperature', 'pressure_level': '1000', 'year': '2008', 'month': '01', 'day': '01', 'time': '12:00', 'format': 'netcdf', # Supported format: grib and netcdf. Default: grib }, 'download.nc') # Output file. Adapt as you wish. import cdsapi
- Refine your CDS API script for ERA5 data listed in CDS for optional post-processing.
- For a different grid resolution, use the key 'grid'.
- Please note that the ERA5 native grid of online CDS is 0.25°x0.25° (atmosphere), 0.5°x0.5° (ocean waves), mean, spread and members: 0.5°x0.5° (atmosphere), 1°x1° (ocean waves). ERA5-Land: 0.1°x0.1°. So this will be returned by default.
Expand title Click here for a sample script that downloads temperature at a given pressure level at 1000 hPa for a geographical subset of the data and specified grid Code Block language text #!/usr/bin/env python import cdsapi c = cdsapi.Client() c.retrieve( 'reanalysis-era5-pressure-levels', { 'product_type': 'reanalysis', 'variable': 'temperature', 'pressure_level': '1000', 'year': '2008', 'month': '01', 'day': '01', 'time': '12:00', 'format': 'netcdf', # Supported format: grib and netcdf. Default: grib 'area' : [60, -10, 50, 2], # North, West, South, East. Default: global 'grid' : [1.0, 1.0], # Latitude/longitude grid. Default: 0.25 x 0.25 }, 'era5_temperature_sub_area.nc') # Output file. Adapt as you wish.
...