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

Resolve some bugs with the jump fitting algorithm #227

Merged

Conversation

WilliamJamieson
Copy link
Collaborator

This PR makes some adjustments to the jump detection algorithm so that it exactly detects the jumps detected in the simulated data.

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 WilliamJamieson requested a review from a team as a code owner November 6, 2023 20:57
@WilliamJamieson WilliamJamieson requested review from schlafly and removed request for a team November 6, 2023 20:57
@@ -24,7 +24,7 @@
READ_NOISE = np.float32(5)

# Set a value for jumps which makes them obvious relative to the normal flux
JUMP_VALUE = 10_000
JUMP_VALUE = 1_000
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good to me. I wasn't sure if this one was intentional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This had no visible effect on the results

@@ -447,7 +452,7 @@ def test_fit_ramps(detector_data, use_jump, use_dq):

assert use_dq # sanity check that this branch is only encountered when use_dq = True

chi2 /= np.sum(okay)
chi2 /= (np.sum(okay) + excess)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think it makes a difference, but I don't think I expected the "excess" to make an appearence here, since those cases don't contribute to chi^2 above on line 444.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It actually should be be a difference not a sum, but you are right, it makes no difference

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yup, would make sense subtracted, thanks.

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

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

Files Coverage Δ
tests/test_jump_cas22.py 98.34% <85.18%> (-1.66%) ⬇️

📢 Thoughts on this report? Let us know!

@WilliamJamieson WilliamJamieson merged commit 1889060 into spacetelescope:main Nov 6, 2023
22 of 24 checks passed
@WilliamJamieson WilliamJamieson deleted the bugfix/jump_bugs branch November 7, 2023 00:16
WilliamJamieson added a commit to WilliamJamieson/stcal that referenced this pull request Nov 14, 2023
if jumps are correctly identified
This checks if jumps are correctly identified, resolving some lingering
test issues from spacetelescope#227
WilliamJamieson added a commit to WilliamJamieson/stcal that referenced this pull request Nov 14, 2023
if jumps are correctly identified
This checks if jumps are correctly identified, resolving some lingering
test issues from spacetelescope#227
WilliamJamieson added a commit to WilliamJamieson/stcal that referenced this pull request Nov 16, 2023
if jumps are correctly identified
This checks if jumps are correctly identified, resolving some lingering
test issues from spacetelescope#227
WilliamJamieson added a commit to WilliamJamieson/stcal that referenced this pull request Nov 21, 2023
if jumps are correctly identified
This checks if jumps are correctly identified, resolving some lingering
test issues from spacetelescope#227
WilliamJamieson added a commit to WilliamJamieson/stcal that referenced this pull request Feb 13, 2024
if jumps are correctly identified
This checks if jumps are correctly identified, resolving some lingering
test issues from spacetelescope#227
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