I have some data I'd like to download from the era5 via the cdsapi package.
I do know most data can be downloaded via using cdsapi.Client.retrieve function. Such as many examples I can find at stack overflow (cdsapi era5 download to computer).
However, the data I want is the statistic data (https://cds.climate.copernicus.eu/cdsapp#!/software/app-c3s-daily-era5-statistics?tab=app), and they are provided by ERA5 daily statistics calculator, and can be dowmloaded by via CDS API according to ERA5 daily statistics user guide (https://datastore.copernicus-climate.eu/documents/app-c3s-daily-era5-statistics/C3S_Application-Documentation_ERA5-daily-statistics-v2.pdf). So after read the guide, I used following python script to download, and it worked. However, the only problem here is the data I got had the random file name, and it would be very hard to find certain file.
1 .So I'm wondering if there is any way I can set the download filename myself when downloading the data
- My second question is the script only allows me to down one variable (2m_temperature) in one nc file, however, I want to other variables can be downloaded at the same time, I've tried to added more (I have commented out the other required variables), but I got the error like "TypeError: Object of type 'set' is not JSON serializable", so I'm wondering if it is possible to download multiple variables
`
import cdsapi
c = cdsapi.Client(timeout=600)
YEARS = range(1950,1951)
MONTHS = ["01","02","03","04","05","06","07","08","09","10","11","12"]
for year in YEARS:
for month in MONTHS:
result = c.service(
"tool.toolbox.orchestrator.workflow",
params={
"realm": "user-apps",
"project": "app-c3s-daily-era5-statistics",
"version": "master",
"kwargs": {"dataset": "reanalysis-era5-single-levels",
"product_type": "reanalysis",
"variable": "2m_temperature",
# "variable": {"2m_temperature", "2m_dewpoint_temperature", "10m_u_component_of_wind", "10m_v_component_of_wind"},
"statistic": "daily_mean",
"year": year,
"month": month,
"time_zone": "UTC+00:00",
"frequency": "1-hourly",
"grid": "0.25/0.25",
"area": {"lat": [25.15265, 52.84375], "lon": [-124.59375, -67.03125]}
},
"workflow_name": "application"
})
c.download(result)