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, 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 than threshold above the local background and have a PSF full-width at half-maximum similar to the input fwhm. 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.

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 as int((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.

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. Setting sky affects only the output values of the object peak, flux, and mag values. The default is None, 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 is False, 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 to None, 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, when peakmax is set to None, all objects will be selected.

Warning

IRAFStarFinder automatically excludes objects whose peak pixel values are negative. Therefore, setting peakmax to a non-positive value would result in exclusion of all objects.

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_separationNone or float, optional

The minimum separation (in pixels) for detected objects. If None then minsep_fwhm will be used, otherwise this keyword overrides minsep_fwhm. Note that large values may result in long run times.

See also

DAOStarFinder

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' and constant=0.0.

IRAF’s starfind uses hwhmpsf, fradius, and sepmin as input parameters. The equivalent input values for IRAFStarFinder are:

  • fwhm = hwhmpsf * 2

  • sigma_radius = fradius * sqrt(2.0*log(2.0))

  • minsep_fwhm = 0.5 * sepmin

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.

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 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 local sky 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.