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)