make_source_mask¶

photutils.segmentation.
make_source_mask
(data, nsigma, npixels, mask=None, filter_fwhm=None, filter_size=3, filter_kernel=None, sigclip_sigma=3.0, sigclip_iters=5, dilate_size=11)[source]¶ Make a source mask using source segmentation and binary dilation.
 Parameters
 dataarray_like
The 2D array of the image.
 nsigmafloat
The number of standard deviations per pixel above the
background
for which to consider a pixel as possibly being part of a source. npixelsint
The number of connected pixels, each greater than
threshold
, that an object must have to be detected.npixels
must be a positive integer. maskarray_like, bool, optional
A boolean mask with the same shape as
data
, where aTrue
value indicates the corresponding element ofdata
is masked. Masked pixels are ignored when computing the image background statistics. filter_fwhmfloat, optional
The fullwidth at halfmaximum (FWHM) of the Gaussian kernel to filter the image before thresholding.
filter_fwhm
andfilter_size
are ignored iffilter_kernel
is defined. filter_sizefloat, optional
The size of the square Gaussian kernel image. Used only if
filter_fwhm
is defined.filter_fwhm
andfilter_size
are ignored iffilter_kernel
is defined. filter_kernelarraylike (2D) or
Kernel2D
, optional The 2D array of the kernel used to filter the image before thresholding. Filtering the image will smooth the noise and maximize detectability of objects with a shape similar to the kernel.
filter_kernel
overridesfilter_fwhm
andfilter_size
. sigclip_sigmafloat, optional
The number of standard deviations to use as the clipping limit when calculating the image background statistics.
 sigclip_itersint, optional
The maximum number of iterations to perform sigma clipping, or
None
to clip until convergence is achieved (i.e., continue until the last iteration clips nothing) when calculating the image background statistics. dilate_sizeint, optional
The size of the square array used to dilate the segmentation image.
 Returns
 mask2D bool
ndarray
A 2D boolean image containing the source mask.
 mask2D bool