Skip to content

Commit

Permalink
Update changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Nov 6, 2023
1 parent 0e54e3e commit 7c0bd1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ramp_fitting
- Refactor Casertano, et.al, 2022 uneven ramp fitting and incorporate the matching
jump detection algorithm into it. [#215]
- Fix memory issue with uneven ramp fitting [#226]
- Fix some bugs in the jump detection algorithm [#227]

Changes to API
--------------
Expand Down
11 changes: 5 additions & 6 deletions tests/test_jump_cas22.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ def test_fit_ramps(detector_data, use_jump, use_dq):
assert len(output.fits) == N_PIXELS # sanity check that a fit is output for each pixel

chi2 = 0
excess = 0 # counts the number of jumps erroneously detected
for fit, use in zip(output.fits, okay):
if not use_dq and not use_jump:
##### The not use_jump makes this NOT test for false positives #####
Expand All @@ -440,9 +439,7 @@ def test_fit_ramps(detector_data, use_jump, use_dq):
if use:
# Add okay ramps to chi2
total_var = fit['average']['read_var'] + fit['average']['poisson_var']
if total_var == 0:
excess += 1
else:
if total_var != 0:
chi2 += (fit['average']['slope'] - FLUX)**2 / total_var
else:
# Check no slope fit for bad ramps
Expand All @@ -452,7 +449,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) + excess)
chi2 /= np.sum(okay)
assert np.abs(chi2 - 1) < CHI2_TOL


Expand Down Expand Up @@ -575,7 +572,9 @@ def test_find_jumps(jump_data):
# The two resultants excluded should be adjacent
jump_correct = []
for jump in fit['jumps']:
jump_correct.append(jump == resultant_index or jump == resultant_index - 1 or jump == resultant_index + 1)
jump_correct.append(jump == resultant_index or
jump == resultant_index - 1 or
jump == resultant_index + 1)
if not all(jump_correct):
incorrect_other += 1
continue

Check warning on line 580 in tests/test_jump_cas22.py

View check run for this annotation

Codecov / codecov/patch

tests/test_jump_cas22.py#L579-L580

Added lines #L579 - L580 were not covered by tests
Expand Down

0 comments on commit 7c0bd1e

Please sign in to comment.