Open FObersteiner opened 2 years ago
@FObersteiner, just checking that I understand what is happening in your example.
Is the main requirement to collect the metadata associated with the xr.DataArrays
and assign them to the xr.Dataset
?
@agstephens honestly, I haven't had the time to work on this further ;-)
My question was if it would be good to have the export from na to xarray exposed more directly on the API, to avoid having to go through nc_interface.na_to_xarray
. But if that point never came up in the past, I guess it's not that important and we might as well leave it as it is, I can live with that.
Regarding metadata, my guess would be that the handling of those is pretty user-specific (see var_and_units_pattern
...), so I wouldn't touch that.
@FObersteiner, I agree that it would be useful to bring this up to the API level. It's a sensible proposal.
This is more of a suggestion for a new feature than an "issue".
Background: we still have a lot of data in NASA Ames format. Currently, there's an initiative at our institute to develop a collection of tools that are basically method extensions for
xarray.Dataarray
andxarray.Dataset
. github: imktk. So I was looking for convenient ways to load the na data to xarray. And since I noted thatnappy
uses xarray internally for the conversion to netCDF, I thought that could be a possibility.A way to do this with the existing version of nappy could be e.g.
While that works for me, it's not explicitly part of the nappy API - would it be a useful extension?