SnowblindStep#

snowblind.SnowblindStep, run with strun snowblind. Flags snowballs: grows each halo to follow the shape of the event, flags the ring around the core to the end of the integration, and flags the core’s snowball persistence in the later integrations of the ramp. Replaces the jump step’s expand_large_events; also runs on rate products. Guide: Snowball, jump and open-pixel flagging.

Parameters:
min_radiusinteger, default 2

radius of the disk an event must hold to count as a snowball

growth_factorfloat, default 2.0

the halo is grown by this times its equal-area radius

ring_widthfloat, default 2.0

pixels the ring extends from the core, counted from the SATURATED flags

after_jumpsinteger, default None

deprecated; None flags the ring to the end of the integration

core_persistence_timefloat, default None

seconds after the end of the snowball’s integration during which the core is flagged in later integrations; None takes the detector’s packaged time

neighbor_persistence_timefloat, default None

the same for the pixels next to the core

new_jump_flaginteger, default 4

DQ flag set on the grown pixels

The parameters every stpipe step has (skip, save_results, output_dir, suffix, pre_hooks, post_hooks and the others) are described in the stpipe documentation.

class snowblind.SnowblindStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)#

Mask snowball halos by growing each large jump-detected region around a saturated core.

A snowball is a saturated core inside a halo of JUMP_DET pixels. Each contiguous region of JUMP_DET pixels, its holes filled, that holds a core and contains a disk of min_radius is dilated by growth_factor times its equal-area radius. In a ramp the core is the pixels that saturate in the region’s group or the next; in a rate image or rateints cube, which do not record when a pixel saturated, its SATURATED pixels. In a ramp the core is also dilated by ring_width pixels in every group from the hit to the end of the integration (the ring, where charge from the core leaks into its neighbors), from the group before when the core saturated during that group’s frames, and it persists after the reset: in the later integrations of the exposure the core is flagged for core_persistence_time seconds after the end of the integration of the hit, and the core grown by one pixel for neighbor_persistence_time seconds. Both default to the times measured for the detector and packaged with snowblind, or to the longest packaged ones for a detector without its own.

The cores are the SATURATED pixels of the event, so ring_width and the one-pixel growth for the neighbors are counted from the SATURATED flags. With the jwst saturation step’s default, n_pix_grow_sat=1, those include a one-pixel ring around the pixels that reached the saturation threshold, and the ring reaches ring_width + 1 pixels from them; snowblind_detector1 sets ring_width to reach 3 pixels from them whatever n_pix_grow_sat it runs with.

A hit before group 0 is read, or during its frames, has its core SATURATED already in group 0, so the core never newly saturates. In a ramp, an area SATURATED in group 0 that does not grow by the last group and whose value falls, unlike a saturated star’s, is taken as such a core (cores_saturated_in_group_0), a snowball’s or an energetic cosmic ray’s. It gets its ring from group 0 and its persistence, and counts as a core in group 1, where the jump of a hit during group 0’s frames shows, so a halo flagged there is grown. A hit before the first read leaves no jump: its halo’s charge is in every read, which a fit to the group differences does not see.

Part of an event can lie on the reference pixels or past the array border, where the jump step cannot see it. There the disk of min_radius may hang over the edge as long as its center is on a light-sensitive pixel, and the hidden part of the event is filled in before its radius is measured. An event centered on the outermost light-sensitive row or column may have its core past the edge; it needs none if it holds a disk of min_radius that does not hang over the edge.

The grown pixels are flagged with new_jump_flag (JUMP_DET by default) in the group data quality array of a ramp, or in the data quality array of a rate image or rateints cube. Replaces expand_large_events in the standard JWST pipeline jump step and can be run on the _jump product or on rate products after the fact.

Options from spec: min_radius (minimum radius in pixels of a region to treat as a large event), growth_factor (dilation scale; 0 leaves the regions undilated, a negative value erodes them), ring_width (dilation radius in pixels around the saturated cores), after_jumps (deprecated: when set, the ring is flagged in the group of the jump and this many groups after it instead of to the end of the integration), core_persistence_time and neighbor_persistence_time (seconds after the end of the integration of the hit during which the core, and the pixels next to it, are flagged in later integrations; None takes the detector’s packaged times) and new_jump_flag (DQ bit value set on the grown pixels).

process(input_data)#

Flag the dilated large jump regions and saturated-core rings in a copy of the input.

Parameters:
input_datastr or RampModel or ImageModel or CubeModel

Filename or datamodel after jump detection. A model with a groupdq array, shape (nints, ngroups, nrows, ncols), is treated as a ramp, whose cores are its newly saturated pixels and get dilated too; a model with only a dq array, shape (nrows, ncols) or (nints, nrows, ncols), is a rate image or rateints cube, whose cores are its SATURATED pixels. Reference pixels are those with REFERENCE_PIXEL in pixeldq or dq.

Returns:
RampModel or ImageModel or CubeModel

Copy of the input with new_jump_flag set in groupdq (ramps) or dq (rate products) on the grown pixels and, in a ramp, on the rings around the cores and on the cores and their neighbors in later integrations (see flag_cores_in_later_integrations), and meta.cal_step.snowblind set to "COMPLETE". For a ramp, meta.exposure.extended_emission_events (FITS keyword EXTNCRS) is set to the number of large events found per million pixels per second, replacing the value written by the jump step.