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, sky=None, exclude_border=False, brightest=None, peakmax=None, xycoords=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.
- fwhmfloat
The full-width half-maximum (FWHM) of the 2D circular Gaussian kernel in units of pixels.
- minsep_fwhmfloat, optional
The minimum separation for detected objects in units of
fwhm
.- 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))
].- sharplofloat, optional
The lower bound on sharpness for object detection.
- sharphifloat, optional
The upper bound on sharpness for object detection.
- roundlofloat, optional
The lower bound on roundness for object detection.
- roundhifloat, optional
The upper bound on roundness for object detection.
- skyfloat, optional
The background sky level of the image. Inputing a
sky
value will override the background sky estimate. Settingsky
affects only the output values of the objectpeak
,flux
, andmag
values. The default isNone
, which means the sky value will be estimated using the starfind method.- 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
Number of brightest objects to keep after sorting the full object list. If
brightest
is set toNone
, all objects will be selected.- peakmaxfloat, None, optional
Maximum peak pixel value in an object. Only objects whose peak pixel values are strictly smaller than
peakmax
will be selected. This may be used to exclude saturated sources. By default, whenpeakmax
is set toNone
, all objects will be selected.Warning
IRAFStarFinder
automatically excludes objects whose peak pixel values are negative. Therefore, settingpeakmax
to a non-positive value would result in exclusion of all objects.- xycoords
None
or Nx2ndarray
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.
See also
Notes
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
calculates the objects’ centroid, roundness, and sharpness using image moments.
References
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.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.sky
: the localsky
value.peak
: the peak, sky-subtracted, pixel value of the object.flux
: the object instrumental flux.mag
: the object instrumental magnitude calculated as-2.5 * log10(flux)
.
None
is returned if no stars are found.
- table