Skip to content

Conversation

@taranu
Copy link
Contributor

@taranu taranu commented Feb 5, 2026

In the existing implementation, ellipse integration stops entirely as soon as it steps out of the bounds of the image. Actually, it's slightly more premature than that, since the flux is split across four pixels. This fixed version instead checks each of those four pixels and only adds to their values if they're within bounds.

I added a unit test to check that the residual at the edge of the image is relatively small. For reference, on my install (Linux, py3.13) the mean value is about 0.69, so I set the threshold at 2. With the existing code, it's almost 20.

From the unit test, this what the old and new data - model residuals look like, with vmin, vmax = -5, 5.

Old, with integration stopping at the top edge near the top right corner:
test_old
New:
test_new

Copy link
Member

@larrybradley larrybradley left a comment

Choose a reason for hiding this comment

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

Thanks, @taranu!

@larrybradley larrybradley added this to the 3.0.0 milestone Feb 11, 2026
@larrybradley larrybradley merged commit f44ba6a into astropy:main Feb 11, 2026
24 checks passed
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.

2 participants