I want to access ECMWF data via a python script. I am not sure how to do that. I followed the instruction given on the website: Accessing ECMWF data server in batch
Unfortunately it says: "This method is only supported to UNIX platforms with Python." I am on a Windows platform. Does that mean I can't access the data from ECMWF? If this method is only for UNIX-Users only, is there an alternative for Windows-User?
So far I did the following:
created textfile in my homedirectory with content: C:\User\Name\ .ecmwfapirc.txt
{
"url" : "https://api.ecmwf.int/v1",
"key" : "my-API-code",
"email" : "[email protected]"
}
Next I installed python library: ecmwfapi
python -m pip install https://software.ecmwf.int/wiki/download/attachments/56664858/ecmwf-api-client-python.tgz
Last but not least I created the python script which looks like:
#!/usr/bin/env python
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
server.retrieve({
"class": "e2",
"dataset": "era20c",
"date": "2010-01-01/to/2010-12-31",
"expver": "1",
"levtype": "sfc",
"param": "167.128",
"stream": "oper",
"time": "12:00:00",
"type": "an",
"target": "CHANGEME",
})
I am not sure if the python script is correct either. Also I don't know whether the location of the python script is important when executed.