Skip to content

ENH: Add separation_projected method for projected separation #19739

Open
saanikakulkarni07 wants to merge 4 commits into
astropy:mainfrom
saanikakulkarni07:add-separation-projected
Open

ENH: Add separation_projected method for projected separation #19739
saanikakulkarni07 wants to merge 4 commits into
astropy:mainfrom
saanikakulkarni07:add-separation-projected

Conversation

@saanikakulkarni07
Copy link
Copy Markdown

Adds separation_projected() to BaseCoordinateFrame for computing on-sky
separation projected along a position angle axis, with optional elliptical
distance weighting. Closes #1012.

Description

This pull request adds a separation_projected() method to BaseCoordinateFrame (automatically available on SkyCoord) that decomposes the angular separation between two coordinates into components parallel and perpendicular to a reference
position angle.

This is a common operation in galaxy and jet studies — measuring the distance to an object projected along a specific axis (e.g., a galaxy's major axis). Currently separation() only gives the total angular distance.

API:

  • pa — reference position angle (East from North)
  • return_components=True — return signed (d_parallel, d_perpendicular) tuple
  • b_over_a — elliptical distance with minor/major axis ratio
  • origin_mismatch — consistent with separation()

Includes:

  • Implementation in astropy/coordinates/baseframe.py
  • 18 new tests in test_separation.py (all pass, no regressions in existing 140 tests)
  • Changelog entry in docs/changes/coordinates/1012.feature.rst

Fixes #1012

…tions

  Adds separation_projected() to BaseCoordinateFrame for computing on-sky
  separation projected along a position angle axis, with optional elliptical
  distance weighting. Closes astropy#1012.
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@pllim pllim added this to the v8.1.0 milestone May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to project separation onto an ellipse

2 participants