![]() |
MAOS
Multithreaded Adaptive Optics Simulator
|
Functions | |
void | apply_L2 (dcell **xout, const dspcell *L2, const dcell *xin, real alpha) |
void | apply_invpsd (dcell **xout, const void *extra, const dcell *xin, real alpha, int xb, int yb) |
void | apply_fractal (dcell **xout, const void *extra, const dcell *xin, real alpha, int xb, int yb) |
void | remove_mode (dcell *x, const dcell *M, const dcell *PM) |
Remove projection x = x - M * (PM * x) | |
void | applyW (dcell *xin, const dsp *W0, const dmat *W1, const real *wt) |
dcell * | calcWmcc (const dcell *A, const dcell *B, const dsp *W0, const dmat *W1, const dmat *wt) |
dsp * | nea2sp (dmat *nea, int ll, int ur, int ng) |
void | nea_chol (dmat **pout, const dmat *in, int ng) |
void | nea_inv (dmat **pout, const dmat *in, int ng, real scale) |
void | nea_mm (dmat **pout, const dmat *in, int ng) |
void | nea_check (dmat *nea, int nsa, int ng) |
void | psfr_calc (sim_t *simu, dcell *opdr, dcell *dmpsol, dcell *dmerr, dcell *dmerr_lo) |
cn2est_t * | cn2est_prepare (const parms_t *parms, const powfs_t *powfs) |
void | cn2est_isim (dcell *cn2res, recon_t *recon, const parms_t *parms, const dcell *grad, int *tomo_update) |
Reusable utilities for wavefront reconstruction and DM fitting, supporting recon.c
Apply Laplacian2 to xin and accumulates to xout.
Apply turbulence invpsd to xin in Fourier space, scaled by alpha and add to xout. do nothing if xb != yb, since we apply to diagonal only. if xb==-1, do all blocks.
Apply fractal regularization to x, scaled by alpha. do nothing if xb != yb, since we apply to diagonal only. if xb==-1, do all blocks.
Remove projection x = x - M * (PM * x)
x | The vector |
M | The mode |
PM | The mode projection matrix |
apply weighting W0/W1 with weighting wt for each block. \(xin<-(W0-W1*W1')*xin;\)
dcell * calcWmcc | ( | const dcell * | A, |
const dcell * | B, | ||
const dsp * | W0, | ||
const dmat * | W1, | ||
const dmat * | wt | ||
) |
Compute W0/W1 weighted dot product: \(A'*(W0-W1*W1')*B\)
Convert column vector nsax2 or nsax3 to sparse matrix. The third column of nea is coupling. ll: controls lower left ur: controls upper right if ng>2, treat as diagonal matrix (for raw PWFS)
Apply cholesky in a 2x2 symmetric matrix packed in [a[0,0],a[1,1],a[0,1]] as row vector. Input and output may be the same. if ng>2, treat as diagonal matrix
Apply matrix inversion in a 2x2 symmetrisa matrix packed in row vector [a[0,0],a[1,1],a[0,1]] Input and output may be the same.
Apply LL' to lower diagonal matrix packed in [a[0,0],a[1,1],a[0,1]] as row vector. Input and output may be the same. if ng>2, treat as diagonal matrix
void nea_check | ( | dmat * | nea, |
int | nsa, | ||
int | ng | ||
) |
Check the dimension of NEA and fix if possible
Compute and save PSF reconstruction telemetry. For pseudo open loop estimations, like high order loop, we add opdr to, and subtract dmpsol from the OPD. For closed loop estimations, like ahst low order or lsr, we add dmerr_lo, and dmerr to the OPD.
Prepare arrays for cn2 estimation. Multiple pairs can be used to do Cn2 Estimation. The result will be an average of them.