ERA5 Related Tutorials#
This page explains how you can setup access to ERA5 data from the Copernicus Data Store.
Creating a CDS account#
To download the ERA5 data from the CDS, you’ll need to create a free CDS account here.
Download data through CDS API#
Once your account has been created, you’ll need to set up access to the API by doing the following:
Log into your CDS account and visit your profile page.
Install the API key. There will be a section called Personal Access Token. You will then need to copy these two lines this into a file called .cdsapirc that you will create in your user root folder.
macOS/Linux: For macOS or Linux, you can create .cdsapirc by opening a terminal window and running
touch ~/.cdsapircto create the file and thenecho [line 1 of the code] >> ~/.cdsapircfollowed byecho [line 2 of the code] >> ~/.cdsapirc.Windows: For Windows, the process is slightly more complicated. Please refer to an in-depth guide at the Copernicus Knowledge Base here.
Install the CDS API client by opening a terminal/shell and running
pip install ".[download]", assuming you are in Geodata’s root directory.Once you’ve installed the API key and the API client, you can confirm access by running an example in a Python script or a Jupyter notebook.
import cdsapi
c = cdsapi.Client()
c.retrieve(
"reanalysis-era5-single-levels",
{
"product_type": "reanalysis",
"format": "netcdf",
"variable": [
"2m_dewpoint_temperature",
"2m_temperature",
],
"year": "2011",
"month": [
"01",
],
"day": ["01", "02", "03"],
"time": [
"00:00",
"12:00",
],
},
"download.nc",
)
The above example downloads 2m temperature and 2m dewpoint temperature with data points at 00:00 and 12:00 for each day, from January 1-3, 2011, in NetCDF format.
More Resources on ERA5#
We’ve also provide a few tutorials on how to interact with the ERA5 datasets using Geodata. They can be found in the links below.