Skip to content

Commit

Permalink
Find extended jumps (#7545)
Browse files Browse the repository at this point in the history
* Add new parameters to STCAL Jump

* Update jump_step.py

* Update jump_step.py

* Update jump_step.py

* Update jump_step.py

* Update jump_step.py

* Update jump_step.py

* Update jump.py

* Update jump.py

* add sat_expand variable

* Update arguments.rst

* Update arguments.rst

* doc updates

* change from groups to time

* Update jump_step.py

* Update CHANGES.rst

* Update arguments.rst

* fixed line length issues

* Update test_jump_step.py

* Update jump_step.py

* Update jump_step.py

* Added parameter that will limit the expansion of snowballs and showers

* Update CHANGES.rst

* Update arguments.rst

* Update arguments.rst

* Update arguments.rst

* Update jump_step.py

* Update CHANGES.rst

* Update arguments.rst

* Update jump_step.py

* add PR number

* Update CHANGES.rst

---------

Co-authored-by: Zach Burnett <[email protected]>
Co-authored-by: Howard Bushouse <[email protected]>
  • Loading branch information
3 people authored Apr 13, 2023
1 parent af4fa07 commit b47b3c9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ flat_field

- Updated to allow processing of NIRSpec fixed-slit 3D (rateints) files. [#7516]

jump
----------
- Added a new parameter that limits maximum size of extension of jump. It exists
in the STCAL jump code but not in JWST. This allows the parameter to be changed.
Also, scaled two input parameters that are listed as radius to be a factor of two
higher to match the opencv code that uses diameter. [#7545]

other
-----

Expand Down
2 changes: 2 additions & 0 deletions docs/jwst/jump/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ The ``jump`` step has five optional arguments that can be set by the user:
* ``--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

* ``--max_extended_radius``: The maxiumum extension of the jump and saturation that will be flagged for showers or snowballs
7 changes: 5 additions & 2 deletions jwst/jump/jump.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ 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,
max_extended_radius=200,
):

# Runs `detect_jumps` in stcal
Expand Down Expand Up @@ -77,7 +78,9 @@ def run_detect_jumps(input_model, gain_model, readnoise_model,
extend_min_area=extend_min_area, extend_inner_radius=extend_inner_radius,
extend_outer_radius=extend_outer_radius,
extend_ellipse_expand_ratio=extend_ellipse_expand_ratio,
grps_masked_after_shower=grps_masked_after_shower)
grps_masked_after_shower=grps_masked_after_shower,
max_extended_radius=max_extended_radius)


# Update the DQ arrays of the output model with the jump detection results
output_model.groupdq = new_gdq
Expand Down
7 changes: 5 additions & 2 deletions jwst/jump/jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class JumpStep(Step):
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
max_extended_radius = integer(default=200) The maximum radius of an extended snowball or shower
"""

reference_file_types = ['gain', 'readnoise']
Expand Down Expand Up @@ -107,14 +108,16 @@ def process(self, input):
min_sat_area=min_sat_area, min_jump_area=min_jump_area,
expand_factor=expand_factor, use_ellipses=use_ellipses,
min_sat_radius_extend=self.min_sat_radius_extend,
sat_required_snowball=sat_required_snowball, sat_expand=self.sat_expand,
sat_required_snowball=sat_required_snowball, sat_expand=self.sat_expand * 2,
expand_large_events=expand_large_events, find_showers=self.find_showers,
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,
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)
time_masked_after_shower=self.time_masked_after_shower,
max_extended_radius=self.max_extended_radius * 2)


gain_model.close()
readnoise_model.close()
Expand Down

0 comments on commit b47b3c9

Please sign in to comment.