-
Notifications
You must be signed in to change notification settings - Fork 32
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
Unit conversion of attributes #630
Comments
global attributes are sometimes integers (e.g., realization_index) or floating point numbers (e.g., branch_time_in_child). I think if it is not too difficult, some users would like to be able to use CMOR to define additional integer or float global attributes. |
I am currently preparing satellite observations for obs4mips. As example you can use the HOAPS data, which contains the following floats as global attributes.
|
I am trying to recall whether netcdf 4.x global attributes can have types other than char arrays. Is there some documentation that someone is familiar with that defines exactly that? If type recasting is being done, then maybe for a CMOR4 we might want to reconsider this behaviour in light of the latest netcdf-c 4.9.x functionality? Note to self https://docs.unidata.ucar.edu/netcdf-c/current/group__attributes.html |
Yes, they can. The CF conventions (within the netcdf constraints) has both numeric and string attributes, and the numeric values can be integers, single precision float, double precision float, and probably other types too. For the list and type of CF attributes, see: I agree that we want CMOR to write attributes of the correct type. I think it worked o.k. at least in the past. For example, I think the missing_value was written as proper type. And the branch_times should have been written double precision. And things like "realization_index" should have been integers. |
By setting attributes with
cmor.set_cur_dataset_attribute
the passed argument is converted and written as a string. Is this an intended behavior and exists a possibility to keep the initial datatype?The text was updated successfully, but these errors were encountered: