Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have some data I'd like to download from the era5 model via the cdsapi package:

import cdsapi

c = cdsapi.Client()

url = c.retrieve(
    'reanalysis-era5-single-levels',
    {
        'product_type': 'reanalysis',
        'format': 'grib',
        'variable': 'total_precipitation',
        'year': '2021',
        'month': '01',
        'day': '01',
        'time': '00:00',
    },
    'download.grib')

Has this downloaded the the grib file to my computer or has it been created and saved to CDS's site?

If I print url:

Result(content_length=2076600,content_type=application/x-grib,location=https://download-0004.copernicus-climate.eu/cache-compute-0004/cache/data2/adaptor.mars.internal-1612475135.0349507-29868-7-7ed52a50-6bc6-493b-8b3e-92ac91518fd0.grib)

If it's just been saved to that online location is there any way to skip that step and download the data direclty to the computer in that same c.retrieve call?

question from:https://stackoverflow.com/questions/66054515/cdsapi-era5-download-to-computer

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
229 views
Welcome To Ask or Share your Answers For Others

1 Answer

It has been downloaded to your computer, probably to same folder where you run your srript from.

You can also specify different location if you put custom full path instead of 'download.grib'. File can also be found on cds portal in your requests section


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...