Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be a little more accurate/safe with bounding boxes #327

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Conversation

svank
Copy link
Contributor

@svank svank commented Nov 26, 2024

PR summary

I remembered last night that Astropy has pixel centers at integer coordinates, so the image actually starts at -0.5, not 0, and so when we find a bounding box for mosaic reprojection (and also in the celestial intermediary code), the points we position along the edges of the input image should be along (x,y) = -0.5.

This PR puts them at -1, just for good measure. (The other side was already at shape[0] or shape[1], so it was already just a smidge past the actual edge which is at shape[0] - 0.5.)

I don't know why I'd originally set the points at (x,y) = 1 instead of (x,y) = 0. I'd count that as a bug, though it apparently wasn't affecting the test case I did yesterday.

Test plan

This just makes the bounding box bigger, so it shouldn't affect anything.

@svank svank self-assigned this Nov 26, 2024
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.03%. Comparing base (872f76b) to head (1d7b735).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #327   +/-   ##
=======================================
  Coverage   87.03%   87.03%           
=======================================
  Files          56       56           
  Lines        3734     3734           
=======================================
  Hits         3250     3250           
  Misses        484      484           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmbhughes jmbhughes merged commit 7818d2b into main Nov 26, 2024
7 of 8 checks passed
@jmbhughes jmbhughes deleted the better-mosaics branch November 26, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants