Skip to content

Conversation

@melanieclarke
Copy link
Collaborator

@melanieclarke melanieclarke commented Aug 12, 2025

Resolves JP-3887

Requires spacetelescope/stdatamodels#555

Add support for time dependent photometry corrections for all modes.

MIRI imaging corrections will migrate from an exponential-only functional form, assuming an additive correction, to allowing any composition of linear, exponential, and power law forms, assuming a multiplicative correction. Current reference files are not supported: existing TIMECOEFF extensions will be ignored.

MIRI MRS corrections have a different format than the other instruments/modes. The current handling is moved from a mir_mrs module to a new time_dependence module. It will also now use a power law function instead of an exponential.

For all other instruments and modes, there are no existing time dependence corrections, but the code has been updated to expect them. As with MIRI imaging, any composition of linear, exponential, and power law forms is allowed, by attaching TIMECOEFF_LINEAR, TIMECOEFF_EXPONENTIAL, and TIMECOEFF_POWERLAW extensions to the PHOTOM reference file as needed. If none of these extensions are present, no time correction is applied.

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)
    • 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

@melanieclarke
Copy link
Collaborator Author

melanieclarke commented Aug 12, 2025

Regression tests here with spacetelescope/stdatamodels#555:
https://github.com/spacetelescope/RegressionTests/actions/runs/16892547832

Tests show one very small change to the background level value for one input file, recorded in the HDRTAB for the i2d output. This appears to be precision related, from minor changes to the way the time dependence is calculated for MIRI imaging photom corrections: the background level fit in skymatch is sensitive to very small changes in the data. There is otherwise no impact to the output data.

@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 99.24242% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.73%. Comparing base (8a9eed7) to head (c506bfc).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
jwst/photom/photom.py 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9736      +/-   ##
==========================================
+ Coverage   82.48%   82.73%   +0.24%     
==========================================
  Files         366      365       -1     
  Lines       37302    37324      +22     
==========================================
+ Hits        30770    30881     +111     
+ Misses       6532     6443      -89     

☔ 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.

@melanieclarke
Copy link
Collaborator Author

melanieclarke commented Aug 21, 2025

Rerunning regression tests after fixing the sense of the correction, updating the MIRI MRS functional form, and removing the MIRI imaging transition code:
https://github.com/spacetelescope/RegressionTests/actions/runs/17137431976

Now expecting diffs in both MIRI imaging and MRS modes for spec2, since the old-style timecoeff extensions are not supported, so time corrections will not be applied.

@melanieclarke
Copy link
Collaborator Author

@tapastro - the MIRI teams are happy with the changes here and would like to deliver reference files on Friday, coordinated with merging this PR. Do you think we can have this reviewed and ready by then?

Copy link
Contributor

@tapastro tapastro left a comment

Choose a reason for hiding this comment

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

One small nitpick, otherwise LGTM

@melanieclarke
Copy link
Collaborator Author

Regtests for okifying after ref file delivery:
https://github.com/spacetelescope/RegressionTests/actions/runs/17593198708

@melanieclarke melanieclarke merged commit 5c86e9b into spacetelescope:main Sep 9, 2025
32 of 38 checks passed
@melanieclarke melanieclarke deleted the jp-3887 branch September 9, 2025 20:39
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.

3 participants