Open garciampred opened 3 months ago
not sure you should expect the quantization to leave nans alone, unless the _FillValue or missing_value is set to nan
it turns out that even if the _FillValue is set to nan, the same problem occurs.
however, you can use
data = np.ma.masked_invalid(np.array([5.3, 6.2, 7.3, np.nan]))
and you end up with
netcdf test {
dimensions:
x = 4 ;
variables:
float tas(x) ;
tas:_QuantizeGranularBitRoundNumberOfSignificantDigits = 4 ;
data:
tas = 5.299805, 6.200195, 7.299805, _ ;
}
This is likely an upstream bug, but I don't know how to reproduce it with netcdf-c. BitRound and BitGroom are not affected.
Then ncdump returns
hdf5 1.14.3 nompi_h4f84152_100 conda-forge libnetcdf 4.9.2 nompi_h9612171_113 conda-forge netcdf4 1.6.5 nompi_py312h26027e0_100 conda-forge