Skip to content

Rotate vectors - get crs#635

Merged
aulemahal merged 6 commits intomainfrom
rotate-vectors
Sep 2, 2025
Merged

Rotate vectors - get crs#635
aulemahal merged 6 commits intomainfrom
rotate-vectors

Conversation

@aulemahal
Copy link
Copy Markdown
Collaborator

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • (If applicable) Documentation has been added / updated (for bug fixes / features).
  • (If applicable) Tests have been added.
  • This PR does not seem to break the templates.
  • CHANGELOG.rst has been updated (with summary of main changes).
    • Link to issue (:issue:number) and pull request (:pull:number) has been added.

What kind of change does this PR introduce?

Two new functions in xs.spatial

  • rotate_vectors to rotate vectors from their native grid axes to actual S-N W-E axes. Mostly useful for wind that comes out of some models. Can also do the opposite rotation.
  • get_crs to get a cartopy crs from a grid mapping variable. This is only temporary, waiting for my PR in cartopy: Create projections from CF attributes SciTools/cartopy#2548.

Does this PR introduce a breaking change?

No.

Other information:

@aslibese fyi

@aulemahal aulemahal requested a review from tlogan2000 August 28, 2025 22:32
Copy link
Copy Markdown
Collaborator

@RondeauG RondeauG left a comment

Choose a reason for hiding this comment

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

LGTM! Just a few small comments.

Comment thread src/xscen/spatial.py Outdated
Comment thread src/xscen/spatial.py Outdated
Comment thread src/xscen/spatial.py Outdated
@aulemahal aulemahal merged commit 94fdefa into main Sep 2, 2025
18 checks passed
@aulemahal aulemahal deleted the rotate-vectors branch September 2, 2025 18:04
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