-
Notifications
You must be signed in to change notification settings - Fork 30
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
use _Unsigned attribute #133
Comments
Thanks @visr , for helping the user on SO! Many links to the NetCDF best practise are broken, but I found it here:
I think that point 2 is also interesting. It could be read as that such files (using the corresponding signed types to store unsigned data) should not be used for public distribution were you do not control the client program. Does somebody know if the work on the "new proposed convention" is still on-going? It also seems that this is specific to files written by old version of NetCDF-Java. Does somebody know since which version of NetCDF-Java use native unsigned types? |
Indeed this is not a CF convention, only an old "proposed convention", which in practise still seems to be used (the example is new data), even though it shouldn't be. It seems like NetCDF-Java has had unsigned capabilities for a while, it's just users not taking advantage of this when updating their old data model. The most commonly used clients seem to have implemented support for this. In a way it's quite unfortunate, since it leads to potentially misinterpreted data like in the SO post. I'm not sure how difficult it would be to add support for |
I read this StackOverflow question: https://stackoverflow.com/q/68135528, and through it I found out that there are apparently netCDFs out there with variables of type
short
, but if they have an attribute_Unsigned
with value"true"
, then this data is supposed to be interpreted asunsigned short
(which netCDF-4 also supports). I read some background in Unidata/netcdf4-python#656 and it seems this is a bit of a heritage from netCDF-3.Since readers in other languages seem to support this, I guess perhaps we should too?
EDIT: see also my SO answer for an example file with some code.
The text was updated successfully, but these errors were encountered: