MAOS
Multithreaded Adaptive Optics Simulator
Loading...
Searching...
No Matches
gensei.h File Reference

Functions

void upsample_otf (cmat *out, const cmat *in)
cccell * genseotf (const pts_t *pts, const_anyarray amp, const dcell *opdbias, const_anyarray saa, const dmat *wvl, real r0, real L0, int embfac)
void gensepsf (dccell **psepsfs, const cccell *otfs, const cccell *lotf, const_anyarray saa, const dmat *wvl, long notfx, long notfy)
void gensei (dcell **pi0, dcell **pgx, dcell **pgy, cccell **pfotf, const dccell *sepsfs, const dtf_t *dtf, const etf_t *etf, const dcell *saa, const dcell *gxyrot, const dmat *siglev, const dmat *wvlwts, const dcell *goff, int i0scale, int shift2center)

Detailed Description

Contains routines to generate mean short exposure (tip/tilt removed) pixel intensities. Mostly used for LGS pixel intensity for its matched filter. Structure functions from kolmogorov spectrum is used. Not able to take into account outerscale yet.

Todo
find ways to factor in outerscale effect (use von karman spectrum instead of kolmogorov)

Function Documentation

◆ genseotf()

cccell * genseotf ( const pts_t * pts,
const_anyarray amp_,
const dcell * opdbias,
const_anyarray saa_,
const dmat * wvl,
const real r0,
const real L0,
const int embfac )

Generates short exposure OTF by calling genotf() with p/t/t removal set. The result is cached in the SEOTF folder.

Parameters
[in]ptssubaperture low left coordinate
[in]amp_amplitude map. can be dcell or dmat
[in]opdbiasopd bias for otf.
[in]saa_list of subaperture area, can be dcell or dmat
[in]wvllist of wavelength
[in]r0Fried parameter
[in]L0Outer scale
[in]embfacEmbedding factor, normally 2
Returns
Newly allocated notf*nwvl cell of OTFs. The caller frees it.

◆ gensepsf()

void gensepsf ( dccell ** psepsfs,
const cccell * otfs,
const cccell * lotf,
const_anyarray saa_,
const dmat * wvl,
long npsfx,
long npsfy )

Upsample the otf in to out while preserving the PSF sampling. It changes the sampling of OTF. Do not use this if the sampling of OTFs are needed to be preserved. Createing subaperture short exposure PSF from the tip/tilt removed turbulence OTF and uplink OTF. Not including detector or elongation characteristics.
otfs and lotf must have the same sampling, but may have different dimension. Assumes that the otfs have peak in center.

Parameters
[in,out]psepsfsPSF. The sampling depends on sampling of OTF and notfx. Initialized if NULL; otherwise each PSF is reallocated.
[in]otfsOTFs of down link
[in]lotfOTFs of uplink, optional
[in]saa_subaperture area, optional
[in]wvlwavelength
[in]npsfxPSF x dimension. optional. If specified, the psf will be padded by 0 or truncated
[in]npsfyPSF y dimension. optional. If specified, the psf will be padded by 0 or truncated

◆ gensei()

void gensei ( dcell ** pi0,
dcell ** pgx,
dcell ** pgy,
cccell ** pfotf,
const dccell * sepsfs,
const dtf_t * dtf,
const etf_t * etf,
const dcell * saa,
const dcell * gxyrot,
const dmat * siglev,
const dmat * wvlwts,
const dcell * goff,
int i0scale,
int shift2center )

generate subaperture short exposure average pixel intensities sampled on detector from short expsoure PSF, the elongation transfer function of the sodium layer, and the detector transfer function.

Parameters
[in,out]pi0If not NULL, the nsa*ni0 average pixel intensities. Reallocated if NULL or mismatch in size; otherwise zeroed and recomputed.
[in,out]pgxIf not NULL, derivative of i0 along x (or radial direction if gxyrot is set). Same handling as pi0.
[in,out]pgyIf not NULL, derivative of i0 along y (or azimuthal direction if gxyrot is set). Same handling as pi0.
[in,out]pfotfIf not NULL, the existing content is freed and replaced by the newly allocated OTF (including elongation) of each subaperture and wavelength.
[in]sepsfsShort exposure PSF, from gensepsf().
[in]dtfDetector transfer function, one per wavelength.
[in]etfElongation transfer function, one per wavelength. NULL for none.
[in]saaSubaperture area. Used when i0scale is set.
[in]gxyrotIf not NULL, angle (radian) of each subaperture to compute the derivative in rotated coordinate.
[in]siglevSignal level.
[in]wvlwtsWavelength weights.
[in]goffIf not NULL, gradient offset (radian) to shift the PSF by.
[in]i0scaleWhether to scale i0 to match the subaperture area.
[in]shift2centerWhether to shift the PSF to be centered. Cannot be used with goff.