MAOS
Multithreaded Adaptive Optics Simulator
|
Functions | |
dmat * | zernike_Rnm (const dmat *locr, int ir, int im) |
dmat * | zernike (const loc_t *loc, real D, int rmin, int rmax, int flag) |
dmat * | zernike_cov_kolmogorov (int nr) |
dmat * | cov_vonkarman (const loc_t *loc, const dmat *modz, real L0) |
dmat * | cov_diagnolize (const dmat *mz, const dmat *cov) |
dmat * | KL_vonkarman (const loc_t *loc, int nmod, real L0) |
dmat * | fft_mode (const loc_t *loc, real D, real px, real py) |
Generating Zernike Rnm for radial order ir, azimuthal or im. used by loc_zernike.
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 set D to -|D| to avoid clipping points outside of D.
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.
Compute covariance matrix of zernike modes in von Karman turbulence
loc | The location grid |
modz | Zernike modes |
L0 | Outer scale |
Diagnolize the covariance matrix and transform the mode.
mod | Input mode |
cov | Covariance of modes |
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.