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-3677: Add maximum_shower_amplitude parameter to jump step #8890

Merged
merged 6 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changes/8890.jump.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add maximum_shower_amplitude parameter to MIRI cosmic rays showers routine
to fix accidental flagging of bright science pixels.
2 changes: 2 additions & 0 deletions docs/jwst/jump/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/jwst/jump/description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------
Expand Down
8 changes: 6 additions & 2 deletions jwst/jump/jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
)


Expand Down
2 changes: 2 additions & 0 deletions jwst/jump/jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading