IRAFStarFinder#
- class photutils.detection.IRAFStarFinder(threshold, fwhm, sigma_radius=1.5, minsep_fwhm=<deprecated>, sharplo=<deprecated>, sharphi=<deprecated>, roundlo=<deprecated>, roundhi=<deprecated>, exclude_border=False, n_brightest=None, peak_max=None, xycoords=None, min_separation=None, *, sharpness_range=(0.5, 2.0), roundness_range=(0.0, 0.2))[source]#
Bases:
StarFinderBaseDetect stars in an image using IRAF’s “starfind” algorithm.
IRAFStarFindersearches images for local density maxima that have a peak amplitude greater thanthresholdabove 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 or 2D
ndarray The absolute image value above which to select sources. If
thresholdis a 2D array, it must have the same shape as the inputdata. If the star finder is run on an image that is aQuantityarray, thenthresholdmust 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) (\(\sigma = \mbox{FWHM} / (2 \sqrt{2 \log(2)})\)).
- 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.Deprecated since version 3.0: Use
min_separationinstead.- sharplofloat, optional
The lower bound on sharpness for object detection.
Deprecated since version 3.0: Use
sharpness_range=(lower, upper)instead.- sharphifloat, optional
The upper bound on sharpness for object detection.
Deprecated since version 3.0: Use
sharpness_range=(lower, upper)instead.- roundlofloat, optional
The lower bound on roundness for object detection.
Deprecated since version 3.0: Use
roundness_range=(lower, upper)instead.- roundhifloat, optional
The upper bound on roundness for object detection.
Deprecated since version 3.0: Use
roundness_range=(lower, upper)instead.- exclude_borderbool, optional
Set to
Trueto 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.- n_brightestint, None, optional
The number of brightest objects to keep after sorting the source list by flux. If
n_brightestis set toNone, all objects will be selected.- peak_maxfloat, None, optional
The maximum allowed peak pixel value in an object. Objects with peak pixel values greater than
peak_maxwill be rejected. This keyword may be used, for example, to exclude saturated sources. If the star finder is run on an image that is aQuantityarray, thenpeak_maxmust have the same units. Ifpeak_maxis set toNone, then no peak pixel value filtering will be performed.- xycoords
Noneor Nx2ndarray, optional The (x, y) pixel coordinates of the approximate centroid positions of identified sources. If
xycoordsare input, the algorithm will skip the source-finding step.- min_separation
Noneor float, optional The minimum separation (in pixels) for detected objects. If
None(default) then the minimum separation is calculated as2.5 * fwhm. Note that large values may result in long run times.Changed in version 3.0: The default
min_separationchanged frommax(2, int(fwhm * 2.5 + 0.5))to2.5 * fwhm. To recover the previous behavior, setmin_separation=max(2, int(fwhm * 2.5 + 0.5)).- sharpness_rangetuple of 2 floats or
None, optional The
(lower, upper)inclusive bounds on sharpness for object detection. Objects with sharpness outside this range will be rejected. IfNone, no sharpness filtering is performed. The default is(0.5, 2.0).- roundness_rangetuple of 2 floats or
None, optional The
(lower, upper)inclusive bounds on roundness for object detection. Objects with roundness outside this range will be rejected. IfNone, no roundness filtering is performed. The default is(0.0, 0.2).
- thresholdfloat or 2D
See also
Notes
If the star finder is run on an image that is a
Quantityarray, thenthresholdandpeak_maxmust 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, andsepminas input parameters. The equivalent input values forIRAFStarFinderare:fwhm = hwhmpsf * 2sigma_radius = fradius * sqrt(2.0 * log(2.0))min_separation = max(2, int((fwhm * sepmin) + 0.5))
The main differences between
DAOStarFinderandIRAFStarFinderare:IRAFStarFinderalways uses a 2D circular Gaussian kernel, whileDAOStarFindercan use an elliptical Gaussian kernel.IRAFStarFinderinternally calculates a “sky” background level based on unmasked pixels within the kernel footprint.IRAFStarFindercalculates the objects’ centroid, roundness, and sharpness using image moments.
Methods Summary
__call__(data[, mask])Find stars in an astronomical image.
find_stars(data[, mask])Find stars in an astronomical image.
Methods Documentation
- __call__(data, mask=None)#
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 aTruevalue indicates the corresponding element ofdatais masked. Masked pixels are ignored when searching for stars.
- Returns:
- 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 aTruevalue indicates the corresponding element ofdatais masked. Masked pixels are ignored when searching for stars.
- Returns:
- table
QTableorNone A table of found stars.
Noneis returned if no stars are found. The table contains the following parameters:id: unique object identification number.x_centroid, y_centroid: object centroid.fwhm: object FWHM.sharpness: object sharpness.roundness: object roundness.orientation: the angle between thexaxis and the major axis source measured counter-clockwise in the range [0, 360) degrees.n_pixels: 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