center_pupil

mmtwfs.wfs.center_pupil(input_data, pup_mask, threshold=0.8, sigma=10.0, plot=True)[source] [edit on github]

Find the center of the pupil in a WFS image using skimage.feature.match_template(). This generates a correlation image and we centroid the peak of the correlation to determine the center.

Parameters
datastr or 2D ndarray

WFS image to analyze, either FITS file or ndarray image data

pup_maskstr or 2D ndarray

Pupil model to use in the template matching

thresholdfloat (default: 0.0)

Sets image to 0 where it’s below threshold * image.max()

sigmafloat (default: 20.)

Sigma of gaussian smoothing kernel

plotbool

Toggle plotting of the correlation image

Returns
centuple (float, float)

X and Y pixel coordinates of the pupil center