StarFinderCatalogBase#
- class photutils.detection.StarFinderCatalogBase(data, xypos, kernel, *, n_brightest=None, peak_max=None)[source]#
Bases:
objectAbstract base class for star finder catalogs.
This class provides common functionality for catalog classes that store and compute properties of detected sources. External packages may subclass it to create custom star finder catalogs.
Subclasses must implement:
x_centroidproperty – Object centroid in the x direction.y_centroidproperty – Object centroid in the y direction.apply_filtersmethod – Filter the catalog using algorithm-specific criteria.default_columnsattribute – A tuple of column names used byto_tablewhen no explicit columns are given. This should be set in the subclass__init__.
Subclasses may override:
_get_init_attributes– Return attribute names to copy during slicing. The override should include'default_columns'in the returned tuple.make_cutouts– Customize how cutout arrays are extracted.cutout_data– Customize the cutouts used for photometry (e.g., zeroing negative pixels).
- Parameters:
- data2D
ndarray The 2D image. The image should be background-subtracted.
- xyposNx2
ndarray An Nx2 array of (x, y) pixel coordinates denoting the central positions of the stars.
- kernel2D
ndarray A 2D array of the PSF kernel. Internally, the star finder classes may also pass a kernel object.
- 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.
- data2D
Attributes Summary
The cutout centroids.
The cutout data arrays.
The cutout x centroids.
The cutout y centroids.
The instrumental fluxes.
The FWHM of the sources.
Whether the instance is scalar (e.g., a single source).
The instrumental magnitudes.
The raw image moments.
The central image moments.
The difference of the central moments.
The sum of the central moments.
The angle between the
xaxis and the major axis of the 2D Gaussian function that has the same second-order moments as the source.The peak pixel values.
The roundness of the sources.
Object centroid in the x direction.
Object centroid in the y direction.
Methods Summary
Apply all filters, select the brightest, and reset the source IDs.
Filter the catalog.
make_cutouts(data)Make cutouts from the data array.
Reset the ID column to be consecutive integers.
Sort the catalog by the brightest fluxes and select the top brightest sources.
to_table(*[, columns])Create a QTable of catalog properties.
Attributes Documentation
- cutout_centroid#
The cutout centroids.
- cutout_data#
The cutout data arrays.
Subclasses may override this property to customize the cutouts used for moment-based photometry calculations (e.g., zeroing negative pixels or subtracting a local sky background).
- cutout_x_centroid#
The cutout x centroids.
- cutout_y_centroid#
The cutout y centroids.
- flux#
The instrumental fluxes.
- fwhm#
The FWHM of the sources.
- isscalar#
Whether the instance is scalar (e.g., a single source).
- mag#
The instrumental magnitudes.
- moments#
The raw image moments.
- moments_central#
The central image moments.
- mu_diff#
The difference of the central moments.
- mu_sum#
The sum of the central moments.
- orientation#
The angle between the
xaxis and the major axis of the 2D Gaussian function that has the same second-order moments as the source.The angle increases in the counter-clockwise direction and will be in the range [0, 360) degrees.
- peak#
The peak pixel values.
- roundness#
The roundness of the sources.
- x_centroid#
Object centroid in the x direction.
This property must be implemented in subclasses.
- y_centroid#
Object centroid in the y direction.
This property must be implemented in subclasses.
Methods Documentation
- abstractmethod apply_filters()[source]#
Filter the catalog.
This method must be implemented in subclasses to apply algorithm-specific filtering criteria.