Skip to content

Commit

Permalink
Update changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Nov 1, 2023
1 parent bbd7000 commit c6f90be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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]

Changes to API
--------------
Expand Down
12 changes: 8 additions & 4 deletions tests/test_jump_cas22.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ def test_fit_ramps(detector_data, use_jump, use_dq):
if not use_dq:
assert okay.all()

output = fit_ramps(resultants, dq, read_noise, READ_TIME, read_pattern, use_jump=use_jump, include_diagnostic=True)
output = fit_ramps(resultants, dq, read_noise, READ_TIME, read_pattern, use_jump=use_jump,
include_diagnostic=True)
assert len(output.fits) == N_PIXELS # sanity check that a fit is output for each pixel

chi2 = 0
Expand Down Expand Up @@ -458,7 +459,8 @@ def test_fit_ramps_array_outputs(detector_data, use_jump):
resultants, read_noise, read_pattern = detector_data
dq = np.zeros(resultants.shape, dtype=np.int32)

output = fit_ramps(resultants, dq, read_noise, READ_TIME, read_pattern, use_jump=use_jump, include_diagnostic=True)
output = fit_ramps(resultants, dq, read_noise, READ_TIME, read_pattern, use_jump=use_jump,
include_diagnostic=True)

for fit, par, var in zip(output.fits, output.parameters, output.variances):
assert par[Parameter.intercept] == 0
Expand Down Expand Up @@ -530,7 +532,8 @@ def test_find_jumps(jump_data):
resultants, read_noise, read_pattern, jump_reads, jump_resultants = jump_data
dq = np.zeros(resultants.shape, dtype=np.int32)

output = fit_ramps(resultants, dq, read_noise, READ_TIME, read_pattern, use_jump=True, include_diagnostic=True)
output = fit_ramps(resultants, dq, read_noise, READ_TIME, read_pattern, use_jump=True,
include_diagnostic=True)
assert len(output.fits) == len(jump_reads) # sanity check that a fit/jump is set for every pixel

chi2 = 0
Expand Down Expand Up @@ -605,7 +608,8 @@ def test_jump_dq_set(jump_data):
resultants, read_noise, read_pattern, jump_reads, jump_resultants = jump_data
dq = np.zeros(resultants.shape, dtype=np.int32)

output = fit_ramps(resultants, dq, read_noise, READ_TIME, read_pattern, use_jump=True, include_diagnostic=True)
output = fit_ramps(resultants, dq, read_noise, READ_TIME, read_pattern, use_jump=True,
include_diagnostic=True)

for fit, pixel_dq in zip(output.fits, output.dq.transpose()):
# Check that all jumps found get marked
Expand Down

0 comments on commit c6f90be

Please sign in to comment.