marEx.helper.fix_dask_tuple_array

marEx.helper.fix_dask_tuple_array(da)[source]

Fix a dask array that has tuple (i.e. task) references in its chunks. This addresses a longstanding issue/bug when dask arrays are saved to Zarr. Process chunk by chunk to maintain memory efficiency.

Parameters:

da (xarray.DataArray) – DataArray with Dask array backend that may have tuple chunk references

Returns:

DataArray with materialised chunks that can be safely saved to Zarr

Return type:

xarray.DataArray