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

Fix bug when setting meta.background in SkyMatchStep. #1233

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

mairanteodoro
Copy link
Collaborator

@mairanteodoro mairanteodoro commented May 10, 2024

Resolves RCAL-837

This PR addresses a bug in SkyMatchStep that was causing meta.background.subtracted to always be set to None instead of True/False, which was preventing ResampleStep from properly using the sky level as determined by SkyMatchStep and set in meta.background.level.

The changes to the code also required some refactoring to the unit tests.

The code changes in this PR are also related to this old issue: spacetelescope/rad#247

Regression tests
The only failed test has nothing to do with the changes in this PR.
https://plwishmaster.stsci.edu:8081/job/RT/job/Roman-Developers-Pull-Requests/764/
https://plwishmaster.stsci.edu:8081/job/RT/job/Roman-Developers-Pull-Requests/770/
https://plwishmaster.stsci.edu:8081/job/RT/job/Roman-Developers-Pull-Requests/810/

Checklist

  • added entry in CHANGES.rst under the corresponding subsection
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)
  • ran regression tests, post a link to the Jenkins job below. How to run regression tests on a PR

@mairanteodoro mairanteodoro added bug Something isn't working and removed testing no-changelog-entry-needed labels May 10, 2024
@mairanteodoro mairanteodoro marked this pull request as ready for review May 10, 2024 14:14
@mairanteodoro mairanteodoro requested a review from a team as a code owner May 10, 2024 14:14
@mairanteodoro mairanteodoro requested review from bmorris3 and schlafly and removed request for a team May 10, 2024 14:15
@mairanteodoro mairanteodoro self-assigned this May 10, 2024
Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.87%. Comparing base (d10f06b) to head (a8015c0).
Report is 195 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1233   +/-   ##
=======================================
  Coverage   78.87%   78.87%           
=======================================
  Files         117      117           
  Lines        8071     8071           
=======================================
  Hits         6366     6366           
  Misses       1705     1705           
Flag Coverage Δ *Carryforward flag
nightly 62.79% <ø> (ø) Carriedforward from d10f06b

*This pull request uses carry forward flags. Click here to find out more.

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

Copy link
Collaborator

@bmorris3 bmorris3 left a comment

Choose a reason for hiding this comment

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

Looks good, it was time for this update. Thanks @mairanteodoro!

@mairanteodoro mairanteodoro force-pushed the skymatch_bugfix branch 2 times, most recently from c51a07f to ebc5596 Compare May 20, 2024 20:09
@mairanteodoro mairanteodoro force-pushed the skymatch_bugfix branch 2 times, most recently from d01bf65 to 1dfd8bb Compare June 5, 2024 19:51
@mairanteodoro
Copy link
Collaborator Author

mairanteodoro commented Jun 6, 2024

Attaching comparison of the relevant arrays between the output from the regression test against the truth file from Artifactory. Black and white circles indicate the position of the worst absolute and the worst fractional differences, respectively, as reported by the regtest (ran locally, which, by the way, differs from the coordinates reported when ran on Jenkins).

  • data array:
    output_truth_comparison

  • err array:
    output_truth_err_comparison

  • var_flat array:
    output_truth_var_flat_comparison

  • var_poisson array:
    output_truth_var_poisson_comparison

  • var_rnoise array:

    • worst absolute and fractional differences occurs at the same coordinates
      output_truth_var_rnoise_comparison
  • weight array:
    output_truth_weight_comparison

Copy link
Collaborator

@schlafly schlafly left a comment

Choose a reason for hiding this comment

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

Looks good. My rule is that I use "is" when I am comparing objects that may be the same object, and == when I am comparing values. In this context I was surprised by using is to compare bools on 336 but otherwise looks good.

@mairanteodoro
Copy link
Collaborator Author

mairanteodoro commented Jun 6, 2024

Looks good. My rule is that I use "is" when I am comparing objects that may be the same object, and == when I am comparing values. In this context I was surprised by using is to compare bools on 336 but otherwise looks good.

Fixed it.
Thanks for catching that overlook of mine. ;)

@mairanteodoro mairanteodoro merged commit 9662356 into spacetelescope:main Jun 6, 2024
30 checks passed
@nden
Copy link
Collaborator

nden commented Jul 3, 2024

@mairanteodoro This is not attached to a milestone. Was this work included in the last release?

@mairanteodoro
Copy link
Collaborator Author

mairanteodoro commented Jul 3, 2024

@mairanteodoro This is not attached to a milestone. Was this work included in the last release?

@nden Not yet. We can see it in this comparison between the main branch and the 0.15.1 release branch (commit 4db6c23): 0.15.1...main

@nden nden added this to the 24Q4_B15 milestone Jul 3, 2024
@nden
Copy link
Collaborator

nden commented Jul 3, 2024

@mairanteodoro OK, I added a milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants