diff --git a/changes/8890.jump.rst b/changes/8890.jump.rst new file mode 100644 index 0000000000..d04413a547 --- /dev/null +++ b/changes/8890.jump.rst @@ -0,0 +1,2 @@ +Add maximum_shower_amplitude parameter to MIRI cosmic rays showers routine +to fix accidental flagging of bright science pixels. diff --git a/docs/jwst/jump/arguments.rst b/docs/jwst/jump/arguments.rst index 9eada8a546..778d42363b 100644 --- a/docs/jwst/jump/arguments.rst +++ b/docs/jwst/jump/arguments.rst @@ -111,6 +111,8 @@ is defined as: * ``--min_diffs_single_pass``: The minimum number of differences to switch to flagging all outliers at once +* ``--max_shower_amplitude``: The maximum allowable amplitude for MIRI showers in DN/s + **Parameter that affects both Snowball and Shower flagging** * ``--max_extended_radius``: The maxiumum extension of the jump and saturation that will be flagged for showers or snowballs diff --git a/docs/jwst/jump/description.rst b/docs/jwst/jump/description.rst index c79f46c141..e7ac9aac9e 100644 --- a/docs/jwst/jump/description.rst +++ b/docs/jwst/jump/description.rst @@ -49,7 +49,8 @@ detectors are almost always circles with a central region that is saturated. The saturated core allows the search for smaller events without false positives. The mid-IR (MIRI) detectors do not, in general, have a saturated center and are only rarely circular. Thus, we fit the minimum enclosing ellipse and do not require that there are saturated pixels -within the ellipse. +within the ellipse. Likewise, MIRI showers are only flagged when detected features are consistent +with the maximum known amplitude (in DN/s) of shower artifacts. Multiprocessing --------------- diff --git a/jwst/jump/jump.py b/jwst/jump/jump.py index 92f70de2fb..febae44348 100644 --- a/jwst/jump/jump.py +++ b/jwst/jump/jump.py @@ -28,7 +28,8 @@ def run_detect_jumps(output_model, gain_model, readnoise_model, minimum_sigclip_groups=100, only_use_ints=True, mask_snowball_persist_next_int=True, - snowball_time_masked_next_int=250 + snowball_time_masked_next_int=250, + max_shower_amplitude=4 ): # Runs `detect_jumps` in stcal @@ -43,6 +44,8 @@ def run_detect_jumps(output_model, gain_model, readnoise_model, after_jump_flag_n2 = int(after_jump_flag_time2 // gtime) grps_masked_after_shower = int(time_masked_after_shower // gtime) snowball_grps_masked_next_int = int(snowball_time_masked_next_int // gtime) + # Likewise, convert a max MIRI shower amplitude in DN/s to DN/group + max_shower_amplitude = max_shower_amplitude * gtime # Get 2D gain and read noise values from their respective models if reffile_utils.ref_matches_sci(output_model, gain_model): gain_2d = gain_model.data @@ -85,7 +88,8 @@ def run_detect_jumps(output_model, gain_model, readnoise_model, minimum_sigclip_groups=minimum_sigclip_groups, only_use_ints=only_use_ints, mask_persist_grps_next_int = mask_snowball_persist_next_int, - persist_grps_flagged = snowball_grps_masked_next_int + persist_grps_flagged = snowball_grps_masked_next_int, + max_shower_amplitude = max_shower_amplitude ) diff --git a/jwst/jump/jump_step.py b/jwst/jump/jump_step.py index 86f2b33f23..7eec5c1780 100755 --- a/jwst/jump/jump_step.py +++ b/jwst/jump/jump_step.py @@ -38,6 +38,7 @@ class JumpStep(Step): mask_snowball_core_next_int = boolean(default=True) # Flag saturated cores of snowballs in the next integration? snowball_time_masked_next_int = integer(default=4000) # Time in seconds over which saturated cores are flagged in next integration find_showers = boolean(default=False) # Apply MIRI shower flagging? + max_shower_amplitude = float(default=4) # Maximum MIRI shower amplitude in DN/s extend_snr_threshold = float(default=1.2) # The SNR minimum for detection of extended showers in MIRI extend_min_area = integer(default=90) # Min area of emission after convolution for the detection of showers extend_inner_radius = float(default=1) # Inner radius of the ring_2D_kernel used for convolution @@ -119,6 +120,7 @@ def process(self, step_input): min_sat_radius_extend=self.min_sat_radius_extend, sat_required_snowball=sat_required_snowball, sat_expand=self.sat_expand * 2, expand_large_events=expand_large_events, find_showers=self.find_showers, + max_shower_amplitude=self.max_shower_amplitude, edge_size=self.edge_size, extend_snr_threshold=self.extend_snr_threshold, extend_min_area=self.extend_min_area, extend_inner_radius=self.extend_inner_radius,