-
Notifications
You must be signed in to change notification settings - Fork 263
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
Unsigned byte according to CF conventions #493
Comments
You can use unsigned data types when the file is created with the NETCDF4 flag, or even in the old format if the file is created using the new NETCDF3_64BIT_DATA flag available in version 1.2.2 (4.4.0 of the C lib). So, unless I'm missing something, it seems the CF section you refer to is out of date, and is trying to work around a problem that no longer exists. |
I guess I see your point though - there are probably a lot of files out there with Not sure where |
Writing Long story short: Yes I do propose that we check I guess the decision would be: On second thought |
Do you want |
I am 👎 on returning data with a different data type to follow CF conventions, unless the option can be toggled on/off. For tools like xray, we definitely don't want to be using this behavior in netCDF4. My preference would be for such new behavior to be opt in, because it would be slightly trickier to disable it otherwise in a cross-version compatible manner.
This is exactly my perspective 👍. |
I am also a 👍 to leave any convention, beyond those that define what a netCDF file is, to the downstream applications. |
That is fine with me. But the question is then what of the netCDF Attribute conventions should be implemented? Should we follow http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html ? If so then the section about Attribute Conventions specifies the same implicit conversion in the section about
|
Anyway. If we want this then it should definitely be opt-in. |
Generally the netcdf libraries dont use the attribute conventions (except for the reserved _ (underscore) attributes). its up to the "user" to handle that. in java we have a wrapper class that will take into account attribute conventions, so the user can get it with or without. |
Reading Section 2.2 of the CF conventions I gather that I can only use
np.byte
datatypes but ifvalid_range
is usingnp.ubyte
values then the byte data should be interpreted as unsigned.This is currently not the case in this library. If we want to support this during
auto_mask_and_scale
then I'm happy to look into it.The text was updated successfully, but these errors were encountered: