From 89a7a010aeca32bcf6fcf97041cc031bd001c7f2 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Mon, 1 May 2023 15:02:32 -0400 Subject: [PATCH] Do not detect saturated pixels if they are bad otherwise --- jwst/resample/resample_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jwst/resample/resample_utils.py b/jwst/resample/resample_utils.py index 0f4575ee5e..ca287c7c53 100644 --- a/jwst/resample/resample_utils.py +++ b/jwst/resample/resample_utils.py @@ -228,7 +228,9 @@ def build_driz_weight(model, weight_type=None, good_bits=None): if selective_median: # apply median filter selectively only at # points of partially saturated sources: - jumps = np.where(model.dq & saturation) + jumps = np.where( + np.logical_and(model.dq & saturation, dqmask) + ) w2 = kernel_size // 2 for r, c in zip(*jumps): x1 = max(0, c - w2)