-
Couldn't load subscription status.
- Fork 142
Fix longitude coord in cmorizers utilities.py #3911
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
Draft
flicj191
wants to merge
2
commits into
main
Choose a base branch
from
cmor_util_fix_coords
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
thanks for tackling this @flicj191 - we have to be careful here what of the two conditionals is stopping the call to fix_bounds: either
overwrite_lat_boundsis False orcube.coord('latitude').has_bounds()is True - in which case no fixing is needed, thoughoverwrite_lat_boundsis a bit of a loose constraint, maybe they do need fixing, and that was set to False by mistake?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.
Thanks V!
hmm, no,
overwrite_lat_boundswould be True, I was callingfix_coords()with the defaults. the output didn't have longitude bounds and the initial cube didn't have bounds either. Thefix_coords()call when I used it to help CMORize fixed the depth, time and latitude coordinates but not the longitude.I'll do a few more checks but I think it just got lost when getting parsed through
fix_bounds()ie. latitude is done like line 229:
whereas longitude here :
I'll have another look and see
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.
just be sure that
cube_coordis indeed the "longitude" one - you never know with those raw datasets, maybe it's called "ducks" π¦ (am not even joking, the amount of weird stuff I've seen in raw outputs, ducks may be even CMOR-like π )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.
yep so i'm proposing to replace
cube_coordwithcube.coord('longitude')I haven't had a chance to test it all, will soon