cedadev / nappy

NASA Ames Processing in PYthon (NAPPy) - a Python library for reading, writing and converting NASA Ames files.
BSD 3-Clause "New" or "Revised" License
9 stars 13 forks source link

Capture VNAMEs when converting NA to NC #61

Open agstephens opened 2 years ago

agstephens commented 2 years ago

@FObersteiner said:

One thing that came up for me was that it might be useful (for me at least ^^) to dump VNAMEs when converting na to nc (i.e. to a global attribute maybe). The VNAMEs I have to deal with are not exactly standard and I want to provide sufficient info on those variables in the netCDF file as well (so the user doesn't have to open the na file additionally).

@agstephens said:

Do you want to propose a global attribute such as vnames_from_source_data ?

@FObersteiner said:

yes, that sounds reasonable. Another option might be to set the original VNAME from the na file as an attribute of the xr.DataArray (make a "vname_from_source_data" tag).

agstephens commented 2 years ago

@FObersteiner: I like your idea that the xr.DataArray (i.e. the NetCDF variable) would hold the original VNAME from the NA file.

vname_from_source_data sounds good to me.

Please confirm this is still your preferred option.

FObersteiner commented 2 years ago

Hi Ag, I've been busy with (mostly not data related) other stuff in the last few weeks, so I totally missed your question - sorry.

Yes, the above would still be me. Having a global attr would also be fine I guess if you see an advantage - I'll leave that to you ;-)