You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

!!!!!!!!!!! UNDER CONSTRUCTION !!!!!!!!!!!!!

How is the UERRA data organised in MARS?

In general it is organised, as a huge tree, with the indentation below, showing different levels down that tree:

  • type of data (analysis, forecast, 4D analysis increments)
    • year
      • month
        • type of level (model level, pressure level, surface) 

What would be the natural way to group requests?

The idea is to request as much data as possible from the same tape file (star) . The natural way to group requests would be:
all parameters, all levels, all time-steps for all dates of a month

(warning) Note: 'all' means 'all' that the user wants. It doesn't have to be all parameters.

Web-API examples:

Example 1: An ERA interim daily pl request

  • The objective of this example is to demonstrate how to iterate efficiently over some years, for a particular ERA interim, daily, pressure level request.
  • At this point you may wish to have a look on the  ERA interim daily availability
  • The request below can be used as a starting point, however you need to keep in mind that you have to adapt it to your needs eg to set the keyword, values according to your requirements (eg add or remove 'param', 'levtype', 'step' etc).
  • In this way you can extend this example to download a longer period or even the whole ERA interim dataset.

(smile) You can use the variable 'target' to organise the requested data in separate files if you wish.

#!/usr/bin/env python
import calendar
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()

def retrieve_interim():
    """       
       A function to demonstrate how to iterate efficiently over several years and months etc     
       for a particular interim_request.      
       Change the variables below to adapt the iteration to your needs. 
       You can use the variable 'target' to organise the requested data in files as you wish.
       In the example below the data are organised in files per month. (eg "interim_daily_201510.grb")
    """
    yearStart = 2014
    yearEnd = 2015
    monthStart = 1
    monthEnd = 12
    for year in list(range(yearStart, yearEnd + 1)):
        for month in list(range(monthStart, monthEnd + 1)):
            startDate = '%04d%02d%02d' % (year, month, 1)
            numberOfDays = calendar.monthrange(year, month)[1]
            lastDate = '%04d%02d%02d' % (year, month, numberOfDays)
            target = "interim_daily_%04d%02d.grb" % (year, month)
            requestDates = (startDate + "/TO/" + lastDate) 
            interim_request(requestDates, target)

def interim_request(requestDates, target):
    """       
        An ERA interim request for analysis pressure level data.
        Change the keywords below to adapt it to your needs.
        (eg to add or to remove  levels, parameters, times etc)
        Request cost per day is 112 fields, 14.2326 Mbytes 
    """
    server.retrieve({
        "class": "ei",
        "stream": "oper",
        "type": "an",
        "dataset": "interim",
        "date": requestDates,
        "expver": "1",
        "levtype": "pl",
        "levelist": "100/500/700/750/850/925/1000",
        "param": "129.128/133.128/157.128/248.128",
        "target": target,
        "time": "00/06/12/18",
        "grid": "0.75/0.75"
    })
if __name__ == '__main__':
    retrieve_interim()

Useful links

 

 



  • No labels