Table of Contents
What is the objective of this page?
Info | ||
---|---|---|
| ||
To help users to improve S2S CMA MARS requests performance via the WebAPI.
|
How the S2S data is organised in MARS?
Info |
---|
In general it is organised, as a huge tree, with the indentation below, showing different levels down that tree:
|
What would be the natural way to group requests?
Info |
---|
Following the previous paragraph, the natural way to group requests would be:
|
What is the best approach to loop over several hindcastDates for a CMA request?
Info | ||
---|---|---|
| ||
for hindcastDate in hindcastDate-list (eg, 2010-03-01 to 2010-03-31) |
What is the best approach to get all hindcastDays for several HindcastYears ?
Info | ||
---|---|---|
| ||
|
Info | ||
---|---|---|
| ||
for HindcastYear in HindcastYears |
A simple web API example, requesting Control forecast, sfc for one hindcast date for model version 2014-05-01
Code Block | ||
---|---|---|
| ||
#!/usr/bin/env python from ecmwfapi import ECMWFDataServer modelVersionDate = "2014-05-01" hindcastDate = "2014-04-01" # The selected hindcast date server = ECMWFDataServer() server.retrieve({ "class": "s2", "dataset": "s2s", "date": ModelVersionDate, "expver": "prod", "hdate": hindcastDate, "levtype": "sfc", "origin": "babj", "param": "165", "step": "0", "stream": "enfh", "target": "data.cf.sfc", "time": "00", "type": "cf", }) |
Info |
---|
|
A web API example requesting data for several hindcastDates (iterating over several hindcastYears, hindcastMonths and hindcastDays)
Info |
---|
|
Code Block | ||
---|---|---|
| ||
#!/usr/bin/env python from ecmwfapi import ECMWFDataServer server = ECMWFDataServer() def retrieve_data(hindcastDate): target = "target_s2s_%s.grb" % hindcastDate server.retrieve({ "class": "s2", "dataset": "s2s", "date": "2014-05-01", "expver": "prod", "hdate": hindcastDate, "levtype": "sfc", "origin": "babj", "param": "165", "step": "0", "stream": "enfh", "target": target, "time": "00", "type": "cf", }) for hindcastYear in ["2012", "2013"]: for hindcastMonth in ["08", "09"]: for hindcastDay in ["01", "02"]: hindcastDate = hindcastYear+hindcastMonth+hindcastDay retrieve_data(hindcastDate) |