sep.extract¶
-
sep.
extract
(data, thresh, err=None, mask=None, minarea=5, filter_kernel=default_kernel, filter_type='matched', deblend_nthresh=32, deblend_cont=0.005, clean=True, clean_param=1.0, segmentation_map=False)¶ Extract sources from an image.
Parameters: - data :
ndarray
Data array (2-d).
- thresh : float
Threshold pixel value for detection. If an
err
orvar
array is not given, this is interpreted as an absolute threshold. Iferr
orvar
is given, this is interpreted as a relative threshold: the absolute threshold at pixel (j, i) will bethresh * err[j, i]
orthresh * sqrt(var[j, i])
.- err, var : float or
ndarray
, optional Error or variance (specify at most one). This can be used to specify a pixel-by-pixel detection threshold; see “thresh” argument.
- gain : float, optional
Conversion factor between data array units and poisson counts. This does not affect detection; it is used only in calculating Poisson noise contribution to uncertainty parameters such as
errx2
. If not given, no Poisson noise will be added.- mask :
ndarray
, optional Mask array.
True
values, or numeric values greater thanmaskthresh
, are considered masked. Masking a pixel is equivalent to setting data to zero and noise (if present) to infinity.- maskthresh : float, optional
Threshold for a pixel to be masked. Default is
0.0
.- minarea : int, optional
Minimum number of pixels required for an object. Default is 5.
- filter_kernel :
ndarray
or None, optional Filter kernel used for on-the-fly filtering (used to enhance detection). Default is a 3x3 array: [[1,2,1], [2,4,2], [1,2,1]]. Set to
None
to skip convolution.- filter_type : {‘matched’, ‘conv’}, optional
Filter treatment. This affects filtering behavior when a noise array is supplied.
'matched'
(default) accounts for pixel-to-pixel noise in the filter kernel.'conv'
is simple convolution of the data array, ignoring pixel-to-pixel noise across the kernel.'matched'
should yield better detection of faint sources in areas of rapidly varying noise (such as found in coadded images made from semi-overlapping exposures). The two options are equivalent when noise is constant.- deblend_nthresh : int, optional
Number of thresholds used for object deblending. Default is 32.
- deblend_cont : float, optional
Minimum contrast ratio used for object deblending. Default is 0.005. To entirely disable deblending, set to 1.0.
- clean : bool, optional
Perform cleaning? Default is True.
- clean_param : float, optional
Cleaning parameter (see SExtractor manual). Default is 1.0.
- segmentation_map : bool, optional
If True, also return a “segmentation map” giving the member pixels of each object. Default is False.
Returns: - objects :
ndarray
Extracted object parameters (structured array). Available fields are:
thresh
(float) Threshold at object location.npix
(int) Number of pixels belonging to the object.tnpix
(int) Number of pixels above threshold (unconvolved data).xmin
,xmax
(int) Minimum, maximum x coordinates of pixels.ymin
,ymax
(int) Minimum, maximum y coordinates of pixels.x
,y
(float) object barycenter (first moments).x2
,y2
,xy
(float) Second moments.errx2
,erry2
,errxy
(float) Second moment errors. Note that these will be zero if error is not given.a
,b
,theta
(float) Ellipse parameters, scaled as described by Section 8.4.2 in “The Source Extractor Guide” or Section 10.1.5-6 of v2.13 of SExtractor’s User Manual.cxx
,cyy
,cxy
(float) Alternative ellipse parameters.cflux
(float) Sum of member pixels in convolved data.flux
(float) Sum of member pixels in unconvolved data.cpeak
(float) Peak value in convolved data.peak
(float) Peak value in unconvolved data.xcpeak
,ycpeak
(int) Coordinate of convolved peak pixel.xpeak
,ypeak
(int) Coordinate of unconvolved peak pixel.flag
(int) Extraction flags.
- segmap :
ndarray
, optional Array of integers with same shape as data. Pixels not belonging to any object have value 0. All pixels belonging to the
i
-th object (e.g.,objects[i]
) have valuei+1
. Only returned ifsegmentation_map=True
.
- data :