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

JP-2669: Fixing the NaN and DO_NOT_USE bug. #112

Merged
merged 2 commits into from
Aug 10, 2022

Conversation

kmacdonald-stsci
Copy link
Collaborator

@kmacdonald-stsci kmacdonald-stsci commented Jul 28, 2022

Updating handling NaNs in the rateints product, as well as the DQ flags associated with those NaNs.

Resolves JP-2669

Closes #

This PR addresses NaNs in the rateints product file and the DQ flags associated with them. In the rateints product, NaNs were present with Good DQ flags. They shouldn't be.

Further, INS requested no NaNs be present in the rateints file. This PR detects NaNs in the rateints file and sets them to 0.0, then sets the corresponding DQ flag to DO_NOT_USE.

Lastly, the rateints DQ flags were set considering only JUMP_DET and SATURATED. This has now been changed to consider DO_NOT_USE as well. Specifically, if all groups in an integration for a pixel are flagged as DO_NOT_USE, the corresponding DQ value will be flagged as DO_NOT_USE.

Checklist

  • added entry in CHANGES.rst (either in Bug Fixes or Changes to API)
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)

@codecov
Copy link

codecov bot commented Jul 28, 2022

Codecov Report

Merging #112 (10fcc1c) into main (5013a69) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   72.13%   72.11%   -0.03%     
==========================================
  Files          16       16              
  Lines        2494     2510      +16     
==========================================
+ Hits         1799     1810      +11     
- Misses        695      700       +5     
Impacted Files Coverage Δ
src/stcal/ramp_fitting/ramp_fit_class.py 55.05% <14.28%> (-2.78%) ⬇️
src/stcal/ramp_fitting/ols_fit.py 72.06% <100.00%> (+0.08%) ⬆️
src/stcal/ramp_fitting/utils.py 84.10% <100.00%> (+0.27%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@dmggh dmggh left a comment

Choose a reason for hiding this comment

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

LGTM, including your documentation updates.

@hbushouse
Copy link
Collaborator

hbushouse commented Jul 29, 2022

Be aware that there's related discussion going on in https://jira.stsci.edu/browse/JP-2692 as to what values to assign to pixels that have no usable data (i.e. NaN vs. zero vs. ???). I believe this is scheduled for Cal WG discussion next week, so this might need updating based on the outcome of that discussion.

Updating handling NaNs in the rateints product, as well as the DQ flags associated with those NaNs.

Updating the change log.
Copy link
Contributor

@karllark karllark 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 to me. Very minor comment.

src/stcal/ramp_fitting/ols_fit.py Outdated Show resolved Hide resolved
@hbushouse
Copy link
Collaborator

Merging this in order to fix the bug that was leading to incorrect results. If the Cal WG decides later that pixels with no good data should be set to something other than zero, we'll make that change when necessary.

@hbushouse hbushouse merged commit 8e00460 into spacetelescope:main Aug 10, 2022
@nden
Copy link
Collaborator

nden commented Aug 10, 2022

This was merged without an approval by the Roman team.
@ddavis-stsci fyi: I started the roman devdeps regtest job.

@hbushouse
Copy link
Collaborator

This was merged without an approval by the Roman team. @ddavis-stsci fyi: I started the roman devdeps regtest job.

Whoops, my bad!

@kmacdonald-stsci
Copy link
Collaborator Author

I expect this to cause failures for regtests, since it changes NaNs to 0.0 and sets corresponding DQ flag to DO_NOT_USE.

@hbushouse hbushouse added this to the 1.1.0 milestone Aug 19, 2022
@kmacdonald-stsci kmacdonald-stsci deleted the jp_2669 branch April 17, 2023 19:16
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.

5 participants