MAOS
Multithreaded Adaptive Optics Simulator
recon_setup.c File Reference

Functions

void setup_recon_saneai (recon_t *recon, const parms_t *parms, const powfs_t *powfs)
 
void setup_recon_tomo_prep (recon_t *recon, const parms_t *parms)
 
void setup_recon_tomo_matrix (recon_t *recon, const parms_t *parms)
 
void setup_recon_update_cn2 (recon_t *recon, const parms_t *parms)
 
void setup_recon_mvst (recon_t *recon, const parms_t *parms)
 
void setup_recon_tomo (recon_t *recon, const parms_t *parms, powfs_t *powfs)
 
void setup_recon_control (recon_t *recon, const parms_t *parms, powfs_t *powfs)
 
void setup_recon_psd (recon_t *recon, const parms_t *parms)
 
void setup_recon_post (recon_t *recon, const parms_t *parms, const aper_t *aper)
 
void free_recon_unused (const parms_t *parms, recon_t *recon)
 
void free_recon (const parms_t *parms, recon_t *recon)
 

Detailed Description

Contains routines that setup the wavefront reconstructor and DM fitting.

Function Documentation

◆ setup_recon_saneai()

void setup_recon_saneai ( recon_t recon,
const parms_t parms,
const powfs_t powfs 
)

Setup the matrix of the inverse of gradient measurement noise equivalent angle covariance matrix. For physical optics wfs, the NEA is computed using matched filter output. For geometric optics, the NEA is from input.

◆ setup_recon_tomo_prep()

void setup_recon_tomo_prep ( recon_t recon,
const parms_t parms 
)

Prepares for tomography. ALlow it to be called multiple times for Cn2 update.

◆ setup_recon_tomo_matrix()

void setup_recon_tomo_matrix ( recon_t recon,
const parms_t parms 
)

assemble tomography matrix. In CG mode, this function is not executed if tomo.assemble=0, Instead, the algorithm is contained in recon.c. When you modify anything, make sure you also do it there.

For integrated tomograhy:

\(\hat{x}=(G_{lgs}^{T}C_{lgs}^{-1}G_{lgs}+C_{x}^{-1}+G_{ngs}^{T}C_{ngs}^{-1} G_{ngs})^{-1}(G_{lgs}^{T}C_{lgs}^{-1}s_{lgs}+G_{ngs}^{T}C_{ngs}^{-1}s_{ngs}){\equiv}RL^{-1}RR s.\)

For split tomography, the terms regarding NGS are dropped:

\(\hat{x}_{lgs}=(G_{lgs}^{T}C_{lgs}^{-1}G_{lgs}+C_{x}^{-1})^{-1} G_{lgs}^{T}C_{lgs}^{-1}s_{lgs}\equiv R_L^{-1} R_R s.\)

The left hand side of linear equation (inside the inverse) is stored in RL. The right hand side of the linear equation (outside of the inverse) is stored in RR. The terms regarding the NGS are handled using low rank terms. The gradients from LGS and NGS and concatenated to \(s\).

In the LGS part, there is a global tip/tilt removal operator because LGS is insensitive to global tip/tilts.

For details see www.opticsinfobase.org/abstract.cfm?URI=josaa-19-9-1803

◆ setup_recon_update_cn2()

void setup_recon_update_cn2 ( recon_t recon,
const parms_t parms 
)

Update assembled tomography matrix with new L2. Called from cn2est when new profiles are available.

◆ setup_recon_mvst()

void setup_recon_mvst ( recon_t recon,
const parms_t parms 
)

compute the MVST split tomography NGS mode reconstructor.

2010-03-16: New Implementation.

Definition:

  • \(G_{lgs}\) is LGS gradient operator from xloc, contained in recon->GXtomo as dspcell
  • \(G_{ngs}\) is NGS gradient operator from xloc, contained in recon->GXL as dense matrix
  • \(C_{lgs}, C_{ngs}\) is the LGS, and NGS measurement noise covariance matrix.
  • \(\hat{x}_{lgs}\) is LGS tomography output
  • \(\hat{x}_{ngs}\) is NGS minimum variance split tomography output
  • \(a_{ngs}\) is NGS minimum variance DM output.
  • \(F\) is the fitting operator
  • \(H_A\) is the ray tracing operator from aloc to ploc, contained in recon->HA.
  • \(MVModes\) is the MVST NGS modes
  • \(MVRngs\) is the MVST NGS reconstructor

We have

\begin{eqnarray*} \hat{x}_{lgs}&=&A^{-1}G^{T}_{lgs}C_{lgs}^{-1}s_{lgs}\\ Uw&=&A^{-1}G_{ngs}^TC_{ngs}^{-1}\\ \hat{x}_{ngs}&=&Uw(1+G_{ngs}Uw)^{-1}(s_{ngs}-G_{ngs}\hat{x}_{lgs});\\ a_{NGS}&=&F\hat{x}_{ngs}\\ MVModes&=&F\cdot Uw\\ MVRngs&=&(1+G_{ngs}Uw)^{-1} \end{eqnarray*}

If we want to orthnormalize the NGS modes. Propagate the NGS modes \(F\cdot Uw\) to fitting directions and compute the cross-coupling matrix with weighting on \(W_0, W_1\), we have

\begin{eqnarray*} Q&=&H_A\cdot F \cdot Uw\\ M_{CC}&=&Q^T(W_0-W_1 W_1^T)Q\\ \end{eqnarray*}

Do SVD on \(MCC\) we have \(M_{CC}=u\Sigma v^T \) where \(u{\equiv}v\) because \(MCC\) is symmetric. Redefine the NGS modes and reconstructor as

\begin{eqnarray*} MVModes&=&F\cdot Uw\cdot u \Sigma^{-1/2}\\ MVRngs&=&\Sigma^{1/2}u^T (1+G_{ngs}A^{-1}G_{ngs}^T C_{ngs}^{-1})^{-1} \end{eqnarray*}

◆ setup_recon_tomo()

void setup_recon_tomo ( recon_t recon,
const parms_t parms,
powfs_t powfs 
)

Sets up the tomogrpahy turbulence reconstruction structs including wavefront reconstructor and DM fitting operator

Calls setup_recon_tomo_matrix() and setup_recon_fit_matrix() to setup the tomography and DM fitting matrix.

AHST is handled in setup_ngsmod().

MVST is handled in setup_recon_mvst().

MOAO is handled in setup_recon_moao().

◆ setup_recon_control()

void setup_recon_control ( recon_t recon,
const parms_t parms,
powfs_t powfs 
)

Setup either the control matrix using either minimum variance reconstructor by calling setup_recon_mvr() or least square reconstructor by calling setup_recon_lsr() It can be called repeatedly to update the reconstructor when NEA updates.

The results are measurement noise dependent and may be updated during simulation.

◆ setup_recon_psd()

void setup_recon_psd ( recon_t recon,
const parms_t parms 
)

PSD computation for gain update

◆ setup_recon_post()

void setup_recon_post ( recon_t recon,
const parms_t parms,
const aper_t aper 
)

A few further operations that needs MVM.

◆ free_recon_unused()

void free_recon_unused ( const parms_t parms,
recon_t recon 
)

Free unused object in recon struct after preparation is done.

◆ free_recon()

void free_recon ( const parms_t parms,
recon_t recon 
)

Free the recon struct.