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

Functions

void gradoff_acc (sim_t *simu, int ipowfs)
void dither_position (real *cs, real *ss, int alfsm, int dtrat, int npoint, int isim, real deltam)
 Calculate expected averaged position of dithering signal during WFS integration. Called when (isim+1)dtrat=0 This function calculates the dither position based on the given parameters.
real dither_amp_calc (dmat **res, const dmat *signal, long dtrat, long npoint, int detrend, int combine)
void dither_acc_i0 (const parms_t *parms, dither_t *pd, dcell *ints, int iwfs, int isim)
void dither_acc (sim_t *simu, int iwfs)
void dither_post (sim_t *simu)
void sodium_fit_wrap (dmat **psodium, dcell **pgrad, dcell **pi0, dcell **pgx, dcell **pgy, const dcell *i0in, const parms_t *parms, powfs_t *powfs, int ipowfs, real r0, real L0, int nrep, int use_cache)
void sodium_fit (dmat **sodium, dcell **pgrad, dcell **pi0, dcell **pgx, dcell **pgy, const dcell *i0i, const dccell *sepsf, const dtf_t *dtf, const loc_t *saloc, const dcell *saa, const dcell *srsa, const dcell *srot, const dmat *siglev, const dmat *wvlwts, const dcell *gradoff, real dh, real hs, real htel, real za, real svdthres, int nrep, int save, int use_cache)

Detailed Description

Contains utility routines to dithering or sodium profile fitting to update LGS WFS gain.

Function Documentation

◆ dither_position()

void dither_position ( real * cs,
real * ss,
int alfsm,
int dtrat,
int npoint,
int isim,
real deltam )

Calculate expected averaged position of dithering signal during WFS integration. Called when (isim+1)dtrat=0 This function calculates the dither position based on the given parameters.

Parameters
csThe cosine of the dither angle.
ssThe sine of the dither angle.
alfsmThe additional latency due to uplink.
dtratThe dither rate.
npointThe number of points.
isimThe simulation index.
deltamThe dither delta.

◆ dither_amp_calc()

real dither_amp_calc ( dmat ** res,
const dmat * signal,
long dtrat,
long npoint,
int detrend,
int combine )

Demodulate the dithering signal to determine the amplitude. Remove trend (detrending) if detrend is set.

Parameters
resThe result matrix. nmod*1 if not combine.
signalThe signal matrix. nmod*nsim *
dtratskip columns due to wfs/sim dt ratio
npointThe number of points during dithering
detrendWhether to detrend the signal.
combineWhether to combine the results. for tip/tilt only
Returns
The calculated dither amplitude.

◆ dither_acc()

void dither_acc ( sim_t * simu,
int iwfs )

Accumulate dithering parameters

  • Every step: accumulate signal for phase detection.
  • At PLL output: determine input/output amplitude of dithering signal.
  • At Gain output:determine matched filter i0, gx, gy, or CoG gain.
  • Subtract t/t from gradients for non-comon-path (TT) dithering.

◆ dither_post()

void dither_post ( sim_t * simu)

Dither update: zoom corrector, matched filter, gain ajustment, TWFS.

◆ sodium_fit_wrap()

void sodium_fit_wrap ( dmat ** psodium,
dcell ** pgrad,
dcell ** pi0,
dcell ** pgx,
dcell ** pgy,
const dcell * i0in,
const parms_t * parms,
powfs_t * powfs,
int ipowfs,
real r0,
real L0,
int nrep,
int use_cache )

Fit i0 to sodium profile and replace i0, gx, gy with derived parameters

Parameters
[out]psodiumsodium profile
[out]pgradestimated actual gradient
[out]pi0The output i0
[out]pgxThe output gx
[out]pgyThe output gy
[in]i0inThe input sa intensities. may equal to *pi0
[in]parmsparms
[in]powfspowfs
[in]ipowfsipowfs
[in]r0Fried parameter
[in]L0outer scale
[in]nrepNumber of iterations. 1 for mtche, 3 for cog
[in]use_cachecache intermediate results.

◆ sodium_fit()

void sodium_fit ( dmat ** sodium,
dcell ** pgrad,
dcell ** pi0,
dcell ** pgx,
dcell ** pgy,
const dcell * i0i,
const dccell * sepsf,
const dtf_t * dtf,
const loc_t * saloc,
const dcell * saa,
const dcell * srsa,
const dcell * srot,
const dmat * siglevs,
const dmat * wvlwts,
const dcell * gradoff,
real dh,
real hs,
real htel,
real za,
real svdthres,
int nrep,
int save,
int use_cache )

Fit i0 to sodium profile using iterative algorithm. The steps are as follows

  1. Create sub images for each sodium profile bin
  2. Fit such sub-images against i0 to determine the profile
  3. Determine subaperture tip/tilt comparing i0 and fitted i0 (using matched filter)
  4. Repeat 1-4.
Parameters
sodiumThe sodium profile determined by fit
pgradThe gradients determined by fit.
pi0The output i0
pgxThe output gx
pgyThe output gy
i0iThe input i0
sepsfShort exposure PSF
dtfDetector transfer function
salocSaloc
saaSubaperture area.
srsaSubaperture to LLT distance
srotSubaperture to LLT clocking
siglevsSubaperture signal level
wvlwtsWavelength weights
gradoffNCPA gradient to be used for pi0,pgx,pgy output.
dhThe sodium profile sampling in meters
hsLGS focusing height
htelTelescope hegith
zaTelescope zenith angle
svdthresSVD threshold
nrepNumber of iterations
saveSave results to file
use_cacheUse cache