...
Info |
---|
for date in dates |
Web-API examples:
Two TIGGE requests (sfc and pl), for some dates, for the same "origin"
Info |
---|
Keep in mind that the most efficient way to organise your requests is per dates and times ie select a set of dates and times and add, the 'steps', 'origins', 'levels' and 'parameters' that you need. It is not efficient to organise your requests per parameter, per origin or per step. (eg to submit a different request per parameter for a list of dates) |
Code Block | ||
---|---|---|
| ||
#!/usr/bin/env python from ecmwfapi import ECMWFDataServer server = ECMWFDataServer() def retrieve_tigge_data(): dates = ['2014-10-01', '2014-11-01'] times = ['00', '12'] for date in dates: for time in times: target = 'ecmwf_sfc_%s_%s.grb' % (date, time) tigge_pf_sfc_request(date, time, target) target = 'ecmwf_pl_%s_%s.grb' % (date, time) tigge_pf_pl_request(date, time, target) def tigge_pf_pl_request(date, time, target): ''' A TIGGE request for perturbed forecast, pressure level, ECMWF Center. Please note that a subset of the available data is requested below. The cost of this request is xxx fields and xxx GB Change the keywords below to adapt it to your needs. (ie to add more parameters, or numbers etc) ''' server.retrieve({ 'class': 'ti', 'dataset': 'tigge', 'date': date, 'expver': 'prod', 'grid': '0.5/0.5', 'levelist': '200/250/300/500/', 'levtype': 'pl', 'number': '1/TO/10', 'origin': 'ecmf', 'param': '130/131/132/133', 'step': '0/TO/96/BY/12', 'target': target, 'time': time, 'type': 'pf', }) def tigge_pf_sfc_request(date, time, target): ''' A TIGGE request for perturbed forecast, sfc, ECMWF Center. Please note that a subset of the available data is requested below. The cost of this request is xxx fields and xxx GB Change the keywords below to adapt it to your needs. (ie to add more parameters, or numbers etc) ''' server.retrieve({ 'class': 'ti', 'dataset': 'tigge', 'date': date, 'expver': 'prod', 'grid': '0.5/0.5', 'levtype': 'sfc', 'number': '1/TO/10', 'origin': 'ecmf', 'param': '146/147/151/165/166/167/168/176/177', 'step': '0/TO/96/BY/12', 'target': target, 'time': time, 'type': 'pf', }) if __name__ == '__main__': retrieve_tigge_data() |
A TIGGE sfc request for some dates, for several "origins"
Info |
---|
|
...