Skip to content

JP-4316: Update _contam and _simul_slits files with slit metadata#10509

Open
emolter wants to merge 7 commits into
spacetelescope:mainfrom
emolter:JP-4316
Open

JP-4316: Update _contam and _simul_slits files with slit metadata#10509
emolter wants to merge 7 commits into
spacetelescope:mainfrom
emolter:JP-4316

Conversation

@emolter
Copy link
Copy Markdown
Collaborator

@emolter emolter commented May 4, 2026

Resolves JP-4316

This PR:

  • Updates each slit in the _contam and _simul_slits products with metadata from the corresponding observed slit
  • Make the SLTNAME match the SOURCEID keyword in the _simul_slits file
  • Fix a bug in extract2d where the schema-undefined slit.bunit_data was being assigned instead of the schema-defined slit.meta.bunit_data for grism products, leading to missing BUNIT in the fits SCI extension

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

@emolter
Copy link
Copy Markdown
Collaborator Author

emolter commented May 4, 2026

https://github.com/spacetelescope/RegressionTests/actions/runs/25340464436

WFSS changes look as expected. All new keywords have been propagated into the slits, with the exception of the BUNIT keyword. The BUNIT keyword is not set because the regtests start with a _srctype file, so the upstream fix in extract2d isn't getting applied to what is effectively a slightly stale input file. I have confirmed locally that all products get a BUNIT keyword as expected if the full spec2pipeline is called.

Looks like DHS modes also get a BUNIT keyword here, which I didn't initially expect but makes sense, and I think it's an improvement.

The diff in test_nirspec_mos_mbkg[masterbg2d]: jwst.regtest.test_nirspec_masterbackground is unrelated and has since been okified.

Regtests need to be rerun from a new job for okify.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

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

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

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

@emolter emolter marked this pull request as ready for review May 8, 2026 13:21
@emolter emolter requested a review from a team May 8, 2026 13:21
@emolter emolter requested review from stscirij and tapastro as code owners May 8, 2026 13:21
@emolter emolter requested a review from melanieclarke May 11, 2026 19:36
Copy link
Copy Markdown
Collaborator

@melanieclarke melanieclarke left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me, although I see a few additional WCS keywords in the regression tests:

Extra keyword 'DISPAXIS' in a: 1
Extra keyword 'RADESYS' in a: 'ICRS'
Extra keyword 'SPECSYS' in a: 'BARYCENT'

I assume they're riding along from the wcsinfo in the slit they're updated from. I don't think they should do any harm, but they weren't requested. Should we remove them to reduce clutter or leave them?

@emolter
Copy link
Copy Markdown
Collaborator Author

emolter commented May 11, 2026

I left them there on purpose. In the end, after all that discussion, it seemed to me the experts wanted all available slit metadata in both optional products. We didn't explicitly discuss those, but as you say they do no harm and seemed in-line with the other comments I got on the ticket. I don't think I'd consider it clutter personally.

Copy link
Copy Markdown
Collaborator

@melanieclarke melanieclarke 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, thanks!

The regtests will need to be run again for a clean okify, but I'll approve now and leave that to you.

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