MAOS
Multithreaded Adaptive Optics Simulator
turbulence.h File Reference

Data Structures

struct  genatm_t
 

Functions

map_tgenatm_simple (real r0, real L0, real slope, real dx, long nx, int seed)
 
dmatgenatm_loc (loc_t *loc, real r0, real L0, real slope, int seed)
 
mapcellgenscreen (genatm_t *data)
 
mapcellgenscreen_str (const char *keywords)
 
dmatturbcov (dmat *r, real rmax, real r0, real L0)
 
void spatial_psd (dmat **out, long nx, long ny, real dx, real strength, real L0, real fmin, real fmax, real slope, real power)
 
dmatturbpsd (long nx, long ny, real dx, real r0, real L0, real slope, real power)
 
real calc_aniso (real r0, int nht, real *ht, real *wt)
 
real calc_greenwood (real r0, int nps, real *ws, real *wt)
 
real calc_aniso2 (real r0, int nht, real *ht, real *wt, real hc1, real hc2)
 

Detailed Description

Contains routines to generate atmospheric turbulence screens


Data Structure Documentation

◆ genatm_t

struct genatm_t
+ Collaboration diagram for genatm_t:
Data Fields
rand_t * rstat

The random stream

real * wt

The layer weights

real r0

The Fried Parameter

real * L0

The outer scale

real dx

The sampling

real fmin

Minimum spatial frequency

real fmax

Maximum spatial frequency

real slope

Power slope of PSD. -11/3 for Von Karman, -4 for Biharmonic. -1 for fractal.

long nx

Number of pixels along x

long ny

Number of pixels along y

long nlayer

The number of layers

long ninit

In Fractal method, the size of initial screen

long share

Use file backend for sharing of atmosphere

dmat * r0logpsds

Spatial PSD of log(r0) (m)=beta*f^alpha. [alpha, beta, minfreq, maxfreq]

dcell * screen

The destination screen pointer

Function Documentation

◆ genatm_simple()

map_t* genatm_simple ( real  r0,
real  L0,
real  slope,
real  dx,
long  nx,
int  seed 
)

A simpler interface to gerate a single screen.

◆ genatm_loc()

dmat* genatm_loc ( loc_t loc,
real  r0,
real  dsa,
real  slope,
int  seed 
)

Generate atmosphere and map onto loc.

◆ genscreen()

mapcell* genscreen ( genatm_t data)

Generates multiple screens from spectrum. Note that if data->share=1, the atmosphere will be different from data->share=0 due to different algorithms used.

◆ genscreen_str()

mapcell* genscreen_str ( const char *  keywords)

Generate screen according to a header. It has three possible options. 1) load from file 2) generate screen from PSD with the following keys r0 (Fried parameter) L0 (Outer scale) dx (sampling) nx (number of points) slope (optional, default is -11/3) seed (optional) 3) generate from a zernike mode with the following keys rms (in nm) mode (zernike mode) dx nx

◆ turbcov()

dmat* turbcov ( dmat r,
real  rmax,
real  r0,
real  L0 
)

Compute the covariance for separation of r, and put the values in cov. In kolmogorov spectrum, the variance are defined as half of the structure function between two points separated by rmax.

◆ spatial_psd()

void spatial_psd ( dmat **  pout,
long  nx,
long  ny,
real  dx,
real  strength,
real  outerscale,
real  minfreq,
real  maxfreq,
real  slope,
real  power 
)

Creates 2-d PSD at size nx*ny: psd=(strength*(f^2+L0^-2)^(slope/2))^power. Zero frequency component is in the corner P(psd,0).

Parameters
poutOutput
nxThe size
nyThe size
dxThe sampling of spatial coordinate.
strengthStrength coefficient
outerscaleOuterscale
minfreqLow end frequency cut off
maxfreqHigh end frequency cut off
slopeshould be -11/3 for von karman or kolmogorov screens, or -4 for biharmonic screen (just testing only).
poweroptionally do a power of psd.

◆ turbpsd()

dmat* turbpsd ( long  nx,
long  ny,
real  dx,
real  r0,
real  L0,
real  slope,
real  power 
)

Compute spatial PSD of turbulence spectrum.

◆ calc_aniso()

real calc_aniso ( real  r0,
int  nps,
real *  ht,
real *  wt 
)

Estimate anisoplanatic angle theta0 from Fried parameter r0, layer height and weights.

◆ calc_greenwood()

real calc_greenwood ( real  r0,
int  nps,
real *  ws,
real *  wt 
)

Estimate Green wood frequency

◆ calc_aniso2()

real calc_aniso2 ( real  r0,
int  nps,
real *  ht,
real *  wt,
real  hc1,
real  hc2 
)

Estimate generalized aniso angle theta2 from Fried parameter r0, and layer height and weights, and deformable mirror conjugation heights hc1 hc2 of the ground and altitude DMs.