Skip to content

expose CFMaskCoder #10168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dcherian opened this issue Mar 24, 2025 · 0 comments
Open

expose CFMaskCoder #10168

dcherian opened this issue Mar 24, 2025 · 0 comments

Comments

@dcherian
Copy link
Contributor

dcherian commented Mar 24, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants