MAOS
Multithreaded Adaptive Optics Simulator
mkdtf.h File Reference

Data Structures

struct  dtf_t
 
struct  etf_t
 

Macros

#define dtf_free(dtfs)   if(dtfs){dtf_free_do(dtfs); dtfs=NULL;}
 
#define etf_free(etfs)   if(etfs){etf_free_do(etfs); etfs=NULL;}
 

Functions

void dtf_otf (dmat **nominal, long notfx, long notfy, real pdthetax, real pdthetay, real pixrot, real pixblur, int treat)
 
dtf_tmkdtf (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_tmketf (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)
 
dmatsmooth (const dmat *profile, real dxnew)
 
dcellsmooth_cell (const dcell *profile, real dxnew)
 

Detailed Description

Routine to generate detector transfer function and elongation transfer function due to sodium layer.


Data Structure Documentation

◆ dtf_t

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}]]\)

+ Collaboration diagram for dtf_t:
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

int notfx

FFT size along x

int notfy

FFT size along y

int pixpsax

Number of pixels along x

int pixpsay

Number of pixels along y

int radpix

1: Pixels are along radial/azimuthal direction

int nwvl

Number of dtf_t

◆ etf_t

struct etf_t
+ Collaboration diagram for etf_t:
Data Fields
ccell * etf

Store the 2D ETF. nominal is fused in always.

real hs

Guide star height

int icol

Store the column index

int nwvl

Number of dtf_t

Macro Definition Documentation

◆ dtf_free

#define dtf_free (   dtfs)    if(dtfs){dtf_free_do(dtfs); dtfs=NULL;}

frees dtf_t

◆ etf_free

#define etf_free (   etfs)    if(etfs){etf_free_do(etfs); etfs=NULL;}

frees etf_t

Function Documentation

◆ dtf_otf()

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

Parameters
notfx,notfysize of FFT
pixrotRotation of pixel array against PSF (polar coordinate)
pdthetaRatio of pixel dtheta vs PSF dtheta squared.
pixblurPixel blur sigma(fraction of pixel)

◆ mkdtf()

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.

Parameters
wvlsList of wavelength
dxsaSubaperture size
embfacEmbedding factor (2)
notfxFFT size along x
notfyFFT size along y
pixpsaxNumber of pixels along x(r)
pixpsayNumber of pixels along y(a)
pixthetaxPixel size along x (r)
pixthetayPixel size along y (a)
pixoffxoffset of image center from center of pixel array, along x or radial
pixoffyoffset of image center from center of pixel array, along y or azimuthal
pixblurPixel blur sigma(fraction of pixel)
pixrotRotation angle of pixels islands in each subaperture. for polar coordinate only

◆ mketf()

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 
)
Parameters
dtfsThe dtfs
sodiumThe sodium profile. First column is coordinate.
icolWhich sodium profile to use
srotRotation angle of each subaperture. NULL for NGS WFS
srsaSubaperture to LLT distance
hsGuide star focus range
htelTelescope altitude
za_radTelescope zenith angle in radian
no_interpUse direct sum instead of interpolation + FFT. Slower

◆ smooth()

dmat* smooth ( const dmat prof,
real  dxnew 
)

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.