![]() |
MAOS
Multithreaded Adaptive Optics Simulator
|
Data Structures | |
| struct | dtf_t |
| struct | etf_t |
Macros | |
| #define | dtf_free(dtfs) |
| #define | etf_free(etfs) |
Functions | |
| void | dtf_otf (dmat **nominal, long notfx, long notfy, real pdthetax, real pdthetay, real pixrot, real pixblur, int treat) |
| dtf_t * | mkdtf (const dmat *wvls, real dxsa, real embfac, long notfx, long notfy, long pixpsax, long pixpsay, real pixthetax, real pixthetay, const dmat *pixoffx, const dmat *pixoffy, real pixblur, const dcell *pixrot) |
| etf_t * | mketf (const dtf_t *dtfs, const_anyarray sodium, int icol, const dcell *srot, const dcell *srsa, real hs, real htel, real za_rad, int no_interp) |
| void | dtf_free_do (dtf_t *dtfs) |
| void | etf_free_do (etf_t *etfs) |
| dmat * | smooth (const dmat *profile, real dxnew) |
| dcell * | smooth_cell (const dcell *profile, real dxnew) |
Routine to generate detector transfer function and elongation transfer function due to sodium layer.
| struct dtf_t |
contains the data associated with a detector transfer function for a subaperture. The PSF is computed as \(\textrm{PSF}=\frac{1}{N^2\sum(\textrm{amp}^2)}|\textrm{fftshift}\mathcal{F}[A \exp(-\frac{2\pi}{\lambda}\textrm{opd})]|^2\). The subaperture image is computed as \(I=\textrm{si}*\mathcal{F}^{-1}[\mathcal{F}[\textrm{PSF}\times\textrm{nominal}]]\)
| Data Fields | ||
|---|---|---|
| dcell * | nominal |
The FFT of the pixel functions, don't apply if etf exists . |
| dspcell * | si |
The pixel selection |
| real | wvl |
Wavelength |
| real | dtheta |
Sampling of PSF |
| cmat * | Ux |
Special frequency vector along x |
| cmat * | Uy |
Special frequency vector along y |
| real | dxsa |
Subaperture size |
| real | pixthetax |
Pixel size along x (radial) |
| real | pixthetay |
Pixel size along y (radial |
| long | notfx |
FFT size along x |
| long | notfy |
FFT size along y |
| long | pixpsax |
Number of pixels along x |
| long | pixpsay |
Number of pixels along y |
| int | radpix |
1: Pixels are along radial/azimuthal direction |
| int | nwvl |
Number of dtf_t |
| struct etf_t |
| #define dtf_free | ( | dtfs | ) |
frees dtf_t
| #define etf_free | ( | etfs | ) |
frees etf_t
| void dtf_otf | ( | dmat ** | nominal, |
| long | notfx, | ||
| long | notfy, | ||
| real | pdthetax, | ||
| real | pdthetay, | ||
| real | pixrot, | ||
| real | pixblur, | ||
| int | treat ) |
Create a OTF for pix blur and pixel binning effect
| [out] | nominal | The result. Allocated or resized as needed. |
| [in] | notfx | Size of FFT along x. |
| [in] | notfy | Size of FFT along y. |
| [in] | pdthetax | Ratio of pixel size vs PSF sampling along x. 0 to disable pixel binning. |
| [in] | pdthetay | Ratio of pixel size vs PSF sampling along y. |
| [in] | pixrot | Rotation of pixel array against PSF (radian, polar coordinate). |
| [in] | pixblur | Pixel blur sigma (fraction of pixel). |
| [in] | treat | 1: embed a FFT shift in nominal with dotf_treat(). 2: apply dfftshift. 0: none. |
| dtf_t * mkdtf | ( | const dmat * | wvls, |
| real | dxsa, | ||
| real | embfac, | ||
| long | notfx, | ||
| long | notfy, | ||
| long | pixpsax, | ||
| long | pixpsay, | ||
| real | pixthetax, | ||
| real | pixthetay, | ||
| const dmat * | pixoffx, | ||
| const dmat * | pixoffy, | ||
| const real | pixblur, | ||
| const dcell * | pixrot ) |
mkdtf() computes the parameters used to sample PSFs onto detectors in the Fourier domain. It incorporates size of the detector pixels, and charge diffusion. For polar coordinate detectors, it also rotates the pixels and pixel coordinates so that they are aranged along the radial and azimuthal direction.
| [in] | wvls | List of wavelength (m). |
| [in] | dxsa | Subaperture size (m). |
| [in] | embfac | Embedding factor (2). |
| [in] | notfx | FFT size along x. |
| [in] | notfy | FFT size along y. |
| [in] | pixpsax | Number of pixels along x(r). |
| [in] | pixpsay | Number of pixels along y(a). |
| [in] | pixthetax | Pixel size along x (r) (radian). |
| [in] | pixthetay | Pixel size along y (a) (radian). |
| [in] | pixoffx | Offset of image center from center of pixel array, along x or radial, in unit of pixel. Can be NULL. |
| [in] | pixoffy | Offset of image center from center of pixel array, along y or azimuthal, in unit of pixel. Can be NULL. |
| [in] | pixblur | Pixel blur sigma (fraction of pixel). |
| [in] | pixrot | Rotation angle of pixels islands in each subaperture. For polar coordinate only. Can be NULL. |
| wvls | List of wavelength |
| dxsa | Subaperture size |
| embfac | Embedding factor (2) |
| notfx | FFT size along x |
| notfy | FFT size along y |
| pixpsax | Number of pixels along x(r) |
| pixpsay | Number of pixels along y(a) |
| pixthetax | Pixel size along x (r) |
| pixthetay | Pixel size along y (a) |
| pixoffx | offset of image center from center of pixel array, along x or radial |
| pixoffy | offset of image center from center of pixel array, along y or azimuthal |
| pixblur | Pixel blur sigma(fraction of pixel) |
| pixrot | Rotation angle of pixels islands in each subaperture. for polar coordinate only |
| etf_t * mketf | ( | const dtf_t * | dtfs, |
| const_anyarray | sodium_, | ||
| int | icol, | ||
| const dcell * | srot, | ||
| const dcell * | srsa, | ||
| real | hs, | ||
| real | htel, | ||
| real | za_rad, | ||
| int | no_interp ) |
Compute the elongation transfer function (ETF) for LGS WFS subapertures from the sodium profile. The DTF nominal is fused into the ETF.
| [in] | dtfs | The dtfs, one per wavelength. |
| [in] | sodium_ | The sodium profile. In each cell first column is coordinate (m). Different cells must have the same coordinate. Can also be a dmat. |
| [in] | icol | Which sodium profile column to use (wrapped). |
| [in] | srot | Rotation angle of each subaperture (radian). Required. |
| [in] | srsa | Subaperture to LLT distance (m). |
| [in] | hs | LGS WFS focus altitude (m). |
| [in] | htel | Telescope altitude (m). |
| [in] | za_rad | Zenith angle (radian). |
| [in] | no_interp | Use direct sum instead of interpolation + FFT. Slower. |
| dtfs | The dtfs |
| sodium_ | The sodium profile. First column is coordinate. |
| icol | Which sodium profile to use |
| srot | Rotation angle of each subaperture. NULL for NGS WFS |
| srsa | Subaperture to LLT distance |
| hs | Guide star focus range |
| htel | Telescope altitude |
| za_rad | Telescope zenith angle in radian |
| no_interp | Use direct sum instead of interpolation + FFT. Slower |
| void dtf_free_do | ( | dtf_t * | dtfs | ) |
Free the array of dtf_t (one per wavelength). Use the dtf_free() macro.
| [in] | dtfs | The array to free. Can be NULL. |
| void etf_free_do | ( | etf_t * | etfs | ) |
Free the array of etf_t (one per wavelength). Use the etf_free() macro.
| [in] | etfs | The array to free. Can be NULL. |
profile is nxm array with m>=2. First column is coordinate and the remaining is function of coordinate. This routine smoothes the profile on new coordinate with spacing of dxnew.
| [in] | prof | The profile. |
| [in] | dxnew | The new coordinate spacing. |