Distinction between dataset variables and ancillary variables
I cannot find a way to distinguish between the dataset variables and ancillary variables.
@egouden Could you please elaborate along an example? It's hard to guess what you are referring to.
For example, viewing all dataset variables. If one loops over data_vars, one also gets the metadata variables.
xr.Dataset can only differentiate between coordinates (.coords ) and data variables (.data_vars). We can't do much about this on the xr.Dataset itself. What we might think about is an accessor which separates the data_vars and ancillary_vars.
print(ds.var.data_vars) # only data variables
print(ds.var.ancillary_vars) # only ancillary variables
But not sure, if this is worth the action.
What about using attributes to store these ancillary variables?
Are you referring to those ancillary variables https://docs.openradarscience.org/projects/xradar/en/stable/datamodel.html#ancillary-variables?
It might not be possible as those variables are data variables in the underlying netcdf file.
Maybe can describe the use case you have in mind and why you need this separated?
There are actually 3 types of sweep variables:
- observed variables
- ancillary variables related to one or more observed variables
- metadata variables related to the sweep itself
Accessing only the observed variables should be a basic feature indeed. Is it not already needed in our code?