...
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
## === retrieve EFAS Seasonal Forecast ===
## === subset Switzerland region ===
import cdsapi
if __name__ == '__main__':
c = cdsapi.Client()
YEARS = ['%d'%(y) for y in range(2020,2022)]
MONTHS = ['%02d'%(m) for m in range(1,13)]
LEADTIMES = ['%d'%(l) for l in range(24,5160,24)]
for year in YEARS:
for month in MONTHS:
c.retrieve(
'efas-seasonal',
{
'variable': 'river_discharge_in_the_last_24_hours',
'format': 'grib',
'model_levels': 'surface_level',
'year': year,
'month': '12' if year == '2020' else month,
'leadtime_hour': LEADTIMES,
'area': [ 47.59, 5.58, 45.07, 10.56 ]
},
f'efas_seasonal_{year}_{month}.grib') |
...