@@ -58,6 +58,7 @@ def _m_to_cm(m):
5858
5959
6060def get_era5 (latitude , longitude , start , end , variables , api_key ,
61+ dataset = "reanalysis-era5-single-levels-timeseries" ,
6162 map_variables = True , timeout = 60 ,
6263 url = 'https://cds.climate.copernicus.eu/api/retrieve/v1/' ):
6364 """
@@ -84,6 +85,10 @@ def get_era5(latitude, longitude, start, end, variables, api_key,
8485 See [1]_ for additional options.
8586 api_key : str
8687 ECMWF CDS API key.
88+ dataset : str, default "reanalysis-era5-single-levels-timeseries"
89+ The dataset to query. May be either
90+ "reanalysis-era5-single-levels-timeseries" or
91+ "reanalysis-era5-land-timeseries".
8792 map_variables : bool, default True
8893 When true, renames columns of the DataFrame to pvlib variable names
8994 where applicable. Also converts units of some variables. See variable
@@ -137,7 +142,7 @@ def _to_utc_dt_notz(dt):
137142 "data_format" : "csv"
138143 }
139144 }
140- slug = "processes/reanalysis-era5-single-levels-timeseries /execution"
145+ slug = f "processes/{ dataset } /execution"
141146 response = requests .post (url + slug , json = params , headers = headers ,
142147 timeout = timeout )
143148 submission_response = response .json ()
0 commit comments