Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JP-3550: Jump multi int #8304

Merged
merged 13 commits into from
Mar 22, 2024
8 changes: 5 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,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]

Expand All @@ -150,9 +155,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]
Expand Down
4 changes: 3 additions & 1 deletion docs/jwst/jump/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down
3 changes: 2 additions & 1 deletion jwst/jump/jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 5 additions & 3 deletions jwst/jump/jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
hbushouse marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions jwst/jump/tests/test_detect_jumps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
Loading