SourceGrouper

class photutils.psf.SourceGrouper(min_separation)[source]

Bases: object

Class to group sources into clusters based on a minimum separation distance.

The groups are formed using hierarchical agglomerative clustering with a distance criterion, calling the scipy.cluster.hierarchy.fclusterdata function.

Parameters:
min_separationfloat

The minimum distance (in pixels) such that any two sources separated by less than this distance will be placed in the same group if the min_size criteria is also met.

Methods Summary

__call__(x, y)

Group sources into clusters based on a minimum distance criteria.

Methods Documentation

__call__(x, y)[source]

Group sources into clusters based on a minimum distance criteria.

Parameters:
x, y1D float ndarray

The 1D arrays of the x and y centroid coordinates of the sources.

Returns:
result1D int ndarray

A 1D array of the groups, in the same order as the input x and y coordinates.