Skip to content

Commit

Permalink
Delete jump step unit test that has been moved to STCAL (#8319)
Browse files Browse the repository at this point in the history
Co-authored-by: Howard Bushouse <[email protected]>
  • Loading branch information
mwregan2 and hbushouse authored Mar 1, 2024
1 parent 3b33461 commit fb344a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 46 deletions.
8 changes: 7 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ associations
sub-pixel dithers, so that only exposures from other nod positions
are used as background members in "spec2" associations. [#8184]

- JP-3290 Isolate candidate processing into their own pools [#8227]
- Isolate candidate processing into their own pools [#8227]

cube_build
----------
Expand Down Expand Up @@ -82,6 +82,12 @@ general

- Update minimum required stdatamodels version to include 1.10.0 [#8322]

jump
----

- Removed a unit test in Jump that was moved to STCAL to decrease
the coupling of the two repos. [#8319]

outlier_detection
-----------------

Expand Down
45 changes: 0 additions & 45 deletions jwst/jump/tests/test_detect_jumps.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,51 +307,6 @@ def test_multiple_neighbor_jumps_firstlastbad(setup_inputs):
assert_array_equal(out_model.groupdq[0, :, 4, 4], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1])


def test_nirspec_saturated_pix(setup_inputs):
"""
This test is based on an actual NIRSpec exposure that has some pixels
flagged as saturated in one or more groups, which the jump step is
supposed to ignore, but an old version of the code was setting JUMP flags
for some of the saturated groups. This is to verify that the saturated
groups are no longer flagged with jumps.
"""
grouptime = 3.0
ingain = 1.0
inreadnoise = 10.7
ngroups = 7
nrows = 6
ncols = 6

model, rnoise, gain = setup_inputs(ngroups=ngroups, nints=1, nrows=nrows,
ncols=ncols, gain=ingain,
readnoise=inreadnoise, deltatime=grouptime)

# Setup the needed input pixel and DQ values
model.data[0, :, 1, 1] = [639854.75, 4872.451, -17861.791, 14022.15, 22320.176,
1116.3828, 1936.9746]
model.groupdq[0, :, 1, 1] = [0, 0, 0, 0, 0, 2, 2]
model.data[0, :, 2, 2] = [8.25666812e+05, -1.10471914e+05, 1.95755371e+02, 1.83118457e+03,
1.72250879e+03, 1.81733496e+03, 1.65188281e+03]
# 2 non-sat groups means only 1 non-sat diff, so no jumps should be flagged
model.groupdq[0, :, 2, 2] = [0, 0, 2, 2, 2, 2, 2]
model.data[0, :, 3, 3] = [1228767., 46392.234, -3245.6553, 7762.413,
37190.76, 266611.62, 5072.4434]
model.groupdq[0, :, 3, 3] = [0, 0, 0, 0, 0, 0, 2]

# run jump detection
out_model = run_detect_jumps(model, gain, rnoise, rejection_thresh=200.0, three_grp_thresh=200,
four_grp_thresh=200,
max_cores='none', max_jump_to_flag_neighbors=200,
min_jump_to_flag_neighbors=10, flag_4_neighbors=True)

# Check the results. There should not be any pixels with DQ values of 6, which
# is saturated (2) plus jump (4). All the DQ's should be either just 2 or just 4.
assert_array_equal(out_model.groupdq[0, :, 1, 1], [0, 4, 4, 4, 0, 2, 2])
# assert that no groups are flagged when theres only 1 non-sat. grp
assert_array_equal(out_model.groupdq[0, :, 2, 2], [0, 0, 2, 2, 2, 2, 2])
assert_array_equal(out_model.groupdq[0, :, 3, 3], [0, 4, 4, 0, 0, 4, 2])


def add_crs(model, crs_frac):
""""
Randomly add a cosmic ray of magnitude CR_MAG to a fraction (crs_frac)
Expand Down

0 comments on commit fb344a7

Please sign in to comment.