Hi,
Okay, so I'd like to start a discussion regarding
what Iris should do with respect to handling NetCDF global attributes; naturally, this conversation is all within the context of the CF Metadata Conventions, see
http://cf-pcmdi.llnl.gov/.
"Simple rule of engagement ..."I'm really keen
not to discuss implementation detail here. Let's try keeping it to
what not
how.
"Other than caffeine and cake, what do I want? ..."The goal (hopefully) is to reach a group consensus at the data model (hand-wavy-conceptual) level. This might involve some interaction with the CF community ... I don't know, let's just see how it unfolds ...
"So, what's my beef, dude? ..."The basic problem is that Iris doesn't do a very good job at dealing with NetCDF global attributes.
For example, at the moment when Iris creates a cube from NetCDF, the attributes from the NetCDF data variable associated with the cube
and the NetCDF global attributes of the file are all stored
together within the attribute dictionary of a cube. Due to this lack of separation, the notion of global and local (i.e. data variable) attribute identity is lost. In addition to this, global attribute metadata can be thrown away, as a local (i.e. data variable) attribute takes precedence over a similarly named global attribute.
As a result, when a cube loaded from NetCDF is saved back to NetCDF, all the original input NetCDF global attributes are now associated with the output NetCDF data variable (assuming that they've not already been clobbered by similarly named local attributes).
"In my opinion ..."Local and the global attributes require to persist within separate
name-spaces ... and I'll even go as far as saying that these name-spaces should both live within a cube.
"The question, dear Watson is ..."- Primarily, do you agree with this proposal?
- What should Iris do (or not) when saving two cubes to NetCDF with different and conflicting global attributes?
- Are the global attributes associated with a cube even valid outside the scope of the NetCDF file?
- Are the global attributes associated with a cube still valid when the contents of a cube changes from the result of applying an operation i.e. mean the data.
- Can two cubes with different global attributes merge? Can they concatenate?
"And discuss ..."Operating within the scope of the CF Conventions,
what is the best approach for Iris to adopt here?
All points of view, use case scenarios, and opinions welcomed!