Open asinghvi17 opened 1 month ago
Here is some previous discussion:
https://github.com/Alexander-Barth/NCDatasets.jl/issues/133
In short, this is a lot of work for some feature that never made it to the CF conventions and has been long been superseded by native unsigned types in NetCDF4.
But if somebody would like to make a PR, I am happy to review it.
I guess that this can be used similar to other special attributes like scale_factor
, units
which affect also the element type of an array:
https://github.com/JuliaGeo/CommonDataModel.jl/blob/main/src/cfvariable.jl#L167
And add another function in the "transformation pipeline":
https://github.com/JuliaGeo/CommonDataModel.jl/blob/main/src/cfvariable.jl#L328
(but maybe I will find to do it myself should there be a shortage of volunteers... :-) )
Describe the bug
Values read by NCDatasets and ZarrDatasets were inconsistent with xarray for this file, because it was interpreted as
Int16
data but the attributes had an_Unsigned = true
key, so the element type should have beenUInt16
instead.You can see the debugging history in https://github.com/rafaqz/Rasters.jl/issues/735
To Reproduce
Please provide a minimal julia code example which reproduces the behavior (bug, performance regression, ...).
Expected behavior
I would expect that the array is somehow reinterpreted to the appropriate unsigned type.
Environment