cyclone-forecast-india / data_fetcher.py
Yashk-13's picture
Create data_fetcher.py
536c6a4 verified
raw
history blame contribute delete
593 Bytes
import cdsapi
def download_era5(date: str, outfile: str):
c = cdsapi.Client()
c.retrieve(
'reanalysis-era5-single-levels',
{
'product_type': 'reanalysis',
'variable': ['2m_temperature', 'mean_sea_level_pressure', '10m_u_component_of_wind', '10m_v_component_of_wind'],
'year': date[:4],
'month': date[5:7],
'day': date[8:10],
'time': ['00:00', '06:00', '12:00', '18:00'],
'area': [35, 65, 5, 95], # North, West, South, East
'format': 'netcdf',
},
outfile)