I am using a python script to download from ERA5:


import cdsapi

c = cdsapi.Client()

latitude = 43.1 # North, South
longitude = -1.5 # West , East
 
r = c.retrieve(
'reanalysis-era5-single-levels',
{
'product_type':'reanalysis',
'variable':[
'100m_u_component_of_wind','100m_v_component_of_wind','10m_u_component_of_wind','10m_v_component_of_wind','2m_temperature',
'surface_pressure'
],
'area' : str(latitude)+'/'+str(longitude)+'/'+str(latitude)+'/'+str(longitude), # North, West, South, East. Default: global
'year':'2018',
'grid':'0.1/0.1', # Latitude/longitude grid in degrees: east-west (longitude) and north-south resolution (latitude). Default: reduced Gaussian grid
'month':'01',
'day':[
'01','02','03',
'04','05','06',
'07','08','09',
'10','11','12',
'13','14','15',
'16','17','18',
'19','20','21',
'22','23','24',
'25','26','27',
'28','29','30',
'31'
],
'time':[
'00:00','01:00','02:00',
'03:00','04:00','05:00',
'06:00','07:00','08:00',
'09:00','10:00','11:00',
'12:00','13:00','14:00',
'15:00','16:00','17:00',
'18:00','19:00','20:00',
'21:00','22:00','23:00'
],
'format':'netcdf'
}
)
request_finished = 1

r.download('download_grid_reduction_one_month_point_limit.nc')
download_finished = 1


Is there any command on the cdsapi library to detect if the request is completed? And if the download is completed?

4 Comments

  1. Dear Inigo,

    I don't think there is a command available to do what you asked for. However, you can check status of your requests by logging into the CDS, and then click the 'Your requests' tab.

    You can monitor your download progress by upgrading your CDS API client library to the latest version, see CDS API 0.1.6 has been released.

    I hope this helps.

    Kind regards,

    Xiaobo

  2. Hello Xiaobo,

    I now that you can monitor on the web and with the last version of the api, but I want to automatize the process.

    I am trying to execute the request from matlab. I have the request on python (code I showed above). I integrated this code on a python function and I call this function from matlab. The thing is I need to know when the download is fulfilled to continue executing the matlab code.

    Is there any option to make the request using matlab?

    Best regards,

    Iñigo.

  3. Hi Iñigo,

    I have to say I do not know. I will check with our technical team.

    Kind regards,

    Xiaobo

  4. Hi Iñigo,

    Our technical expert wants to know more about how you are calling the Python data request script from Matlab. Could you describe in details?

    By the way, do you call your Python script with an ‘&’ at the end of the line?

    Thank you,

    Xiaobo