You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Downloading long timeseries for CMEMS is slow with dfm_tools, even though the actual download happens with a daily frequency. This is probably since per default the entire requested dataset is opened, from which then daily subsets are retrieved:
This example shows that when cutting it up in monthly chunks, the download is way faster compared to retrieving at once:
importdfm_toolsasdfmtimportpandasaspd# spatial extentslon_min, lon_max, lat_min, lat_max=12.5, 16.5, 34.5, 37# time extentsdate_min='2017-12-01'date_max='2022-07-31'# make list of start/stop times (tuples) with monthly frequency# TODO: this approach improves performance significantlydate_range_start=pd.date_range(start=date_min, end=date_max, freq='MS')
date_range_end=pd.date_range(start=date_min, end=date_max, freq='ME')
monthly_periods= [(start, end) forstart, endinzip(date_range_start, date_range_end)]
# make list of start/stop times (tuples) to download all at once (but still per day)# TODO: this is the default behaviour and is slowmonthly_periods= [(date_min, date_max)]
forperiodinmonthly_periods:
dfmt.download_CMEMS(varkey='uo',
longitude_min=lon_min, longitude_max=lon_max, latitude_min=lat_min, latitude_max=lat_max,
date_min=period[0], date_max=period[1],
dir_output=".", overwrite=True, dataset_id='med-cmcc-cur-rean-d')
Downloading long timeseries for CMEMS is slow with dfm_tools, even though the actual download happens with a daily frequency. This is probably since per default the entire requested dataset is opened, from which then daily subsets are retrieved:
dfm_tools/dfm_tools/download.py
Lines 216 to 249 in f7e5234
This example shows that when cutting it up in monthly chunks, the download is way faster compared to retrieving at once:
Todo:
The text was updated successfully, but these errors were encountered: