-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update regridder.grid
property to ensure cf compliant coordinates
#736
base: main
Are you sure you want to change the base?
Conversation
- CF-compliance is required for xESMF to properly interpret coordinates using CF-xarray
regridder.grid
property to ensure cf compliant coordinates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #736 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 1621 1630 +9
=========================================
+ Hits 1621 1630 +9 ☔ View full report in Codecov by Sentry. |
Things are working now, but I think there is still an issue. Take a look at the map from xcdat (this PR): compared to calling xesmf directly: A vague idea/possibility: In curvilinear grids |
@pochedls Thanks Steve. It looks like we need more work on this. I'll push back the release of v0.8.0 depending on when the next E3SM Unified is released (which is probably being pushed back from 2/15)
Hmm this is a good question. I'll step through the code to see which values are being used for latitude. |
I explain the issue here. You're correct, This is mainly a metadata/coordinates issue rather than an issue in xCDAT's logic. We'll need to think more carefully about how we can retrieve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @tomvothecoder @pochedls
More work needs to be done based on @jasonb5's comment here: #718 (comment) |
Description
This pull request introduces a new feature to ensure CF-compliance of coordinate variables in the regridder module. xESMF requires coordinates to be CF-compliant in order to map to them using CF-xarray.
Key changes include:
New Feature Implementation:
xcdat/regridder/accessor.py
: Added the_ensure_cf_compliance
method to ensure coordinate variables have the "axis" and "standard_name" attributes required for CF-compliance. This method is now called within_get_axis_data
.Test Enhancements:
tests/test_regrid.py
: Added a new testtest_grid_adds_cf_attributes_to_non_cf_compliant_coords
to verify that the regridder correctly adds CF attributes to non-compliant coordinates.Import Adjustments:
xcdat/regridder/accessor.py
: Updated imports to includeCF_ATTR_MAP
for mapping CF attributes.Checklist
If applicable: