fix_xarray_dataset_index

HSTB.kluster.xarray_helpers.fix_xarray_dataset_index(xarr, index_dim='time')

Operations with xarray datasets require that the index is monotonic increasing and unique. This function will ensure this by dropping duplicate values found in the index, and then sorting to ensure that index is monotonic increasing.

Parameters

xarr (Dataset) – dataset that we want to fix the index of

Returns

dataset with fixed index

Return type

xr.Dataset