IRAFStarFinder#
- class photutils.detection.IRAFStarFinder(threshold, fwhm, sigma_radius=1.5, minsep_fwhm=2.5, sharplo=0.5, sharphi=2.0, roundlo=0.0, roundhi=0.2, exclude_border=False, brightest=None, peakmax=None, xycoords=None, min_separation=None)[source]#
Bases:
StarFinderBase
Detect stars in an image using IRAF’s “starfind” algorithm.
IRAFStarFinder
searches images for local density maxima that have a peak amplitude greater thanthreshold
above the local background and have a PSF full-width at half-maximum similar to the inputfwhm
. The objects’ centroid, roundness (ellipticity), and sharpness are calculated using image moments.- Parameters:
- thresholdfloat
The absolute image value above which to select sources. If the star finder is run on an image that is a
Quantity
array, thenthreshold
must have the same units.- fwhmfloat
The full-width half-maximum (FWHM) of the 2D circular Gaussian kernel in units of pixels.
- sigma_radiusfloat, optional
The truncation radius of the Gaussian kernel in units of sigma (standard deviation) [
1 sigma = FWHM / 2.0*sqrt(2.0*log(2.0))
].- minsep_fwhmfloat, optional
The separation (in units of
fwhm
) for detected objects. The minimum separation is calculated asint((fwhm * minsep_fwhm) + 0.5)
and is clipped to a minimum value of 2. Note that large values may result in long run times.- sharplofloat, optional
The lower bound on sharpness for object detection. Objects with sharpness less than
sharplo
will be rejected.- sharphifloat, optional
The upper bound on sharpness for object detection. Objects with sharpness greater than
sharphi
will be rejected.- roundlofloat, optional
The lower bound on roundness for object detection. Objects with roundness less than
roundlo
will be rejected.- roundhifloat, optional
The upper bound on roundness for object detection. Objects with roundness greater than
roundhi
will be rejected.- exclude_borderbool, optional
Set to
True
to exclude sources found within half the size of the convolution kernel from the image borders. The default isFalse
, which is the mode used by starfind.- brightestint, None, optional
The number of brightest objects to keep after sorting the source list by flux. If
brightest
is set toNone
, all objects will be selected.- peakmaxfloat, None, optional
The maximum allowed peak pixel value in an object. Objects with peak pixel values greater than
peakmax
will be rejected. This keyword may be used, for example, to exclude saturated sources. If the star finder is run on an image that is aQuantity
array, thenpeakmax
must have the same units. Ifpeakmax
is set toNone
, then no peak pixel value filtering will be performed.- xycoords
None
or Nx2ndarray
, optional The (x, y) pixel coordinates of the approximate centroid positions of identified sources. If
xycoords
are input, the algorithm will skip the source-finding step.- min_separation
None
or float, optional The minimum separation (in pixels) for detected objects. If
None
thenminsep_fwhm
will be used, otherwise this keyword overridesminsep_fwhm
. Note that large values may result in long run times.
See also
Notes
If the star finder is run on an image that is a
Quantity
array, thenthreshold
andpeakmax
must have the same units as the image.For the convolution step, this routine sets pixels beyond the image borders to 0.0. The equivalent parameters in IRAF’s starfind are
boundary='constant'
andconstant=0.0
.IRAF’s starfind uses
hwhmpsf
,fradius
, andsepmin
as input parameters. The equivalent input values forIRAFStarFinder
are:fwhm = hwhmpsf * 2
sigma_radius = fradius * sqrt(2.0*log(2.0))
minsep_fwhm = 0.5 * sepmin
The main differences between
DAOStarFinder
andIRAFStarFinder
are:IRAFStarFinder
always uses a 2D circular Gaussian kernel, whileDAOStarFinder
can use an elliptical Gaussian kernel.IRAFStarFinder
internally calculates a “sky” background level based on unmasked pixels within the kernel footprint.IRAFStarFinder
calculates the objects’ centroid, roundness, and sharpness 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. The image should be background-subtracted.
- 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 stars.
None
is returned if no stars are found. The table contains the following parameters:id
: unique object identification number.xcentroid, ycentroid
: object centroid.fwhm
: object FWHM.sharpness
: object sharpness.roundness
: object roundness.pa
: object position angle (degrees counter clockwise from the positive x axis).npix
: the total number of (positive) unmasked pixels.peak
: the peak, sky-subtracted, pixel value of the object.flux
: the object instrumental flux calculated as the sum of sky-subtracted data values within the kernel footprint.mag
: the object instrumental magnitude calculated as-2.5 * log10(flux)
.
- table