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

Feature: rename observation coordinates for xarray datasets #330

Merged
merged 4 commits into from
Feb 25, 2025

Conversation

mbruckner-work
Copy link
Collaborator

While testing if the existing aircraft tools would work for IAGOS observations I discovered that the existing rename_vars function in the obs class does not allow renaming of xarray coordinate variables through the yaml variables option. The IAGOS files are netcdf. When these are opened with xr.open_dataset lat, lon, time, and an altitude variable are assigned as coordinates. The coordinate names aren't the monetio standard names.

I was able to determine that for xarray datasets the 'data_vars' attribute does not include the names variables labeled as coordinates. This pull request adds the coordinate variable names (eg. lat, lon, time) to the data variable name list when the obs dataset is an xarray.Dataset.

Copy link
Collaborator

@colin-harkins colin-harkins left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks for addressing this!

@rschwant rschwant merged commit 48bc609 into NOAA-CSL:develop Feb 25, 2025
5 checks passed
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.

3 participants