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
- min_radiusinteger, default
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_radiusis dilated bygrowth_factortimes 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 byring_widthpixels 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 forcore_persistence_timeseconds after the end of the integration of the hit, and the core grown by one pixel forneighbor_persistence_timeseconds. 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_widthand 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 reachesring_width+ 1 pixels from them;snowblind_detector1setsring_widthto reach 3 pixels from them whatevern_pix_grow_satit 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_radiusmay 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 ofmin_radiusthat 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. Replacesexpand_large_eventsin the standard JWST pipeline jump step and can be run on the_jumpproduct 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_timeandneighbor_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) andnew_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
groupdqarray, 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 adqarray, 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 inpixeldqordq.
- Returns:
- RampModel or ImageModel or CubeModel
Copy of the input with
new_jump_flagset ingroupdq(ramps) ordq(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), andmeta.cal_step.snowblindset 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.