mask_snowballs

grizli.prep.mask_snowballs(visit, snowball_erode=3, snowball_dilate=18, mask_bit=1024, instruments=['NIRCAM', 'NIRISS'], max_fraction=0.3, unset4=False, snowblind_kwargs={'growth_factor': 1.5, 'min_radius': 4, 'new_jump_flag': 1024, 'unset_first': True}, **kwargs)[source]

Mask JWST IR snowballs

Parameters
visitdict

Visit definition dictionary (keys product, files at at minimum)

snowball_erodeint

First pass binary erosion on DQ=4 mask

snowball_dilateint

Subsequent binary dilation on the eroded DQ=4 mask

mask_bitint

Bit to set for identified snowballs

instrumentslist

Instruments where mask is calculated

max_fractionfloat

Maximum allowed fraction of pixels in identified snowballs. If exceeded, then turn off the mask.

unset4bool

Unset DQ=4 bit for flagged CRs

snowblind_kwargsdict

First try to use grizli.utils.jwst_snowblind_mask to flag snowballs

Returns
Updates DQ extension of files in visit['files'] and sets some
status keywords