hydromt.data_adapter.RasterDatasetAdapter.detect_time_range#

RasterDatasetAdapter.detect_time_range(ds=None) Tuple[datetime, datetime][source]#

Detect the temporal range of the dataset.

If no dataset is provided, it will be fetched accodring to the settings in the addapter. also see hydromt.RasterdatasetAdapter.get_data().

Parameters:

ds (xr.Dataset, xr.DataArray, Optional) – the dataset to detect the time range of. It must have a time dimentsion set. If none is provided, hydromt.RasterdatasetAdapter.get_data() will be used to fetch the it before detecting.

Returns:

range – A tuple containing the start and end of the time dimension. Range is inclusive on both sides.

Return type:

Tuple[np.datetime64, np.datetime64]