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

Add Roman jump detection to ramp fitting #215

Merged

Conversation

WilliamJamieson
Copy link
Collaborator

This PR adds the Roman jump detection to the roman ramp fitting algorithm.

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)

@WilliamJamieson

This comment was marked as resolved.

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/stcal/ramp_fitting/ols_cas22/__init__.py 100.00% <100.00%> (ø)
tests/test_jump_cas22.py 100.00% <100.00%> (ø)
tests/test_ramp_fitting_cas22.py 100.00% <100.00%> (ø)
setup.py 0.00% <0.00%> (ø)
src/stcal/ramp_fitting/ols_cas22_fit.py 81.25% <78.26%> (+40.77%) ⬆️

📢 Thoughts on this report? Let us know!.

Copy link
Collaborator

@schlafly schlafly 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 good to me. I made a bunch of minor comments. Some summary:

  • Let's get rid of all of the _ma_table routines. We only ever need read_pattern; the ma_table pattern was something I made up for the simulator before read_pattern existed, and it doesn't need to continue existing.
  • It will be good to see that this matches Sanjib's results, but the current tests look good and I'm optimistic.
  • The final test in test_find_jumps would be more convincing if it were phrased in terms of the chi^2/dof. That's slightly annoying in that case since the degrees of freedom are 8 resultants - ~2 flagged - (2, 3, or 4 depending on where the jump landed). But I think it's not that bad and would make for a strong demo that both the ramps and their variances were good.

src/stcal/ramp_fitting/ols_cas22/_core.pyx Outdated Show resolved Hide resolved
src/stcal/ramp_fitting/ols_cas22/_fixed.pyx Outdated Show resolved Hide resolved
src/stcal/ramp_fitting/ols_cas22/_fixed.pyx Outdated Show resolved Hide resolved
src/stcal/ramp_fitting/ols_cas22/_fixed.pyx Outdated Show resolved Hide resolved
src/stcal/ramp_fitting/ols_cas22/_pixel.pxd Outdated Show resolved Hide resolved
tests/test_jump_cas22.py Outdated Show resolved Hide resolved
tests/test_jump_cas22.py Outdated Show resolved Hide resolved
tests/test_jump_cas22.py Outdated Show resolved Hide resolved
tests/test_ramp_fitting_cas22.py Outdated Show resolved Hide resolved
tests/test_ramp_fitting_cas22.py Outdated Show resolved Hide resolved
@WilliamJamieson WilliamJamieson marked this pull request as ready for review October 6, 2023 15:16
@WilliamJamieson WilliamJamieson requested a review from a team as a code owner October 6, 2023 15:16
Copy link
Collaborator

@schlafly schlafly 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 great. Two questions:

  • Can we modify dq in place? I have been trying to avoid making any new things that are nresultants x npixel in size elsewhere in the pipeline.
  • I am missing some bit in one of the tests where I expect some false positives. Are there really none or am I confused?



RNG = np.random.default_rng(619)
ROMAN_READ_TIME = 3.04
Copy link
Collaborator

Choose a reason for hiding this comment

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

Really, I just feel like we'd like this to be mission independent, so I think I'm just asking to delete ROMAN_. But obviously this is minor and I don't feel strongly.

src/stcal/ramp_fitting/ols_cas22/_fixed.pyx Outdated Show resolved Hide resolved
src/stcal/ramp_fitting/ols_cas22/_fit_ramps.pyx Outdated Show resolved Hide resolved
tests/test_jump_cas22.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@schlafly schlafly left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

src/stcal/ramp_fitting/ols_cas22/_core.pyx Outdated Show resolved Hide resolved
src/stcal/ramp_fitting/ols_cas22/_wrappers.pyx Outdated Show resolved Hide resolved
Copy link
Collaborator

@stscieisenhamer stscieisenhamer left a comment

Choose a reason for hiding this comment

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

not knowing the details of jump detection, lgtm

@WilliamJamieson WilliamJamieson merged commit 1e7a317 into spacetelescope:main Oct 26, 2023
26 checks passed
@WilliamJamieson WilliamJamieson deleted the feature/jump_detection branch October 26, 2023 17:03
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.

4 participants