Skip to content

Commit

Permalink
Merge pull request #10 from bhilbert4/flag-low-pix
Browse files Browse the repository at this point in the history
Add keyword to allow flagging of pixels below median
  • Loading branch information
jdavies-st authored Jul 1, 2024
2 parents 2958c6b + cf8a930 commit 9c42fb1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/snowblind/selfcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class OpenPixelStep(Step):
save_mask = boolean(default=False) # write out per-detector bad-pixel mask and median
output_use_model = boolean(default=True)
output_use_index = boolean(default=False)
flag_low_signal_pix = boolean(default=False)
"""

class_alias = "open_pixel"
Expand Down Expand Up @@ -91,7 +92,10 @@ def create_hotpixel_mask(self, image_stack):
warnings.filterwarnings(action="ignore",
message="Input data contains invalid values")
_, med, std = sigma_clipped_stats(median2d, mask_value=np.nan)

mask = median2d > med + self.threshold * std
# mask |= median2d < med - self.threshold * std
if self.flag_low_signal_pix:
self.log.info(f"Flagging pixels {self.threshold}-sigma below median as well as those above.")
mask |= median2d < med - self.threshold * std

return mask, median2d

0 comments on commit 9c42fb1

Please sign in to comment.