webbpsf_ext.image_manip.expand_mask

webbpsf_ext.image_manip.expand_mask(bpmask, npix, grow_diagonal=False)[source]

Expand bad pixel mask by npix pixels

Parameters:
  • bpmask (2D, 3D+ array) – Boolean bad pixel mask

  • npix (int) – Number of pixels to expand mask by

  • diagonal (bool) – Expand mask by npix pixels in all directions, including diagonals

  • in_place (bool) – Modify the original mask (True) or return a copy (False)

Returns:

bpmask (2D array of booleans) – Expanded bad pixel mask