StarFinder#
- class photutils.detection.StarFinder(threshold, kernel, min_separation=None, exclude_border=False, n_brightest=None, peak_max=None)[source]#
Bases:
StarFinderBaseDetect stars in an image using a user-defined kernel.
- 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.- kernel
ndarray A 2D array of the PSF kernel.
- min_separation
Noneor float, optional The minimum separation (in pixels) for detected objects. If
None(default) then the minimum separation is set to2.5 * (min(kernel.shape) // 2). Note that large values may result in long run times.Changed in version 3.0: The default
min_separationchanged from 5 to2.5 * (min(kernel.shape) // 2). To recover the previous behavior, setmin_separation=5.- exclude_borderbool, optional
Whether to exclude sources found within half the size of the convolution kernel from the image borders.
- 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.
- thresholdfloat or 2D
See also
Notes
If the star finder is run on an image that is a
Quantityarray, thenthresholdandpeak_maxmust 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])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 objects with the following parameters:
id: unique object identification number.x_centroid, y_centroid: object centroid.fwhm: object FWHM.roundness: object roundness.orientation: the angle between thexaxis and the major axis source measured counter-clockwise in the range [0, 360) degrees.max_value: the maximum pixel value in the sourceflux: the source instrumental flux.mag: the source instrumental magnitude calculated as-2.5 * log10(flux).
Noneis returned if no stars are found or no stars meet the peak_max criteria.
- table