pydune.data_processing.meteorological.downloadCDS.getting_CDSdata#

getting_CDSdata(dataset, variable_dic, name, Nsplit=1, file='info.txt', on_grid=False, all_requests_directly=True, dt_check=30, dt_print=120)[source]#
This fuction helps to download data from datasets stored in the Climate Data Store.

It splits data per integer year and then merge the data back together. This is sufficient at the moment as for most dataset you can download a whole year of a single variable.

Parameters:
  • dataset (int) – dataset in which downloading the data. It can be ‘reanalysis-era5-single-levels’, ‘reanalysis-era5-land’ or “reanalysis-era5-pressure-levels” for now.

  • variable_dic (dic) – variable dictionnary to provide as a request.

  • name (str) – name used to label the downloaded files.

  • Nsplit (int) – number of requests in which the main request is split (the default is 1). If too small, will be corrected automatically.

  • file (str) – filename under which some information about the request will be saved (the default is ‘info.txt’).

  • on_grid (bool) – if True, the required coordinates will be matched with the native grid of the requested dataset. Otherwise, the dataset will be downloaded at the requested coordinates, using the interpolation of the CDS server (the default is False).

  • all_requests_directly (bool) – if True, all requests are sent at once, and then status is checked periodically every dt_check until completion, and then all files are downloaded. If False, requests are processed and downloaded one by one (the default is True).

  • dt_check (float) – seconds between every status check when all_requests_directly is True. (the default is 30)

  • dt_print (float) – seconds between every status print when all_requests_directly is True. (the default is 120)

Returns:

file_names – the list of downloaded file names

Return type:

list

Examples

>>> month = [i for i in range(1, 13)]
>>> day = [i for i in range(1, 32)]
>>> time = [i for i in range(0, 24)]
>>> year = [i for i in range(1950, 2023)]
>>> area = [-16.65, 11.9, -16.66, 11.91]
>>> variable_dic = {'format': 'netcdf',
                'variable': ['v10'],
                'month': month,
                'day': day,
                'time': time,
                'year': year,
                'area': area,
                'grid': [1.0, 1.0]}
>>> a = CDS.Getting_wind_data('reanalysis-era5-land',
                          variable_dic, 'Angola_coast_v10',
                          Nsplit=6,
                          file='info.txt',
                          on_grid=False)