-
Notifications
You must be signed in to change notification settings - Fork 29
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
get_grid returns a file that cannot be written to netCDF #45
Comments
netCDF's data model for attributes is fairly simple. It supports 0D and 1D (non-labeled) arrays of values. I don't see how a python dict, indexed by strings, could be mapped into that data model. So it seems that any solution to this involves either
Either changes the way users access the content of I think the narrow scope of data model of attributes in netCDF makes 2) preferable. That said, a candidate for 1) is make A candidate for 2) to introduce a
I use this approach when I store region names when I store regional timeseries (though I have no need to store the original region integer value). This candidate for 2) makes the mapping region_name -> region_val straightforward, using If you also sort the regions by absolute value of the region value, then I think you can use Question 2: How is Question 0: What is the use case for writing the Dataset returned by |
Thanks @klindsay28. Question 0: When generating scrip grid files for remapping using ESMF, for instance. In this case, the attribute probably shouldn't be there at all. Question 1: I am not aware of any code the explicitly uses the attributes of the returned grid-variable dataset. Question 2: I like your candidate solution (2) as it's most flexible and supports operations in the way you suggest. |
FYI, the pseudo-CDL that I wrote for 2) yields
See http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#_labels_and_alternative_coordinates for CF's approach to handling this. |
I've proposed a solution with PR #64. |
Does #64 provide a satisfactory solution to this issue? If so, I'll close this. |
Currently,
get_grid
returns a file that cannot be directly written to disk.For example
Return
Deleting the problematic attribute before writing fixes this
We should fix this!
The text was updated successfully, but these errors were encountered: