Skip to content

Commit

Permalink
Correcting skip of dilution step.
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Brandt authored and Timothy Brandt committed Dec 23, 2024
1 parent 2cc2169 commit a90c068
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/stcal/saturation/saturation.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,21 @@ def flag_saturated_pixels(
nextdq = gdq[ints, group + 1, :, :]

# Determine the dilution factor due to group averaging

# No point in this step if the dilution factor is 1. In
# that case, there is no way that we would have missed
# saturation before but flag it now, since the threshold
# would be the same.

if read_pattern is not None:
# Single value dilution factor for this group
dilution_factor = np.mean(read_pattern[group]) / read_pattern[group][-1]
if dilution_factor == 1:
continue
# Broadcast to array size
dilution_factor = np.where(no_sat_check_mask, 1, dilution_factor)
else:
dilution_factor = 1

# No point in this step if the dilution factor is 1. In
# that case, there is no way that we would have missed
# saturation before but flag it now, since the threshold
# would be the same.

if dilution_factor == 1:
continue

# Find where this plane looks like it might saturate given
Expand Down

0 comments on commit a90c068

Please sign in to comment.