DonutDetector

class lsst.ts.wep.DonutDetector

Bases: object

Class to detect donuts directly from an out of focus image by convolution with a template image.

Methods Summary

detectDonuts(expArray, template, blendRadius)

Detect and categorize donut sources as blended/unblended

identifyBlendedDonuts(donutDf, blendRadius)

Label donuts as blended/unblended if the centroids are within the blendRadius number of pixels.

Methods Documentation

detectDonuts(expArray, template, blendRadius, peakThreshold=0.95, dbscanEps=5, binaryChoice='centroid')

Detect and categorize donut sources as blended/unblended

Parameters:
expArray: numpy.ndarray

The input image data.

template: numpy.ndarray

Donut template appropriate for the image.

blendRadius: float

Minimum distance in pixels two donut centers need to be apart in order to be tagged as unblended.

peakThreshold: float, optional

This value is a specifies a number between 0 and 1 that is the fraction of the highest pixel value in the convolved image. The code then sets all pixels with a value below this to 0 before running the K-means algorithm to find peaks that represent possible donut locations. (The default is 0.95)

dbscanEps: float, optional

Maximum distance scikit-learn DBSCAN algorithm allows “between two samples for one to considered in the neighborhood of the other”. (The default is 5.0)

binaryChoice: str, optional

Indicates choice of how to arrive at the binary image passed to centroidFinder. Select ‘centroid’ to use getImgBinary method from centroidFinder, use ‘deblend’ for adaptative image thresholding, use ‘exposure’ to pass an unchanged copy of the exposure array. (The default is ‘centroid’)

Returns:
pandas.DataFrame

Dataframe identifying donut positions and if they are blended with other donuts. If blended also identfies which donuts are blended with which.

Raises:
ValueError

binaryChoice is not supported.

identifyBlendedDonuts(donutDf, blendRadius)

Label donuts as blended/unblended if the centroids are within the blendRadius number of pixels.

Parameters:
donutDf: pandas.DataFrame

Dataframe identifying donut positions with labels ‘x_center’ and ‘y_center’.

blendRadius: float

Minimum distance in pixels two donut centers need to be apart in order to be tagged as unblended.

Returns:
pandas.DataFrame

Dataframe identifying donut positions and if they are blended with other donuts. If blended also identfies which donuts are blended with which.