StarFinder¶
- class photutils.detection.StarFinder(threshold, kernel, min_separation=5.0, exclude_border=False, brightest=None, peakmax=None)[source]¶
Bases:
StarFinderBase
Detect stars in an image using a user-defined kernel.
- Parameters:
- thresholdfloat
The absolute image value above which to select sources.
- kernel
ndarray
A 2D array of the PSF kernel.
- min_separationfloat, optional
The minimum separation for detected objects in pixels.
- exclude_borderbool, optional
Whether to exclude sources found within half the size of the convolution kernel from the image borders.
- brightest
None
or int, optional The number of brightest objects to return in the output table. If
brightest
is set toNone
, all objects will be returned.- peakmax
None
or float, optional The maximum allowed peak pixel value in an object. Only objects whose maximum pixel values are strictly smaller than
peakmax
will be selected. This may be used to exclude saturated sources. If set toNone
, all objects will be selected.Warning
StarFinder
automatically excludes objects whose maximum pixel values are negative. Therefore, settingpeakmax
to a non-positive value would result in excluding all objects.
See also
Notes
For the convolution step, this routine sets pixels beyond the image borders to 0.0.
The source properties are calculated using image moments.
Methods Summary
__call__
(data[, mask])Call self as a function.
find_stars
(data[, mask])Find stars in an astronomical image.
Methods Documentation
- __call__(data, mask=None)¶
Call self as a function.
- find_stars(data, mask=None)[source]¶
Find stars in an astronomical image.
- Parameters:
- data2D array_like
The 2D image array.
- mask2D bool array, 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 searching for stars.
- Returns:
- table
QTable
orNone
A table of found objects with the following parameters:
id
: unique object identification number.xcentroid, ycentroid
: object centroid.fwhm
: object FWHM.roundness
: object roundness.pa
: object position angle (degrees counter clockwise from the positive x axis).max_value
: the maximum pixel value in the sourceflux
: the source instrumental flux.mag
: the source instrumental magnitude calculated as-2.5 * log10(flux)
.
None
is returned if no stars are found or no stars meet the roundness and peakmax criteria.
- table