Skip to content

Commit

Permalink
restore overriden version of duplicate test
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Sep 23, 2024
1 parent ec5eac8 commit cf527d6
Showing 1 changed file with 21 additions and 34 deletions.
55 changes: 21 additions & 34 deletions tests/test_jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,49 +433,36 @@ def test_find_faint_extended_sigclip():
nint, ngrps, ncols, nrows = 101, 6, 30, 30
data = np.zeros(shape=(nint, ngrps, nrows, ncols), dtype=np.float32)
gdq = np.zeros_like(data, dtype=np.uint8)
pdq = np.zeros(shape=(nrows, ncols), dtype=np.uint8)
pdq = np.zeros(shape=(nrows, ncols), dtype=np.int32)
gain = 4
readnoise = np.ones(shape=(nrows, ncols), dtype=np.float32) * 6.0 * gain
rng = np.random.default_rng(12345)
data[0, 1:, 14:20, 15:20] = 6 * gain * 1.7
data = data + rng.normal(size=(nint, ngrps, nrows, ncols)) * readnoise
min_shower_area=20
gdq, num_showers = find_faint_extended(
data,
gdq,
pdq,
readnoise,
1,
100,
DQFLAGS,
snr_threshold=1.3,
min_shower_area=min_shower_area,
inner=1,
outer=2,
sat_flag=2,
jump_flag=4,
ellipse_expand=1.1,
num_grps_masked=3,
)
gdq, num_showers = find_faint_extended(data, gdq, pdq, readnoise, 1, 100,
snr_threshold=1.3,
min_shower_area=20, inner=1,
outer=2, sat_flag=2, jump_flag=4,
ellipse_expand=1.1, num_grps_masked=3,
dqflags=DQFLAGS)
# Check that all the expected samples in group 2 are flagged as jump and
# that they are not flagged outside
assert num_showers == 0
assert np.all(gdq[0, 1, 22, 14:23] == 0)
assert np.all(gdq[0, 1, 21, 16:20] == 0)
assert np.all(gdq[0, 1, 20, 15:22] == 0)
assert np.all(gdq[0, 1, 19, 15:23] == 0)
assert np.all(gdq[0, 1, 18, 14:23] == 0)
assert np.all(gdq[0, 1, 17, 14:23] == 0)
assert np.all(gdq[0, 1, 16, 14:23] == 0)
assert np.all(gdq[0, 1, 15, 14:22] == 0)
assert np.all(gdq[0, 1, 14, 16:22] == 0)
assert np.all(gdq[0, 1, 13, 17:21] == 0)
assert np.all(gdq[0, 1, 12, 14:23] == 0)
assert np.all(gdq[0, 1, 12:23, 24] == 0)
assert np.all(gdq[0, 1, 12:23, 13] == 0)
assert (np.all(gdq[0, 1, 22, 14:23] == 0))
assert (np.all(gdq[0, 1, 21, 16:20] == 0))
assert (np.all(gdq[0, 1, 20, 15:22] == 0))
assert (np.all(gdq[0, 1, 19, 15:23] == 0))
assert (np.all(gdq[0, 1, 18, 14:23] == 0))
assert (np.all(gdq[0, 1, 17, 14:23] == 0))
assert (np.all(gdq[0, 1, 16, 14:23] == 0))
assert (np.all(gdq[0, 1, 15, 14:22] == 0))
assert (np.all(gdq[0, 1, 14, 16:22] == 0))
assert (np.all(gdq[0, 1, 13, 17:21] == 0))
assert (np.all(gdq[0, 1, 12, 14:23] == 0))
assert (np.all(gdq[0, 1, 12:23, 24] == 0))
assert (np.all(gdq[0, 1, 12:23, 13] == 0))

# Check that the flags are not applied in the 3rd group after the event
assert np.all(gdq[0, 4, 12:22, 14:23]) == 0
assert (np.all(gdq[0, 4, 12:22, 14:23]) == 0)


def test_inside_ellipse5():
Expand Down

0 comments on commit cf527d6

Please sign in to comment.