Dear
I am very new to CSD API.
Based on CDS API examples in Climate Data Store (CDS) documentation - Copernicus Knowledge Base - ECMWF Confluence Wiki, I tried the script as below,
replacing
‘param’ : ‘130’, with
‘param’ : ‘31’, which is “Sea ice area fraction”, the scripts and the error are as below,
(the script is as below)
import cdsapi
c = cdsapi.Client()
c.retrieve(‘reanalysis-era5-complete’, { # Requests follow MARS syntax
# Keywords ‘expver’ and ‘class’ can be dropped. They are obsolete
# since their values are imposed by ‘reanalysis-era5-complete’
‘date’ : ‘2013-01-01’, # The hyphens can be omitted
‘levelist’: ‘1/10/100/137’, # 1 is top level, 137 the lowest model level in ERA5. Use ‘/’ to separate values.
‘levtype’ : ‘ml’,
‘param’ : ‘31’, # Sea ice area fraction
‘stream’ : ‘oper’, # Denotes ERA5. Ensemble members are selected by ‘enda’
‘time’ : ‘00/to/23/by/6’, # You can drop :00:00 and use MARS short-hand notation, instead of ‘00/06/12/18’
‘type’ : ‘an’,
‘area’ : ‘80/-50/-25/0’, # North, West, South, East. Default: global
‘grid’ : ‘1.0/1.0’, # Latitude/longitude. Default: spherical harmonics or reduced Gaussian grid
‘format’ : ‘netcdf’, # Output needs to be regular lat-lon, so only works in combination with ‘grid’!
}, ‘ERA5-ml-temperature-subarea.nc’) # Output file. Adapt as you wish.
Could you help me to obtain the data of “Sea ice area fraction”?
(the error is as below)
2025-02-20 10:00:38,315 INFO status has been updated to running
2025-02-20 10:01:15,746 INFO status has been updated to failed
Traceback (most recent call last):
File “/Users/takayanamba/Downloads/gmt_script/sst_486/example_1.py”, line 3, in
c.retrieve(‘reanalysis-era5-complete’, { # Requests follow MARS syntax
File “/var/root/miniforge3/lib/python3.11/site-packages/datapi/legacy_api_client.py”, line 169, in retrieve
submitted = self.client.submit_and_wait_on_results(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/var/root/miniforge3/lib/python3.11/site-packages/datapi/api_client.py”, line 413, in submit_and_wait_on_results
return self._retrieve_api.submit(collection_id, request).make_results()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/var/root/miniforge3/lib/python3.11/site-packages/datapi/processing.py”, line 489, in make_results
self._wait_on_results()
File “/var/root/miniforge3/lib/python3.11/site-packages/datapi/processing.py”, line 467, in _wait_on_results
while not self.results_ready:
^^^^^^^^^^^^^^^^^^
File “/var/root/miniforge3/lib/python3.11/site-packages/datapi/processing.py”, line 481, in results_ready
results = self.make_results(wait=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/var/root/miniforge3/lib/python3.11/site-packages/datapi/processing.py”, line 495, in make_results
results = Results.from_request(“get”, results_url, **self._request_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/var/root/miniforge3/lib/python3.11/site-packages/datapi/processing.py”, line 177, in from_request
cads_raise_for_status(response)
File “/var/root/miniforge3/lib/python3.11/site-packages/datapi/processing.py”, line 100, in cads_raise_for_status
raise requests.HTTPError(message, response=response)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://cds.climate.copernicus.eu/api/retrieve/v1/jobs/efd3a552-4d3d-4228-8651-d3b9e96bd867/results
The job has failed.
MARS has returned an error, please check your selection.
Request submitted to the MARS server:
[{‘area’: ‘80/-50/-25/0’, ‘date’: ‘2013-01-01’, ‘grid’: ‘1.0/1.0’, ‘levelist’: ‘1/10/100/137’, ‘levtype’: ‘ml’, ‘param’: ‘31’, ‘stream’: ‘oper’, ‘time’: ‘00/to/23/by/6’, ‘type’: ‘an’, ‘class’: [‘ea’], ‘expver’: [‘1’], ‘database’: ‘fdbmarser’}]
Full error message:
mars - ERROR - 20250220.010039 - Expected 16, got 0.
mars - ERROR - 20250220.010039 - Request failed
mars - ERROR - 20250220.010039 - Some errors reported (last error -1)
Regards,
takaya