return_chunk_slices¶
- HSTB.kluster.xarray_helpers.return_chunk_slices(xarr)¶
Xarray objects are chunked for easy parallelism. When we write to zarr stores, chunks become segregated, so when operating on xarray objects, it makes sense to do it one chunk at a time sometimes. Here we return slices so that we can only pull one chunk into memory at a time.
- Parameters
xarr (
Dataset) – Dataset object, must be only one dimension currently- Returns
list of slices for the indices of each chunk
- Return type
list