MAOS
Multithreaded Adaptive Optics Simulator
zernike.h File Reference

Functions

dmatzernike_Rnm (const dmat *locr, int ir, int im)
 
dmatzernike (const loc_t *loc, real D, int rstart, int rend, int flag)
 
dmatzernike_cov_kolmogorov (int nr)
 
dmatcov_vonkarman (const loc_t *loc, const dmat *modz, real L0)
 
dmatcov_diagnolize (const dmat *mz, const dmat *cov)
 
dmatKL_vonkarman (const loc_t *loc, int nmod, real L0)
 
dmatfft_mode (const loc_t *loc, real D, real px, real py)
 

Function Documentation

◆ zernike_Rnm()

dmat* zernike_Rnm ( const dmat locr,
int  ir,
int  im 
)

Generating Zernike Rnm for radial order ir, azimuthal or im. used by loc_zernike.

◆ zernike()

dmat* zernike ( const loc_t loc,
real  D,
int  rmin,
int  rmax,
int  flag 
)

Create Zernike modes on loc with diameter D and radial order from rmin to rmax r=0 is piston r=1 is tip/tilt r=2 is quadratic modes if nopiston is set, skip piston mode. if flag is >0, only radial mode is used. if flag is 0, all modes between rmin and rmax. if flag is <0, only generate mode -flag. rmin and rmax is irrelevant

◆ zernike_cov_kolmogorov()

dmat* zernike_cov_kolmogorov ( int  nr)

Covariance of zernike modes in Kolmogorov Turbulence. Only modes with the same m have non-zero covariance.

Based on Eq 3.14 in Adaptive Optics in Astronomy (Roddier 1999). Verified against values in J.Y.Wang 1978, table II(a,b).

Notice that (D/r0)^(5/3) has been factored out.

2015-06-05: This is not longer being used. It is inaccurate for annular pupil. Analytic calculation using the power spectrum is used instead.

◆ cov_vonkarman()

dmat* cov_vonkarman ( const loc_t loc,
const dmat modz,
real  L0 
)

Compute covariance matrix of zernike modes in von Karman turbulence

Parameters
locThe location grid
modzZernike modes
L0Outer scale

◆ cov_diagnolize()

dmat* cov_diagnolize ( const dmat mod,
const dmat cov 
)

Diagnolize the covariance matrix and transform the mode.

Parameters
modInput mode
covCovariance of modes

◆ KL_vonkarman()

dmat* KL_vonkarman ( const loc_t loc,
int  nmod,
real  L0 
)

Create Karhunen-Loeve modes for which each mode is statistically independent in von Karman spectrum.

The original method is to compute covariance of zernike modes in von Karman spectrum and diagnolize the covariance matrix. But this methods suffers for higher order systems because high order zernike modes are hard to generate on account of limited resolution of real precision floating point numbers. To make matters worse, to generate m KL modes, around 2*m Zernike modes are needed because each KL mode is a linear combination of all Zernike modes with same azimuthal (m) but higher radial (r) order. A work around of the precisiosn issue is to limit the absolute value of the zernike modes to within 100 to avoid excessive norm due to round off errors.

The new method is to use zonal modes (identity matrix). The advantage is that the zonal modes spans the whole range of possible modes and are straightforward to generate.

In theory, the KL modes computes should be independent on the starting mode, as long as the modes span the whole vector space for the coordinate.

◆ fft_mode()

dmat* fft_mode ( const loc_t loc,
real  D,
real  px,
real  py 
)

Generate FFT mode with period.