spacetelescope / stcal

https://stcal.readthedocs.io/en/latest/
Other
10 stars 32 forks source link

JP-3111: Fix dark subtraction for MIRI segmented data #165

Closed hbushouse closed 1 year ago

hbushouse commented 1 year ago

Resolves JP-3111

This PR updates the dark_sub routine to fix the way darks are subtracted from MIRI segmented data files. The integration-dependent darks should only be subtracted when processing the segment containing the first integrations in the exposure. All other segments just use the last dark integration. So a check has been added to the logic of choosing dark integrations to see if the science segment starts at integration 1.

Checklist

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 55.55% and project coverage change: -0.05 :warning:

Comparison is base (5081bb9) 74.64% compared to head (e6ea1f7) 74.60%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #165 +/- ## ========================================== - Coverage 74.64% 74.60% -0.05% ========================================== Files 29 29 Lines 5652 5658 +6 ========================================== + Hits 4219 4221 +2 - Misses 1433 1437 +4 ``` | [Impacted Files](https://app.codecov.io/gh/spacetelescope/stcal/pull/165?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spacetelescope) | Coverage Δ | | |---|---|---| | [src/stcal/dark\_current/dark\_class.py](https://app.codecov.io/gh/spacetelescope/stcal/pull/165?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spacetelescope#diff-c3JjL3N0Y2FsL2RhcmtfY3VycmVudC9kYXJrX2NsYXNzLnB5) | `56.36% <20.00%> (-3.64%)` | :arrow_down: | | [src/stcal/dark\_current/dark\_sub.py](https://app.codecov.io/gh/spacetelescope/stcal/pull/165?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=spacetelescope#diff-c3JjL3N0Y2FsL2RhcmtfY3VycmVudC9kYXJrX3N1Yi5weQ==) | `82.11% <100.00%> (+0.14%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

hbushouse commented 1 year ago

JWST regression test run https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/711/ had no failures.

hbushouse commented 1 year ago

@PaulHuwe Can you please review this for Roman compatibility?

hbushouse commented 1 year ago

A new regression test for this functionality has been added in https://github.com/spacetelescope/jwst/pull/7582

hbushouse commented 1 year ago

Full jwst regression test started at https://plwishmaster.stsci.edu:8081/job/RT/job/JWST-Developers-Pull-Requests/716/ which employs this PR and the new MIRI segmented exposure regression test added in https://github.com/spacetelescope/jwst/pull/7582