Computational Science Community Wiki

Revision 2 as of 2014-01-24 17:32:23

Clear message

ECMWF Meterology, and how to get it.

This page details the methods used to download meterology data from ECMWF, both from their website, and from their data servers.

Website Access for Interim (and other data) and batch scripts for downloading

The new server for batch access has changed the system slightly from the old one. To run, go to: https://software.ecmwf.int/wiki/display/WEBAPI/Accessing+ECMWF+data+servers+in+batch Register to get the token and key. Put this into a file in you home directory called: .ecmwfapirc

 {
    "url"   : "https://api.ecmwf.int/v1",
    "key"   : "###############",
    "email" : "XXXX@YYYY.ac.uk"
 }

Then register for particular database by clicking on relavent link (e.g. for interim data) Set up your environment following instructions on the website e.g.  export PYTHONPATH=/Users/scott_a_n/ecmwf-api-client-python  Run script to download data:

   1 #!/usr/bin/env python
   2 
   3 import time
   4 from datetime import date
   5 
   6 # export PYTHONPATH = /usr/bin/ecmwfapi
   7 from ecmwfapi import ECMWFDataServer
   8  
   9 server = ECMWFDataServer()
  10 
  11 # Set dates for data extraction - SAMBBA campaign period
  12 idate = date(2012,07,01)
  13 edate = date(2012,10,31)
  14 
  15 while (idate <= edate):
  16 
  17     iyear = idate.year
  18     imonth = idate.month
  19     iday = idate.day
  20 
  21     strdate = "%d%02d%02d" % (iyear, imonth, iday)
  22     print strdate   
  23 
  24     # extract 3D data
  25     server.retrieve({
  26         'dataset' : "interim",
  27         'step'    : "0",
  28         'levtype' : "pl",
  29         'levelist': "all",
  30         'date'    : strdate,
  31         'time'    : "00/06/12/18",
  32         'origin'  : "all",
  33         'type'    : "an",
  34         'param'   : "129/130/131/132/157",
  35         'grid'    : "128",
  36         'target'  : "pl_"+strdate+".grib"
  37         })
  38 
  39     # extract surface data
  40     server.retrieve({
  41         'dataset' : "interim",
  42         'step'    : "0",
  43         'levtype' : "sfc",
  44         'date'    : strdate,
  45         'time'    : "00/06/12/18",
  46         'origin'  : "all",
  47         'type'    : "an",
  48         'param'   : "172/134/151/165/166/167/168/235/33/34/31/141/139/170/183/236/39/40/41/42",
  49         'grid'    : "256", # use higher resolution surface data
  50         'target'  : "sfc_"+strdate+".grib"
  51         })
  52 
  53     # move to next day
  54     
  55     idate = idate.replace(day=idate.day + 1)
  56 
  57 print "End."

ECMWF data server - use this for accessing Operational Data

Access

Access to ECMWF met files can be applied for from here: http://www.ecmwf.int/about/computer_access_registration/forms/ Contact at ECMWF is Roddy Sharp (roddy[dot]sharp[at]metoffice[dot]gov[dot]uk)

Obtaining Data

Example script:

to be added...