# ImageUtils¶

This module contains several utility function that operate on the image.

maskstarSEG “cleans” the image of stars and other objects that emit light if they do not occlude the segmentation map.

maskstarPSF uses the star catalogue and information on the PSF in the FITS image header if both are available in order to mask out stars using the PSF. maskSstarPSF is experimental and has not been fully developed. The method first tries to read in information on the PSF and other viewing parameters. These values are used to calculate the sky’s magnitude. It then uses the objects that occlude the segmentation map as calculated by ObjectMasker module, and calculates the radius of that object based upon its psfMAG_r. The algorithm then masks that object out to its radius $$\times$$ {numsig}, where numsig is the number factor tha allows the user some control of this process. If the adaptive option is enabled then the algorithm calculates the radius based upon following a line of flux from the centre of the object in the opposite direction of the object of interests centre, and checking for a discontinuity in the flux. It then extends the masking out until there is no discontinuity in the flux.

pawlikMorphLSST.imageutils.maskstarsSEG(image: numpy.ndarray) → numpy.ndarray
‘Cleans’ image of external sources.

For example will remove all stars that do not interfere with the object of interest.

Parameters

image (np.ndarray) – Image to be cleaned.

Returns

imageClean – Image cleaned of external sources.

Return type

np.ndarray

pawlikMorphLSST.imageutils.maskstarsPSF(image: numpy.ndarray, objs: List, header, skyCount: float, numSigmas=5.0, adaptive=True, sky_err=0.0) → numpy.ndarray

Parameters
• image (np.ndarray) – Image that is to be masked of nuisance stars.

• objs (List[float, float, str, float]) – List of objects. [RA, DEC, type, psfMag_r]