4
$\begingroup$

I have been extracting ERA5 data through the Web API. Now I am shifting to CDS API. In the web API I used the below code to download time series data at a particular lat/lon. In the CDS API, I can't find an equivalent to "ct.geo.extract_point()". Is there an equivalent? If not, is there a way in which the area keyword can be tweaked to serve the purpose?

import cdstoolbox as ct

@ct.application(title='Data')
@ct.output.download()
def retrieve_sample_data():
    """
    Application main steps:

    - retrieve a variable from CDS Catalogue
    - produce a link to download it.
    """

    data = ct.catalogue.retrieve(
        'reanalysis-era5-single-levels',
        {
            'variable': 'peak_wave_period', 
            'product_type': 'reanalysis',
            'year': '1991',
            'month': [
                '01', '02', '03', '04', '05', '06',
                '07', '08', '09', '10', '11', '12'
            ],
            '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', '03:00', '06:00', '09:00', '12:00', '15:00', '18:00', '21:00'
            ],
        }
    )
    data_se = ct.geo.extract_point(data, lon=80.5, lat=12)

    return data_se
```
$\endgroup$
  • $\begingroup$ Welcome to EarthScience.SE! I would use the area keyword as you suggested above. However, I am not an expert of the CDI API. For readers who are not familiar with the usage of area in the call of retrieve please see Example 1 at this page: confluence.ecmwf.int/display/CKB/… $\endgroup$ – daniel.neumann Dec 13 '19 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.