fit_apertures

mmtwfs.wfs.fit_apertures(pars, ref, spots)[source] [edit on github]

Scale the reference positions by the fit parameters and calculate the total distance between the matches. The parameters of the fit are:

xc, yc = center positions

scale = magnification of the grid (focus)

xcoma, ycoma = linear change in magnification as a function of x/y (coma)

‘ref’ and ‘spots’ are assumed to be dict-like and must have the keys ‘xcentroid’ and ‘ycentroid’.

Parameters
parslist-like

The fit parameters passed in as a 5 element list: (xc, yc, scale, xcoma, ycoma)

refdict-like

Dict containing xcentroid and ycentroid keys that contain the reference X and Y positions of the apertures.

spotsdict-like

Dict containing xcentroid and ycentroid keys that contain the measured X and Y positions of the apertures.

Returns
distfloat

The cumulative distance between the matched reference and measured aperture positions.