Skip to content
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

Ensure no missing values in coordinates #190

Open
rsignell-usgs opened this issue Apr 7, 2023 · 1 comment
Open

Ensure no missing values in coordinates #190

rsignell-usgs opened this issue Apr 7, 2023 · 1 comment

Comments

@rsignell-usgs
Copy link
Contributor

rsignell-usgs commented Apr 7, 2023

I know this should really be done in xarray, but I've been using the xbitinfo .to_compressed_netcdf() and .to_compressed_zarr() convenience functions even when I'm not using bitrounding because... they are convenient! :)

CF conventions don't allow missing values in coordinates but xarray produces them nonetheless. I usually remove them via this little code snippet:

for index in ds.indexes:
    ds[index].encoding['_FillValue'= None

Would there be any downside to adding this to to_compressed_netcdf so users don't have to?

@observingClouds
Copy link
Owner

Hi @rsignell-usgs,
Sorry for the slow response! Glad you like the convenience functions. Part of why I haven't responded yet, is that I'm not a big fan in implementing functions that should be done at a different place. However, the convenience functions could be an exception as they wrap stuff anyway. Just to be clear here, your suggestion does not get rid of missing coordinates, but rather gets rid of the _FillValue attribute so it looks like no coordinate is missing, am I right?

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

No branches or pull requests

2 participants