diff --git a/CHANGES.rst b/CHANGES.rst index 682a5dff12..c06f78de97 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -145,6 +145,11 @@ general jump ---- +- To improve performance an additional parameter to the jump step was added + that sets the threshold number of differences above which iterative flagging + of one CR at a time is turned off. [#8304] + + - Removed a unit test in Jump that was moved to STCAL to decrease the coupling of the two repos. [#8319] @@ -154,9 +159,6 @@ lib - Updated ``set_velocity_aberration`` to use datamodels instead of `astropy.io.fits` for opening and manipulating input files. [#8285] -lib ---- - - Added new function set_nans_to_donotuse in ``lib.basic_utils`` to check the science data array for NaN values and check if they have a DQ flag of DO_NOT_USE, or set it if not. [#8292] diff --git a/docs/jwst/jump/arguments.rst b/docs/jwst/jump/arguments.rst index 954110a4cf..a4b27c2b6c 100644 --- a/docs/jwst/jump/arguments.rst +++ b/docs/jwst/jump/arguments.rst @@ -103,7 +103,9 @@ is defined as: * ``--extend_ellipse_expand_ratio``: Multiplicative factor to expand the radius of the ellipse fit to the detected extended emission in MIRI showers -* ``--time_masked_after_showers``: Number of seconds to flag groups as jump after a detected extended emission in MIRI showers +* ``--time_masked_after_shower``: Number of seconds to flag groups as jump after a detected extended emission in MIRI showers + +* ``--min_diffs_single_pass``: The minimum number of differences to switch to flagging all outliers at once **Parameter that affects both Snowball and Shower flagging** diff --git a/jwst/jump/jump.py b/jwst/jump/jump.py index 7eaf2b22c2..ab7b3df60c 100644 --- a/jwst/jump/jump.py +++ b/jwst/jump/jump.py @@ -22,7 +22,7 @@ def run_detect_jumps(input_model, gain_model, readnoise_model, sat_required_snowball=True, sat_expand=2, expand_large_events=False, find_showers=False, edge_size=25, extend_snr_threshold=1.1, extend_min_area=90, extend_inner_radius=1, extend_outer_radius=2.6, extend_ellipse_expand_ratio=1.1, - time_masked_after_shower=30, + time_masked_after_shower=30, min_diffs_single_pass=10, max_extended_radius=200, minimum_groups=3, minimum_sigclip_groups=100, @@ -81,6 +81,7 @@ def run_detect_jumps(input_model, gain_model, readnoise_model, extend_outer_radius=extend_outer_radius, extend_ellipse_expand_ratio=extend_ellipse_expand_ratio, grps_masked_after_shower=grps_masked_after_shower, + min_diffs_single_pass=min_diffs_single_pass, max_extended_radius=max_extended_radius, minimum_groups=minimum_groups, minimum_sigclip_groups=minimum_sigclip_groups, diff --git a/jwst/jump/jump_step.py b/jwst/jump/jump_step.py index f31d66b130..f0f393129e 100755 --- a/jwst/jump/jump_step.py +++ b/jwst/jump/jump_step.py @@ -36,15 +36,16 @@ class JumpStep(Step): use_ellipses = boolean(default=False) # deprecated sat_required_snowball = boolean(default=True) # Require the center of snowballs to be saturated min_sat_radius_extend = float(default=2.5) # The min radius of the sat core to trigger the extension of the core - sat_expand = integer(default=2) # Number of pixels to add to the radius of the saturated core of snowballs - edge_size = integer(default=25) # Size of region on the edges of NIR detectors where a sat core is not required - find_showers = boolean(default=False) # Turn on shower flagging for MIRI + sat_expand = integer(default=2) # Number of pixels to add to the radius of the saturated core of snowballs + find_showers = boolean(default=False) # Turn on shower flagging for MIRI + edge_size = integer(default=25) # Size of region on the edges of NIR detectors where a sat core is not required 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 extend_outer_radius = float(default=2.6) # Outer radius of the ring_2D_Kernel used for convolution extend_ellipse_expand_ratio = float(default=1.1) # Expand the radius of the ellipse fit to the extended emission time_masked_after_shower = float(default=15) # Seconds to flag as jump after a detected extended emission + min_diffs_single_pass = integer(default=10) # The minimum number of differences needed to skip the iterative flagging of jumps. max_extended_radius = integer(default=200) # The maximum radius of an extended snowball or shower minimum_groups = integer(default=3) # The minimum number of groups to perform jump detection using sigma clipping minimum_sigclip_groups = integer(default=100) # The minimum number of groups to switch to sigma clipping @@ -121,6 +122,7 @@ def process(self, input): extend_outer_radius=self.extend_outer_radius, extend_ellipse_expand_ratio=self.extend_ellipse_expand_ratio, time_masked_after_shower=self.time_masked_after_shower, + min_diffs_single_pass=self.min_diffs_single_pass, max_extended_radius=self.max_extended_radius * 2, minimum_groups=self.minimum_groups, minimum_sigclip_groups=self.minimum_sigclip_groups, diff --git a/jwst/jump/tests/test_detect_jumps.py b/jwst/jump/tests/test_detect_jumps.py index fc7c902547..662c261a3e 100644 --- a/jwst/jump/tests/test_detect_jumps.py +++ b/jwst/jump/tests/test_detect_jumps.py @@ -776,12 +776,12 @@ def test_proc(setup_inputs): model.data[0, 7, 2, 3] = 160.0 model.data[0, 8, 2, 3] = 170.0 model.data[0, 9, 2, 3] = 180.0 - + model_b = model.copy() + model_c = model.copy() out_model_a = run_detect_jumps(model, gain, rnoise, 4.0, 5.0, 6.0, 'none', 200, 4, True) - out_model_b = run_detect_jumps(model, gain, rnoise, 4.0, 5.0, 6.0, 'half', 200, 4, True) + out_model_b = run_detect_jumps(model_b, gain, rnoise, 4.0, 5.0, 6.0, 'half', 200, 4, True) assert_array_equal(out_model_a.groupdq, out_model_b.groupdq) - - out_model_c = run_detect_jumps(model, gain, rnoise, 4.0, 5.0, 6.0, 'all', 200, 4, True) + out_model_c = run_detect_jumps(model_c, gain, rnoise, 4.0, 5.0, 6.0, 'all', 200, 4, True) assert_array_equal(out_model_a.groupdq, out_model_c.groupdq)