cwitools.extraction.reg2mask

cwitools.extraction.reg2mask(fits_in, reg)

Convert a DS9 region file into a 2D binary mask of sources.

Return type (HDU or HDUList) will match input type. Mask is always 2D.

Parameters:
  • fits_in (HDU or HDUList) – HDU or HDUList with 2D/3D data.
  • reg (string) – The path to the DS9 region file
Returns:

A 2D mask with source regions labelled sequentially.

Return type:

HDU/HDUList