Skip to content
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

Distinction between dataset variables and ancillary variables #104

Open
egouden opened this issue Apr 3, 2023 · 6 comments
Open

Distinction between dataset variables and ancillary variables #104

egouden opened this issue Apr 3, 2023 · 6 comments

Comments

@egouden
Copy link
Contributor

egouden commented Apr 3, 2023

I cannot find a way to distinguish between the dataset variables and ancillary variables.

@kmuehlbauer
Copy link
Collaborator

@egouden Could you please elaborate along an example? It's hard to guess what you are referring to.

@egouden
Copy link
Contributor Author

egouden commented Apr 3, 2023

For example, viewing all dataset variables. If one loops over data_vars, one also gets ancillary variables.

@kmuehlbauer
Copy link
Collaborator

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.

@egouden
Copy link
Contributor Author

egouden commented Apr 4, 2023

What about using attributes to store these ancillary variables?

@kmuehlbauer
Copy link
Collaborator

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?

@egouden
Copy link
Contributor Author

egouden commented Apr 18, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants