Skip to content

Add as_ellipse keyword to circle to_sky and to_pixel methods - #652

Merged
larrybradley merged 6 commits into
astropy:mainfrom
larrybradley:circle-to_ellipse
Jun 5, 2026
Merged

Add as_ellipse keyword to circle to_sky and to_pixel methods#652
larrybradley merged 6 commits into
astropy:mainfrom
larrybradley:circle-to_ellipse

Conversation

@larrybradley

Copy link
Copy Markdown
Member

While I'm currently immersed in WCS transformations, here's one final (optional) improvement for circular region sky/pixel conversions. This PR adds a use_ellipse keyword to the to_pixel and to_sky methods of circular and circular annulus region classes that allows the user to specify whether to return an elliptical region instead of a circular region when converting between pixel and sky coordinates. This is useful for cases where the WCS is distorted or has different pixel scales along different axes and the circular region would be significantly distorted in pixel or sky coordinates.

Example:
The polygon -> polygon conversion represents "truth", which matches the new optional circle -> ellipse conversion.

circle

@larrybradley larrybradley added this to the 0.12 milestone Mar 17, 2026
@larrybradley
larrybradley requested a review from astrofrog March 17, 2026 17:33
@larrybradley
larrybradley force-pushed the circle-to_ellipse branch 2 times, most recently from b075878 to 60bebd0 Compare March 18, 2026 02:42
@larrybradley larrybradley changed the title Add use_ellipse keyword to circle to_sky and to_pixel methods Add as_ellipse keyword to circle to_sky and to_pixel methods Jun 5, 2026
@larrybradley
larrybradley merged commit a428e93 into astropy:main Jun 5, 2026
24 checks passed
@larrybradley
larrybradley deleted the circle-to_ellipse branch June 5, 2026 22:34
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.

1 participant