I try to do the following in a simply little python script, and the API (or queue) takes days to get a month of runoff and sometimes throws errors or stops incomplete. Is it because, in part, much of this data is offline on tape archives? Is there something else I might be doing wrong or I could be doing differently? Is there another way to get the data if the API, queue, tape drive etc are simply unavoidably slow?
import cdsapi
c = cdsapi.Client()
for year in range(1981,2018):
for mon in ["01","02","03","04","05","06","07","08","09","10","11","12"]:
c.retrieve("reanalysis-era5-single-levels", {
"product_type": "reanalysis",
"format": "netcdf",
"variable": "runoff",
"year": str(year),
"month": mon,
}, "runoff."+str(year)+mon+".nc")
I have gotten the following error, as well (but not consistently):
“Exception: Download failed: downloaded 11324683 byte(s) out of 757926348”
Thanks very much for any advice.
5 Comments
Xiaobo Yang
Hi Michael,
Could you try again and let me know what happens?
Thank you,
Xiaobo
Milana Vuckovic
Hi Michael,
I have tried your request and for me it fails because it misses day and time. Might it be that your fails because of this?
Milana
Michael Shaw
Hello. Apologies if I shouldn't put a duplicate from another related thread here, but in case it helps to do so, here it is (below). Also, FYI, I am able to download by month or year without day and time included (to answer your question, Milana).
Thanks so much for your responses.
Michael Shaw
Why it is much slower downloading from 'reanalysis-era5-complete'?
Xiaobo Yang
Many thanks, Michael!