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

Load as dataset and use name in data_vars #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ValentinaHutter
Copy link

We are saving our netcdf results as xr.DataSets with the variables being either the "bands" or if no "bands" dimension is found, with the single variable "name".

data = xarray.open_dataset(path, decode_coords="all")
# VITO/CDSE write a Dataset even if there are no bands, with a default name 'var'
if len(data.data_vars) == 1 and [v for v in data.data_vars] == ["var"]:
data = data["var"]
elif len(data.data_vars) == 1 and [v for v in data.data_vars] == ["name"]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused here: is "name" the actual name of the variable here?
if so can you reference which backend does this, or what convention is followed here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"name" is the variable, that is used at EODC (only if there are no bands available)

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

Successfully merging this pull request may close these issues.

2 participants