MAOS
Multithreaded Adaptive Optics Simulator
powfs_utils.h File Reference

Functions

void genmtch (const parms_t *parms, powfs_t *powfs, const int ipowfs)
 
void cog_nea (real *nea, const dmat *ints, real cogthres, real cogoff, int ntry, rand_t *rstat, real bkgrnd, real bkgrndc, const dmat *bkgrnd2i, const dmat *bkgrnd2ic, real rne)
 
real remove_focus_grad (const loc_t *saloc, dmat *grad, real factor)
 
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 *gradncpa, real dh, real hs, real htel, real za, real svdthres, int nrep, int save, int use_cache)
 
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)
 

Detailed Description

Contains routines to generate mean short exposure (tip/tilt removed) pixel intensities. Mostly used for LGS pixel intensity for its matched filter. Structure functions from kolmogorov spectrum is used. Not able to take into account outerscale yet.

Todo:
find ways to factor in outerscale effect (use von karman spectrum instead of kolmogorov)

Function Documentation

◆ 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 siglev,
const dmat wvlwts,
const dcell gradncpa,
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
siglevSubaperture signal level
wvlwtsWavelength weights
gradncpaNCPA 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

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