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

Respect the bounding_box in inverse transforms #498

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

nden
Copy link
Collaborator

@nden nden commented May 14, 2024

Fixes #496

This fixes a bug in filtering out coordinates that are outside the footprint when evaluating the inverse transform. This affects also the in_image function. Previously the output of the backward transform was compared to the bounding_box and values outside it were replaced by NaNs. This PR adds an second step which is run before evaluating the backward transform and assigns output of NaN to inputs outside the footprint.

@nden nden requested a review from a team as a code owner May 14, 2024 16:33
Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 76.84211% with 22 lines in your changes missing coverage. Please review.

Project coverage is 87.16%. Comparing base (9cd8552) to head (404d692).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
gwcs/examples.py 6.66% 14 Missing ⚠️
gwcs/wcs.py 92.53% 5 Missing ⚠️
gwcs/api.py 60.00% 2 Missing ⚠️
gwcs/tests/conftest.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #498      +/-   ##
==========================================
- Coverage   87.42%   87.16%   -0.27%     
==========================================
  Files          22       22              
  Lines        3874     3941      +67     
==========================================
+ Hits         3387     3435      +48     
- Misses        487      506      +19     

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

@nden
Copy link
Collaborator Author

nden commented May 14, 2024

@bmorris3 Do you mind testing this PR with your code?
Since this changes the functionality, there are a number of failures in the jwst pipeline. I'll need to address them before this is merged or make this the non-default behavior.

@nden nden added this to the 0.22 milestone May 14, 2024
@nden nden requested a review from Cadair May 17, 2024 15:52
@nden
Copy link
Collaborator Author

nden commented May 17, 2024

@Cadair Can you take a look at this PR and see if it's OK for sun related code?
Note that enforcing the bounding_box on the inverse transform now works and this can change results. If reproducing the bug is necessary, a parameter should be passed with_bounding_box=False.

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.

Bug in treatment of pixel_bounds
2 participants