xarray icon indicating copy to clipboard operation
xarray copied to clipboard

```_FillValue``` and ```missing_value``` attributes get removed when using ```open_dataset```

Open Whyborn opened this issue 1 year ago • 3 comments

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 avatar May 13 '24 05:05 Whyborn

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!

welcome[bot] avatar May 13 '24 05:05 welcome[bot]

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

kmuehlbauer avatar May 13 '24 05:05 kmuehlbauer

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

kmuehlbauer avatar May 21 '24 13:05 kmuehlbauer

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

kmuehlbauer avatar May 28 '24 07:05 kmuehlbauer