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 for jumps in first good group after dropping groups #84

Merged
merged 4 commits into from
Apr 27, 2022

Conversation

mwregan2
Copy link
Collaborator

@mwregan2 mwregan2 commented Apr 23, 2022

Resolves JP-2572
Resolves JP-2574

It has been tested against MIRI imager and MRS multi-integration exposures where it correctly ignored the first good groups when there was a jump in the 2nd good group and the early groups were set to DO NOT USE.

@nden nden requested review from hbushouse and cshanahan1 April 23, 2022 20:44
@codecov
Copy link

codecov bot commented Apr 23, 2022

Codecov Report

Merging #84 (5af012d) into main (0b2ad70) will decrease coverage by 17.01%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main      #84       +/-   ##
===========================================
- Coverage   88.80%   71.79%   -17.02%     
===========================================
  Files          16       16               
  Lines        2305     2308        +3     
===========================================
- Hits         2047     1657      -390     
- Misses        258      651      +393     
Impacted Files Coverage Δ
src/stcal/ramp_fitting/ols_fit.py 72.27% <100.00%> (-21.51%) ⬇️
src/stcal/dynamicdq.py 27.27% <0.00%> (-72.73%) ⬇️
src/stcal/jump/constants.py 28.57% <0.00%> (-71.43%) ⬇️
src/stcal/jump/jump.py 15.00% <0.00%> (-53.34%) ⬇️
src/stcal/dark_current/dark_class.py 69.04% <0.00%> (-30.96%) ⬇️
src/stcal/ramp_fitting/ramp_fit.py 70.00% <0.00%> (-25.00%) ⬇️
src/stcal/jump/twopoint_difference.py 78.15% <0.00%> (-21.01%) ⬇️
src/stcal/ramp_fitting/utils.py 80.12% <0.00%> (-18.35%) ⬇️
src/stcal/dark_current/dark_sub.py 81.96% <0.00%> (-2.46%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b2ad70...5af012d. Read the comment docs.

@hbushouse
Copy link
Collaborator

@mwregan2 I think the problem with the new unit test is the fact that it tries to import stuff from the jwst package, but the stcal test environment is setup to only test "common" code that's observatory-agnostic and hence doesn't include the jwst package in the build. If you want to use jwst specifics in the test, then the test module will need to be moved to /jwst/ramp_fit/tests/, i.e. in the jwst pkg instead of stcal. You'll need to create a separate PR against jwst for that.

@mwregan2
Copy link
Collaborator Author

mwregan2 commented Apr 25, 2022 via email

@hbushouse
Copy link
Collaborator

Yes, I realized my mistake about the jump vs ramp_fit steps and retracted the question.

Regarding stcal vs jwst, by the time data gets down to these routines in the stcal package it's all in the form of generic numpy arrays and such, all completely detached from any dependencies on jwst-specific datamodels. Notice that none of the modules in stcal/ramp_fitting import the jwst package. Anything that's jwst-specific is in the jwst package and rebundled by the top-level step module to just send generic data structures to the routines in stcal. That's in order to allow sharing by other pipeline (e.g. Roman) without having to import the jwst package.

@mwregan2
Copy link
Collaborator Author

mwregan2 commented Apr 25, 2022 via email

To avoid the dependency on the JWST package. I deleted the unit test.
@nden nden requested review from kmacdonald-stsci and removed request for cshanahan1 April 25, 2022 19:58
@hbushouse
Copy link
Collaborator

@mwregan2 reports that this fix has been used fairly extensively by the MIRI team to reprocess their data and it correctly solves the previous problems. So this is ready to merge (which I'll do).

@hbushouse hbushouse merged commit 639eb71 into spacetelescope:main Apr 27, 2022
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