MAOS
Multithreaded Adaptive Optics Simulator
cn2est.h File Reference

Data Structures

struct  cn2est_pair_t
 
struct  cn2est_t
 

Functions

cn2est_tcn2est_new (const dmat *wfspair, const dmat *wfstheta, const loc_t *saloc, const dmat *saa, const real saat, const dmat *hs, const dmat *htrecon, int keepht, real l0)
 
void cn2est_est (cn2est_t *cn2est, int verbose)
 
void cn2est_free (cn2est_t *cn2est)
 
void cn2est_push (cn2est_t *cn2est, const dcell *gradol)
 
cn2est_tcn2est_all (const dmat *wfspair, dmat *wfstheta, const loc_t *saloc, const dmat *saa, const real saat, const dmat *hs, const dmat *htrecon, int keepht, real l0, dcell *grad)
 
void cn2est_reset (cn2est_t *cn2est)
 

Data Structure Documentation

◆ cn2est_pair_t

struct cn2est_pair_t

contains the data related to Cn2 Estimation for each WFS pair.

+ Collaboration diagram for cn2est_pair_t:
Data Fields
int xstep

separation step of subapertures along x

int ystep

separation step of subapertures along y*.

int iht0

starting iht, may be negative or 0, for minimum height

int iht1

ending iht (exclusive), for maximum height

int nht

iht1-iht0+1

int nsep

number of subaperture separations to use. equal to nhs usually

int wfs0

first wfs in this pair

int wfs1

second wfs in this pair

◆ cn2est_t

struct cn2est_t

contains the data related to Cn2 Estimation.

+ Collaboration diagram for cn2est_t:
Data Fields
struct cn2est_pair_t * pair

information about each pair

int * wfscov

Whether this wfs participates in covariance computation.

long nembed

size of array to embed the LGS gradients into

lmat * embed

pointers to embed

lmat * mask

select subapertures that are both full and have neighbors to compute covariance

dmat * overlapi

1./Number of overlapping subapertures for each separation

int nsa

Number of subapertures

int nwfs

number of wfs

int nwfspair

number of wfs pairs to use for cn2 estimation

int ovs

Over sampling ratio in building the influence matrix

dcell * Pnk

Cn2 Estimation forward matrix

dcell * iPnk

Cn2 Estimation matrix.

dcell * ht

Estimated Height of the layers

real hmax

maximum cn2 estimation when keepht!=2

dmat * htrecon

layer heights for tomography

dmat * os

over sampling factor of the layers in htrecon

dmat * dx

sampling of each layer in reconstruction.

dmat * dmht

For theta_2 printing

dspcell * wtconvert

to convert wt from wt to wtrecon.

real L0

outer scale

dcell * gxs

gradient x

dcell * gys

gradient y

ccell * curi

For FFT

dcell * cov2

Covariance in 2d

dcell * cov1

Cut of cov2 along wfs separation

dcell * wt

Estimated weighting of the layers

ccell * covc

Accumulation of FFT of Covariance in 2d

int count

number of time steps we have accumulated the covariance

dmat * r0

Estimated r0

real r0m

averaged r0 from all the pairs.>

dcell * wtrecon

layer weights for tomography

Function Documentation

◆ cn2est_new()

cn2est_t* cn2est_new ( const dmat wfspair,
const dmat wfstheta,
const loc_t saloc,
const dmat saa,
const real  saat,
const dmat hs,
const dmat htrecon,
int  keepht,
real  L0 
)

Initialize cn2est_t

Parameters
wfspair2n*1 vector for n pair of WFS indices.
wfsthetanwfs*2: angular direction of each WFS.
salocnsa*2: Subaperture low left corner coordinates
saansa*1: Normalized subaperture area
saatThreshold for keeping subapertures
hsnwfs*1: altitude of guide star
htreconLayers height intended for tomography
keepht2: slodar directly to htrecon, otherwise: interpolate onto htrecon from native slodar heights
L0The Outer scale

◆ cn2est_est()

void cn2est_est ( cn2est_t cn2est,
int  verbose 
)

Do the Cn2 Estimation.

◆ cn2est_free()

void cn2est_free ( cn2est_t cn2est)

Free all the data.

◆ cn2est_push()

void cn2est_push ( cn2est_t cn2est,
const dcell gradol 
)

Accumulate the coveriance.

◆ cn2est_all()

cn2est_t* cn2est_all ( const dmat wfspair,
dmat wfstheta,
const loc_t saloc,
const dmat saa,
const real  saat,
const dmat hs,
const dmat htrecon,
int  keepht,
real  l0,
dcell grad 
)

One stop wrapper for cn2est_new, cn2est_push, and cn2est_est.

◆ cn2est_reset()

void cn2est_reset ( cn2est_t cn2est)

Reset the accumulation