MAOS
Multithreaded Adaptive Optics Simulator
Loading...
Searching...
No Matches
cn2est.h File Reference

Data Structures

struct  cn2est_pair_t
struct  cn2est_t

Functions

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)
void cn2est_est (cn2est_t *cn2est, int verbose)
void cn2est_free (cn2est_t *cn2est)
void cn2est_push (cn2est_t *cn2est, const dcell *gradol)
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)
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

long 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 for SLODAR based Cn2 estimation.

Parameters
[in]wfspair2n*1 vector for n pair of WFS indices.
[in]wfsthetanwfs*2: angular direction of each WFS (radian).
[in]salocnsa*2: Subaperture low left corner coordinates.
[in]saansa*1: Normalized subaperture area. NULL to use all subapertures.
[in]saatThreshold, relative to the maximum of saa, for keeping subapertures.
[in]hsnwfs*1: altitude of guide star (m).
[in]htreconLayers height intended for tomography (m).
[in]keepht2: slodar directly to htrecon, otherwise: interpolate onto htrecon from native slodar heights.
[in]L0The Outer scale (m).
Returns
Newly allocated cn2est_t, or NULL if there is no WFS pair or not enough subapertures. Free with cn2est_free().

◆ cn2est_est()

void cn2est_est ( cn2est_t * cn2est,
int verbose )

Do the Cn2 Estimation from the accumulated covariance. Results are stored in cn2est->wt, r0, r0m, and wtrecon.

Parameters
[in,out]cn2estCn2 estimation data.
[in]verboseWhether to print the results.

◆ cn2est_free()

void cn2est_free ( cn2est_t * cn2est)

Free all the data.

Parameters
[in]cn2estCn2 estimation data to free. May be NULL.

◆ cn2est_push()

void cn2est_push ( cn2est_t * cn2est,
const dcell * gradol )

Accumulate the covariance of open loop gradients gradol (one per WFS) for Cn2 estimation.

Parameters
[in,out]cn2estCn2 estimation data.
[in]gradolOpen loop gradients of each WFS. Each column is a time step.

◆ 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.

Parameters
[in]wfspair2n*1 vector for n pair of WFS indices.
[in]wfsthetanwfs*2: angular direction of each WFS. Treated as arcsec and converted to radian (in a temporary copy; the input is not modified) if its maximum absolute value is above 1.
[in]salocSubaperture low left corner coordinates.
[in]saaNormalized subaperture area.
[in]saatThreshold for keeping subapertures.
[in]hsAltitude of guide star (m).
[in]htreconLayers height intended for tomography (m).
[in]keepht2: slodar directly to htrecon, otherwise: interpolate onto htrecon.
[in]l0The outer scale (m).
[in,out]gradOpen loop gradients of each WFS. Reshaped to a column if it is a row.
Returns
Newly allocated cn2est_t with the estimation result. Free with cn2est_free().

◆ cn2est_reset()

void cn2est_reset ( cn2est_t * cn2est)

Reset the accumulation

Parameters
[in,out]cn2estCn2 estimation data.