![]() |
MAOS
Multithreaded Adaptive Optics Simulator
|
Data Structures | |
| struct | genatm_t |
Functions | |
| map_t * | genatm_simple (real r0, real L0, real slope, real dx, long nx, int seed) |
| dmat * | genatm_loc (loc_t *loc, real r0, real L0, real slope, int seed) |
| mapcell * | genscreen (genatm_t *data) |
| mapcell * | genscreen_str (const char *keywords) |
| dmat * | turbcov (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) |
| dmat * | turbpsd (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) |
Contains routines to generate atmospheric turbulence screens
| struct 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] |
| mapcell * | screen |
The destination screen pointer |
A simpler interface to gerate a single screen.
| [in] | r0 | Fried parameter (m) at 0.5 micron. |
| [in] | L0 | Outer scale (m). |
| [in] | slope | PSD slope. 0 means -11/3. |
| [in] | dx | Sampling (m). |
| [in] | nx | Number of points along x and y. |
| [in] | seed | Random seed. |
Generate atmosphere and map onto loc.
| [in] | loc | Grid coordinate. |
| [in] | r0 | Fried parameter (m) at 0.5 micron. |
| [in] | dsa | Outer scale (m) of the generated screen. |
| [in] | slope | PSD slope. 0 means -11/3. |
| [in] | seed | Random seed. |
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.
| [in,out] | data | Atmosphere generation parameters. The random stream is consumed. |
| mapcell * genscreen_str | ( | const char * | keywords | ) |
Generate screen according to a header. It has multiple possible options. 1) If is a filename. load from file 2) if mode and petal is not set. generate screen from PSD with the following keys L0 (Outer scale) slope (optional, default is -11/3) seed (optional) 3) If mode is set. generate from a zernike mode with the following keys mode (zernike mode) 4) If petal is set. generate randomized petal modes each with rms value. petal sets total number of petals theta0 sets petal gap orientation angular offset in radian. 0 means a gap is along y axis. seed piston: generates piston mode if set tip: generate tip mode if set tilt: generates tilt mode if set The following common parameters are used: r0 (Fried parameter in m) or rms (in nm) dx (sampling) nx (number of points)
| [in] | keywords | File name or a string of key=value pairs as described above. |
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.
| [in] | r | Separation (m). |
| [in] | rmax | Maximum separation (m). Only used for kolmogorov spectrum. |
| [in] | r0 | Fried parameter (m) at 0.5 micron. |
| [in] | L0 | Outer scale (m). Infinity means kolmogorov spectrum. |
| 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).
| [in,out] | pout | Output. Reused if the size matches, otherwise (re)allocated. |
| [in] | nx | The size along x. |
| [in] | ny | The size along y. |
| [in] | dx | The sampling of spatial coordinate (m). |
| [in] | strength | Strength coefficient. |
| [in] | outerscale | Outerscale (m). 0 means infinity. |
| [in] | minfreq | Low end frequency cut off (1/m). |
| [in] | maxfreq | High end frequency cut off (1/m). 0 means infinity. |
| [in] | slope | should be -11/3 for von karman or kolmogorov screens, or -4 for biharmonic screen (just testing only). 0 means -11/3. |
| [in] | power | optionally do a power of psd. |
Compute spatial PSD of turbulence spectrum.
| [in] | nx | The size along x. |
| [in] | ny | The size along y. |
| [in] | dx | The sampling (m). |
| [in] | r0 | Fried parameter (m) at 0.5 micron. |
| [in] | L0 | Outer scale (m). |
| [in] | slope | PSD slope. 0 means -11/3. |
| [in] | power | Power to apply to the PSD (e.g., 0.5 for the amplitude spectrum). |
| real calc_aniso | ( | real | r0, |
| int | nps, | ||
| real * | ht, | ||
| real * | wt ) |
Estimate anisoplanatic angle theta0 from Fried parameter r0, layer height and weights.
| [in] | r0 | Fried parameter (m). |
| [in] | nps | Number of layers. |
| [in] | ht | Layer heights (m). |
| [in] | wt | Layer weights. Layers with weight below 0.01 are ignored. |
| real calc_greenwood | ( | real | r0, |
| int | nps, | ||
| real * | ws, | ||
| real * | wt ) |
Estimate Green wood frequency
| [in] | r0 | Fried parameter (m). |
| [in] | nps | Number of layers. |
| [in] | ws | Layer wind speeds (m/s). |
| [in] | wt | Layer weights. |
| 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.
| [in] | r0 | Fried parameter (m). |
| [in] | nps | Number of layers. |
| [in] | ht | Layer heights (m). |
| [in] | wt | Layer weights. |
| [in] | hc1 | Conjugation height (m) of the ground DM. |
| [in] | hc2 | Conjugation height (m) of the altitude DM. |