StarFinder#

class photutils.detection.StarFinder(threshold, kernel, min_separation=5.0, exclude_border=False, brightest=None, peakmax=None)[source]#

Bases: StarFinderBase

Detect stars in an image using a user-defined kernel.

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.

kernelndarray

A 2D array of the PSF kernel.

min_separationfloat, optional

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

exclude_borderbool, optional

Whether to exclude sources found within half the size of the convolution kernel from the image borders.

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.

Notes

If the star finder is run on an image that is a Quantity array, then threshold and peakmax must all have the same units as the image.

For the convolution step, this routine sets pixels beyond the image borders to 0.0.

The source properties are calculated 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 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.

  • roundness: object roundness.

  • pa: object position angle (degrees counter clockwise from the positive x axis).

  • max_value: the maximum pixel value in the source

  • flux: the source instrumental flux.

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

None is returned if no stars are found or no stars meet the roundness and peakmax criteria.