Add remapping to rectilinear grids#1501
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Pull request overview
Adds a new remap.to_rectilinear(...) convenience API to remap UXarray data onto 1-D rectilinear lon/lat targets, returning standard xarray output on lat/lon dimensions, with support for both the native UXarray backend and YAC (including YAC rectilinear grid registration).
Changes:
- Added a rectilinear target normalization/reshape utility (
RectilinearGridSpec, edge inference, and lat/lon reshaping). - Implemented YAC rectilinear target registration and a dedicated YAC remap-to-rectilinear path.
- Exposed
to_rectilinear()on the remap accessor, added tests, and documented the new API in user guide + generated API docs.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| uxarray/remap/yac.py | Adds rectilinear-target detection/registration and _yac_remap_to_rectilinear() returning xarray output. |
| uxarray/remap/structured.py | Introduces rectilinear target spec normalization (centers→edges) and reshaping utilities + native backend helper. |
| uxarray/remap/accessor.py | Adds public to_rectilinear() method to the remap accessor (backend switch between yac and uxarray). |
| test/test_remap_yac.py | Adds YAC-backed to_rectilinear() tests for node data and extra dimensions. |
| test/test_remap.py | Adds native backend to_rectilinear() test and direct reshape utility coverage. |
| docs/user-guide/remapping.ipynb | Mentions the new .remap.to_rectilinear(...) workflow for YAC. |
| docs/generated/uxarray.UxDataset.remap.to_rectilinear.rst | Adds generated API stub for UxDataset.remap.to_rectilinear. |
| docs/generated/uxarray.UxDataArray.remap.to_rectilinear.rst | Adds generated API stub for UxDataArray.remap.to_rectilinear. |
| docs/api.rst | Adds to_rectilinear to the API reference listings for both UxDataArray and UxDataset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Great to see this happening, @rajeeja ! I'll review it ASAP |
erogluorhan
left a comment
There was a problem hiding this comment.
Great to see this; thanks very much! In addition to the inline comments below, I'd like to point out need for a well-written documentation about this function: I see that you already added some texts into the YAC part of the remapping guide, I think this function deserves a separate section of its own in the notebook, or maybe even a standalone guide of its own. Thoughts?
|
pre-commit.ci run |
|
Please see updated notebook. |
Closes #95.
Adds native UXarray support for remapping to rectilinear structured latitude-longitude grids through
remap.to_rectilinear(...), and adds YAC support for the same workflow using YAC rectilinear grid registration. The method returns regular xarray output onlat/londimensions, with tests and API docs for both backends. Also addresses the structured-grid YAC workflow discussed in #768 (comment).Native UXarray backend:
YAC backend: