fitzernikes: Least Squares fit to Zernike polynomials

View source: R/zernikes.r

fitzernikesR Documentation

Least Squares fit to Zernike polynomials

Description

Performs a least squares fit of a specified set of Zernike polynomials to a vector of wavefront measurements.

Usage

fitzernikes(wf, rho, theta, eps=0, phi = 0, maxorder = 14, uselm = FALSE, isoseq = FALSE)

Arguments

wf

A vector of wavefront values

rho

A vector of radial coordinates.

theta

A vector of angular coordinates, in radians.

eps

Obstruction fraction of annular aperture.

phi

Orientation of the image, in degrees

maxorder

Maximum Zernike polynomial order

uselm

Boolean: use lm() for least squares fit

isoseq

Boolean: use ISO/ANSI sequencing

Details

wf, rho, and theta must be the same length.

As of version 3.7.0 Zernike polynomials in ISO/ANSI sequence can be used through a call to zpm_cart.

Value

The model fit as returned by lm, or the coefficients of the least squares fit using qr.solve if uselm is FALSE.

Note

The model fit is of the form wf ~ Z0+Z1+Z2+.... With the standard ordering of Zernikes Z0 is the piston term, Z1 and Z2 are x and y tilts, Z3 is defocus, etc.

Author(s)

M.L. Peck mpeck1@ix.netcom.com

See Also

zpm, zpm_cart, psifit, fftfit, vortexfit, wf_net.


mlpeck/zernike documentation built on April 19, 2024, 3:16 p.m.