PlasmaCalcs.tools.xarray_tools.xarray_masks

File Purpose: tools related to masking xarray objects
for simply filling masked regions with nan, can use xarray_obj.where(…).
But, that can cause a lot of memory full of nan which is not desireable.
Methods in here help with stacking/unstacking mask dimensions,
so it can be possible to keep only the non-nan points.
Datasets are able to store the full mask info as a data_var,
so it is possible to ds.pc.mask() or ds.pc.unmask() if ‘_mask’ already in ds.
DataArrays can’t store extra dimensions,
so mask needs to be passed, e.g. arr.pc.mask(mask), arr.pc.unmask(mask)

Functions

xarray_demask_from_ds(ds, array[, stackdim, ...])

xarray_demask_from_mask(mask, array[, ...])

xarray_has_mask(array)

xarray_mask(array[, mask, stackdim, stack, ...])

xarray_popped_mask(ds)

xarray_store_mask(array, mask)

xarray_stored_mask(ds)

xarray_unmask(array[, mask, stackdim, ...])

xarray_unmask_var(ds, var[, mask, stackdim, ...])

xarray_unmask_vars(ds, vars[, mask, ...])