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-3562: Extend snowball core #8303

Merged
merged 20 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 19 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
10 changes: 6 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,16 @@ general
jump
----

- Add parameters that control the flagging of saturated cores of snowballs in
the next integration. [#8303]

- Removed a unit test in ``jump`` that was moved to STCAL to decrease
the coupling of the two repos. [#8319]

- 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]

lib
---

Expand Down
4 changes: 4 additions & 0 deletions docs/jwst/jump/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ is defined as:

* ``--edge_size``: The distance from the edge of the detector where saturated cores are not required for snowball detection

* ``--mask_snowball_core_next_int``: Turns on/off the flagging of saturated cores of snowballs in the next integration

* ``--snowball_time_masked_next_int``: Controls the total time that the saturated cores of snowballs are flagged in the next integration.

**Parameters that affect MIRI Shower Flagging**

* ``--find_showers``: Turn on the detection of showers for the MIRI detectors
Expand Down
10 changes: 7 additions & 3 deletions jwst/jump/jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def run_detect_jumps(input_model, gain_model, readnoise_model,
max_extended_radius=200,
minimum_groups=3,
minimum_sigclip_groups=100,
only_use_ints=True
only_use_ints=True,
mask_snowball_persist_next_int=True,
snowball_time_masked_next_int=250
):

# Runs `detect_jumps` in stcal
Expand All @@ -45,7 +47,7 @@ def run_detect_jumps(input_model, gain_model, readnoise_model,
after_jump_flag_n1 = int(after_jump_flag_time1 // gtime)
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)
# Get 2D gain and read noise values from their respective models
if reffile_utils.ref_matches_sci(input_model, gain_model):
gain_2d = gain_model.data
Expand Down Expand Up @@ -85,7 +87,9 @@ def run_detect_jumps(input_model, gain_model, readnoise_model,
max_extended_radius=max_extended_radius,
minimum_groups=minimum_groups,
minimum_sigclip_groups=minimum_sigclip_groups,
only_use_ints=only_use_ints
only_use_ints=only_use_ints,
mask_persist_grps_next_int = mask_snowball_persist_next_int,
persist_grps_flagged = snowball_grps_masked_next_int
)


Expand Down
12 changes: 8 additions & 4 deletions jwst/jump/jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ 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
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
sat_expand = integer(default=2) # Number of pixels to add to the radius of the saturated core of snowballs
edge_size = integer(default=25) # Distance from detector edge where a saturated core is not required for snowball detection
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?
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 @@ -126,7 +128,9 @@ def process(self, input):
max_extended_radius=self.max_extended_radius * 2,
minimum_groups=self.minimum_groups,
minimum_sigclip_groups=self.minimum_sigclip_groups,
only_use_ints=self.only_use_ints
only_use_ints=self.only_use_ints,
mask_snowball_persist_next_int=self.mask_snowball_core_nxt_int,
hbushouse marked this conversation as resolved.
Show resolved Hide resolved
snowball_time_masked_next_int=self.snowball_time_masked_next_int
)


Expand Down
Loading