hydromt.data_adapter.GeoDatasetAdapter.detect_time_range#
- GeoDatasetAdapter.detect_time_range(ds: Dataset | DataArray | None = None) Tuple[datetime, datetime] | None [source]#
Detect the temporal range of the dataset.
If no dataset is provided, it will be fetched according to the settings in the adapter. also see
hydromt.GeoDatasetAdapter.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.GeoDatasetAdapter.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]