Skip to content

Commit

Permalink
Reverting edge case to previous logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Brandt committed Feb 6, 2025
1 parent 6e252e2 commit 68118a2
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/stcal/jump/twopoint_difference.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,19 +288,16 @@ def find_crs_old(
del clipped_diffs
gdq[:, 1:] |= jump_mask * np.uint8(jump_flag)

Check warning on line 289 in src/stcal/jump/twopoint_difference.py

View check run for this annotation

Codecov / codecov/patch

src/stcal/jump/twopoint_difference.py#L284-L289

Added lines #L284 - L289 were not covered by tests

# Note: the code below originally did something very different
# from what the comment below says. Please check.
#
# if grp is all jump set to do not use
for integ in range(nints):
for grp in range(ngrps):
if np.all(gdq[integ, grp] & (jump_flag | dnu_flag) != 0):

Check warning on line 294 in src/stcal/jump/twopoint_difference.py

View check run for this annotation

Codecov / codecov/patch

src/stcal/jump/twopoint_difference.py#L294

Added line #L294 was not covered by tests
gdq[integ, grp] |= dnu_flag
# The line below matches the comment above, but not the
# old logic. Leaving it for now.
#gdq[integ, grp] |= dnu_flag

#if np.all(np.bitwise_or(np.bitwise_and(gdq[integ, grp, :, :], jump_flag),
# np.bitwise_and(gdq[integ, grp, :, :], dnu_flag))):
# jumpy, jumpx = np.where(gdq[integ, grp, :, :] == jump_flag)
# gdq[integ, grp, jumpy, jumpx] = 0
jump_only = gdq[integ, grp, :, :] == jump_flag
gdq[integ, grp][jump_only] = 0

Check warning on line 300 in src/stcal/jump/twopoint_difference.py

View check run for this annotation

Codecov / codecov/patch

src/stcal/jump/twopoint_difference.py#L299-L300

Added lines #L299 - L300 were not covered by tests

warnings.resetwarnings()
else: # There are not enough groups for sigma clipping
Expand Down

0 comments on commit 68118a2

Please sign in to comment.