Skip to content

Update resampled output image's background level and status#10525

Open
mcara wants to merge 1 commit into
spacetelescope:mainfrom
mcara:update-bglevel-status
Open

Update resampled output image's background level and status#10525
mcara wants to merge 1 commit into
spacetelescope:mainfrom
mcara:update-bglevel-status

Conversation

@mcara
Copy link
Copy Markdown
Member

@mcara mcara commented May 7, 2026

Resolves JP-4350

When attempting to resample (again) an already resampled image, the resulting double-resampled image often has an unexplained background offset compared to expected (single-resampled) image. After analysis, this is caused by resample populating most meta of the output resampled image from an input cal image and not updating background-related fields.

Tasks

  • If you have a specific reviewer in mind, tag them.
  • add a build milestone, i.e. Build 12.0 (use the latest build if not sure)
  • Does this PR change user-facing code / API? (if not, label with no-changelog-entry-needed)
    • write news fragment(s) in changes/: echo "changed something" > changes/<PR#>.<changetype>.rst (see changelog readme for instructions)
      • if your change breaks step-level or public API (as defined in the docs), also add a changes/<PR#>.breaking.rst news fragment
    • update or add relevant tests
    • update relevant docstrings and / or docs/ page
    • start a regression test and include a link to the running job (click here for instructions)
      • Do truth files need to be updated ("okified")?
        • after the reviewer has approved these changes, run okify_regtests to update the truth files
  • if a JIRA ticket exists, make sure it is resolved properly

Regression tests started: https://github.com/spacetelescope/RegressionTests/actions/runs/25517340890 Expect failures due to mismatches in resampled image background value (in meta only) and status (subtracted or not).

@mcara mcara self-assigned this May 7, 2026
@mcara mcara requested a review from a team May 7, 2026 19:25
@mcara mcara force-pushed the update-bglevel-status branch from a588ee8 to cc96c29 Compare May 7, 2026 19:26
Copy link
Copy Markdown
Collaborator

@emolter emolter left a comment

Choose a reason for hiding this comment

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

I tested locally that manually setting these does fix the background offset issue, so I expect this PR to work too.

Needs regression tests. I would expect some differences.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.38%. Comparing base (e5f2495) to head (cc96c29).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10525   +/-   ##
=======================================
  Coverage   86.38%   86.38%           
=======================================
  Files         373      373           
  Lines       40068    40070    +2     
=======================================
+ Hits        34612    34614    +2     
  Misses       5456     5456           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@emolter emolter left a comment

Choose a reason for hiding this comment

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

I was a little too hasty - this needs regression tests run and probably okified. Not sure how, or if I have the permissions, to dismiss my other review.

The code looks good though to me

@mcara
Copy link
Copy Markdown
Member Author

mcara commented May 7, 2026

@emolter link to the regression tests is at the bottom of the first comment.

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