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, **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

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