Description
Is your feature request related to a problem?
We have CFMaskCoder
that lazily masks out the values of the _FillValue
and missing_value
attributes (if present).
For the Zarr backend, we have use_zarr_fill_value_as_mask
which controls whether the fill_value
attribute is masked: https://docs.xarray.dev/en/stable/generated/xarray.open_zarr.html
If True, use the zarr Array fill_value to mask the data, the same as done for NetCDF data with _FillValue or missing_value attributes. If False, the fill_value is ignored and the data are not masked. If None, this defaults to True for zarr_version=2 and False for zarr_version=3.
We have requests for masking data outside the [valid_min
,valid_max
] or the valid_range
range: #8359.
Describe the solution you'd like
I propose we expose
coders.MaskCoder(attributes:Iterable[str], valid_range:bool)
(no CF) to allow configurable masking.
It may take some work to figure out how to set a per-backend encode/decode pipeline.