Skip to content

Conversation

@philipc2
Copy link
Member

@philipc2 philipc2 commented Jul 20, 2025

Closes #1318 #1319 #1320 #1296

Overview

  • Adds a UxDataArray.cross_section() method, which can be used to sample along lines of constant lat/lon or arbitrary GCAs
  • Moves existing cross_section methods under the subset namespace and begins deprecation
  • Adds support for restricting the latitude or longitude range when doing a constant lat/lon subset
  • Safeguards cases where no faces are found when conducting a subset
  • Updates the Cross Section user guide notebook to use to showcase the new functionality, with vertical cross section examples.

@philipc2 philipc2 changed the title DRAFT: Support interpolation for cross-section outputs DRAFT: Support interpolating cross-section results Jul 20, 2025
@philipc2
Copy link
Member Author

@rajeeja

I'm opening up this PR to isolate our interpolation/sampling from the vertical cross sections examples in #1317

I've also put together a more general approach and cleaned up the implementation in #1317

@philipc2 philipc2 self-assigned this Jul 21, 2025
@philipc2
Copy link
Member Author

Sampling along a transect is very similar in concept to the work I put together in #1271, however instead of sampling onto pixels in an Image, we sample points along the transect.

@rajeeja
Copy link
Contributor

rajeeja commented Jul 21, 2025

Oh, if possible can you create a PR or changes directly to my PR. Are we planning to close it in favor of this?

@philipc2
Copy link
Member Author

Oh, if possible can you create a PR or changes directly to my PR. Are we planning to close it in favor of this?

Let's keep the API changes in this PR and use #1317 for applications to vertical cross sections (i.e. the updates to the notebooks, etc.)

Does that work? I'm happy to hop on sometime this week to pair program too.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@philipc2 philipc2 changed the title DRAFT: Support interpolating cross-section results DRAFT: Sampled cross-sections along GCAs, and lines of constant latitude/longitude Jul 23, 2025
@philipc2 philipc2 changed the title DRAFT: Sampled cross-sections along GCAs, and lines of constant latitude/longitude DRAFT: Add cross-sections Jul 23, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@philipc2 philipc2 requested a review from Copilot August 8, 2025 19:33

This comment was marked as outdated.

Copy link
Contributor

@rajeeja rajeeja left a comment

Choose a reason for hiding this comment

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

looks good to go, minor fixes. in comments.

@philipc2 philipc2 requested a review from rajeeja August 18, 2025 17:23
Copy link
Member

@erogluorhan erogluorhan 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 great to me except a small comment I've put into the cross-sections notebook (can you see it?)

Copy link
Contributor

@rajeeja rajeeja left a comment

Choose a reason for hiding this comment

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

call still assumes 'n_face' exists, raise error here itself if not face-centered. Test for great clrcle case..

@rajeeja rajeeja force-pushed the interpolate-cross-section branch from 95e4532 to 4d90463 Compare August 18, 2025 22:01
@erogluorhan erogluorhan self-requested a review August 20, 2025 18:22
Copy link
Member

@erogluorhan erogluorhan 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 great to me, and once @rajeeja 's points are addressed, this should be good to go. Thanks a lot for this contribution!

@philipc2 philipc2 requested a review from Copilot August 20, 2025 19:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a UxDataArray.cross_section() method for sampling data along great-circle arcs (GCAs) and constant latitude/longitude lines, while moving existing cross-section methods to the subset namespace with deprecation warnings.

  • Implements cross-section sampling along arbitrary GCAs, constant latitude, and constant longitude
  • Moves existing cross-section methods to the subset accessor and introduces deprecation warnings
  • Updates documentation and user guide to showcase the new cross-section functionality

Reviewed Changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
uxarray/subset/grid_accessor.py Adds new constant latitude/longitude subset methods with documentation
uxarray/subset/dataarray_accessor.py Adds subset methods for data arrays with range constraints
uxarray/cross_sections/sample.py New sampling utilities for geodesic and constant lat/lon cross-sections
uxarray/cross_sections/grid_accessor.py Deprecates existing methods, delegates to subset accessor
uxarray/cross_sections/dataarray_accessor.py Replaces old methods with new cross-section sampling functionality
test/test_cross_sections.py Updates tests to use subset accessor and adds new cross-section tests
pyproject.toml Adds pyproj dependency for geodesic calculations
docs/user-guide/cross-sections.ipynb Complete rewrite of user guide with new cross-section examples
docs/api.rst Updates API documentation structure for cross-sections

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@philipc2 philipc2 merged commit 9d99f6e into main Aug 21, 2025
20 checks passed
@erogluorhan erogluorhan linked an issue Sep 9, 2025 that may be closed by this pull request
@erogluorhan erogluorhan deleted the interpolate-cross-section branch September 26, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants