MAOS
Multithreaded Adaptive Optics Simulator
genotf.h File Reference

Functions

void genotf (ccell **potf, loc_t *loc, const dmat *amp, const dmat *opdbias, const dmat *area, real thres, real wvl, const dmat *cov, real r0, real l0, long npsfx, long npsfy, long nsa, long pttr)
 
dmatmk2dcov (loc_t *loc, const dmat *amp, real ampthres, const dmat *cov, int norm)
 

Detailed Description

Routines to generate short/long exposure OTFs of an aperture in present of atmosphere turbulence.

Function Documentation

◆ genotf()

void genotf ( ccell **  potf,
loc_t loc,
const dmat amp,
const dmat opdbias,
const dmat area,
real  thres,
real  wvl,
const dmat cov,
real  r0,
real  l0,
long  npsfx,
long  npsfy,
long  nsa,
long  pttr 
)

Generate OTFs for an aperture or multiple subapertures. ALl these apertures must share the same geometry, but may come with different amplitude map and/or OPD biasas. if pttr is 1, the OTF will have tip/tilt removed. make r0 to infinity to build diffraction limited OTF. make r0 to infinity and opdbias to none null to build OTF for a static map.

2020-01-21: Compute OTF using nyquist sampling and then upsample with FFT.

Parameters
potfThe otf array for output
locthe aperture grid (same for all apertures)
ampThe amplitude map of all the (sub)apertures
opdbiasThe static OPD bias (complex part of amp).
areanormalized area of the (sub)apertures
thresThe threshold to consider a (sub)aperture as full
wvlThe wavelength. only needef if opdbias is not null
covThe covariance. If not supplied use r0 for kolmogorov spectrum.
r0Fried parameter
l0Outer scale
npsfxSize of PSF
npsfySize of PSF
nsaNumber of (sub)apertures
pttrRemove piston/tip/tilt

◆ mk2dcov()

dmat* mk2dcov ( loc_t loc,
const dmat amp,
real  ampthres,
const dmat cov,
int  norm 
)

Average spatially the 4-d covariance function to create a 2-d covariance function. For OPD f defined on points x (2-d coordinate), the 4-d covariance is simply <f'f> where f is vector form of the OPD and the average is over time. The 2-d covariance is additionally averaged over all the points so that B(r)=<f(x)'f(x+r)>_x,t To compute B, we first figure out the number of overlapping pairs of points for each r and then compute the averaging. When the amplitude is less than the threshold, the point does not count.