Skip to content

_FillValue and missing_value attributes get removed when using open_dataset #9024

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

Closed
Whyborn opened this issue May 13, 2024 · 4 comments
Closed
Labels
topic-metadata Relating to the handling of metadata (i.e. attrs and encoding)

Comments

@Whyborn
Copy link

Whyborn commented May 13, 2024

What is your issue?

When opening an NetCDF dataset using open_dataset, the attributes _FillValue and missing_value of the underlying Datasets are removed (unless mask_and_scale = false). It seems counterintuitive to lose information by default, especially information which is necessary to determine what exactly the input data looked like.

@Whyborn Whyborn added the needs triage Issue that has not been reviewed by xarray team member label May 13, 2024
Copy link

welcome bot commented May 13, 2024

Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!

@kmuehlbauer
Copy link
Contributor

@Whyborn The attributes are moved to .encoding attribute of the respective DataArray in case of decoding. Please also follow-up with #6323.

@kmuehlbauer kmuehlbauer added topic-metadata Relating to the handling of metadata (i.e. attrs and encoding) and removed needs triage Issue that has not been reviewed by xarray team member labels May 13, 2024
@kmuehlbauer
Copy link
Contributor

@Whyborn Did my above comment shed some light? Please let us know if you need further information.

@kmuehlbauer
Copy link
Contributor

I'll close this for now, please let us know, if you need more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-metadata Relating to the handling of metadata (i.e. attrs and encoding)
Projects
None yet
Development

No branches or pull requests

2 participants