DAOStarFinder#

class photutils.detection.DAOStarFinder(threshold, fwhm, ratio=1.0, theta=0.0, sigma_radius=1.5, sharplo=0.2, sharphi=1.0, roundlo=-1.0, roundhi=1.0, exclude_border=False, brightest=None, peakmax=None, xycoords=None, min_separation=0.0)[source]#

Bases: StarFinderBase

Detect stars in an image using the DAOFIND (Stetson 1987) algorithm.

DAOFIND searches images for local density maxima that have a peak amplitude greater than threshold (approximately; threshold is applied to a convolved image) and have a size and shape similar to the defined 2D Gaussian kernel. The Gaussian kernel is defined by the fwhm, ratio, theta, and sigma_radius input parameters.

DAOStarFinder finds the object centroid by fitting the marginal x and y 1D distributions of the Gaussian kernel to the marginal x and y distributions of the input (unconvolved) data image.

DAOStarFinder calculates the object roundness using two methods. The roundlo and roundhi bounds are applied to both measures of roundness. The first method (roundness1; called SROUND in DAOFIND) is based on the source symmetry and is the ratio of a measure of the object’s bilateral (2-fold) to four-fold symmetry. The second roundness statistic (roundness2; called GROUND in DAOFIND) measures the ratio of the difference in the height of the best fitting Gaussian function in x minus the best fitting Gaussian function in y, divided by the average of the best fitting Gaussian functions in x and y. A circular source will have a zero roundness. A source extended in x or y will have a negative or positive roundness, respectively.

The sharpness statistic measures the ratio of the difference between the height of the central pixel and the mean of the surrounding non-bad pixels in the convolved image, to the height of the best fitting Gaussian function at that point.

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, then threshold must have the same units.

fwhmfloat

The full-width half-maximum (FWHM) of the major axis of the Gaussian kernel in units of pixels.

ratiofloat, optional

The ratio of the minor to major axis standard deviations of the Gaussian kernel. ratio must be strictly positive and less than or equal to 1.0. The default is 1.0 (i.e., a circular Gaussian kernel).

thetafloat, optional

The position angle (in degrees) of the major axis of the Gaussian kernel measured counter-clockwise from the positive x axis.

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. 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 is False, which is the mode used by DAOFIND.

brightestint, None, optional

The number of brightest objects to keep after sorting the source list by flux. If brightest is set to None, 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 a Quantity array, then peakmax must have the same units. If peakmax is set to None, then no peak pixel value filtering will be performed.

xycoordsNone or Nx2 ndarray, 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_separationfloat, optional

The minimum separation (in pixels) for detected objects. Note that large values may result in long run times.

See also

IRAFStarFinder

Notes

If the star finder is run on an image that is a Quantity array, then threshold and peakmax 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 DAOFIND are boundary='constant' and constant=0.0.

The main differences between DAOStarFinder and IRAFStarFinder are:

  • IRAFStarFinder always uses a 2D circular Gaussian kernel, while DAOStarFinder 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. The image should be background-subtracted.

mask2D bool array, optional

A boolean mask with the same shape as data, where a True value indicates the corresponding element of data is masked. Masked pixels are ignored when searching for stars.

Returns:
tableQTable or None

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.

  • sharpness: object sharpness.

  • roundness1: object roundness based on symmetry.

  • roundness2: object roundness based on marginal Gaussian fits.

  • npix: the total number of pixels in the Gaussian kernel array.

  • peak: the peak pixel value of the object.

  • flux: the object instrumental flux calculated as the sum of data values within the kernel footprint.

  • mag: the object instrumental magnitude calculated as -2.5 * log10(flux).

  • daofind_mag: the “mag” parameter returned by the DAOFIND algorithm. It is a measure of the intensity ratio of the amplitude of the best fitting Gaussian function at the object position to the detection threshold. This parameter is reported only for comparison to the IRAF DAOFIND output. It should not be interpreted as a magnitude derived from an integrated flux.