[Wrf-users] Downloading ERA-Interim data via Python or Mars request

Dominikus Heinzeller climbfuji at ymail.com
Mon May 23 11:04:23 MDT 2016


Hi Juliet,

I think it should be

server = ECMWFDataServer()

in your script. I use the attached script to download ERA-Interim data for a range of times defined as command line arguments. The documentation is pretty poor, but with a little bit of knowledge about python it should work.

Simply follow the instructions on the ECMWF website to install the client library, something like

pip install ecmwf-api-client

and adjust the scratchdir/finaldir entries in the attached script. Then use

	./mars_request_all.py STARTDATE ENDDATE

with STARTDATE and ENDDATE as %Y%m%d%H%M (see Python datetime module for the placeholders).

The script downloads the different data sets needed to run WRF and cats them all into one grib file per time step.

Send an email to me (not the entire group, please) if you have problems using the script.

Cheers

Dom



> On 21/05/2016, at 2:50 PM, afwande juliet <afwandej965 at gmail.com> wrote:
> 
> Hi all
> has someone has experince in getting ERAhttp://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=pl/batch/290323/-interim <http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=pl/batch/290323/-interim> data ffrom 
> 
> uisng python or MARS request.
> I get error in this python script 
> ./script.pyFile "./script.py", line 3
>     server = ECMWFDataServer(http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=pl/batch/290323/ <http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=pl/batch/290323/>)
> SyntaxError: invalid syntax
> 
> the script looks like this
> 
> 
> #!/usr/bin/env python
> from ecmwfapi import ECMWFDataServer
> server = ECMWFDataServer(http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=pl/batch/290323/ <http://apps.ecmwf.int/datasets/data/interim-full-daily/levtype=pl/batch/290323/>)
> server.retrieve({
>     "class": "ei",
>     "dataset": "interim",
>     "date": "1997-01-01/to/2002-12-31",
>     "expver": "1",
>     "grid": "0.75/0.75",
>     "levelist": "1/2/3/5/7/10/20/30/50/70/100/125/150/175/200/225/250/300/350/400/450/500/550/600/650/700/750/775/800/825/850/875/900/925/950/975/1000",
>     "levtype": "pl",
>     "param": "129.128/130.128/131.128/132.128/133.128",
>     "step": "0",
>     "stream": "oper",
>     "time": "06:00:00",
>     "type": "an",
>     "target": "PRESSURE",
> 
> or what about MARS request???
> I have tried to read the site ttps://software.ecmwf.int/wiki/display/WEBAPI/Python+ERA-interim+examples <http://software.ecmwf.int/wiki/display/WEBAPI/Python+ERA-interim+examples>
> but cant understand
> _______________________________________________
> Wrf-users mailing list
> Wrf-users at ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/wrf-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/wrf-users/attachments/20160523/e76ea815/attachment-0002.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mars_request_all.py
Type: text/x-python-script
Size: 3629 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/wrf-users/attachments/20160523/e76ea815/attachment-0001.bin 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/wrf-users/attachments/20160523/e76ea815/attachment-0003.html 


More information about the Wrf-users mailing list