MAOS
Multithreaded Adaptive Optics Simulator
accphi.h File Reference

Data Structures

struct  propdata_t
 

Macros

#define ARGIN_GRID   const map_t *mapin
 
#define ARGIN_GRID2   mapin
 
#define ARGIN_NONGRID
 
#define ARGIN_NONGRID2   locin, phiin
 
#define ARGOUT_LOC
 
#define ARGOUT_LOC2   locout, phiout
 
#define ARGOUT_PTS
 
#define ARGOUT_PTS2   pts, phiout
 
#define ARGOUT_MAP   map_t *mapout
 
#define ARGOUT_MAP2   mapout
 
#define ARGOUT_STAT
 
#define ARGOUT_STAT2   ostat, phiout
 
#define ARG_PROP
 
#define ARG_PROP2   alpha, displacex, displacey, scale
 
#define ARG_INDEX
 
#define ARG_PROP_WRAP
 
#define ARG_PROP_NOWRAP
 
#define ARG_PROP_CUBIC
 

Functions

void * prop (thread_t *data)
 
void prop_grid (const map_t *mapin, const loc_t *locout, real *phiout, const real alpha, real displacex, real displacey, const real scale, int wrap, long start, long end)
 
void prop_grid_map (const map_t *mapin, map_t *mapout, const real alpha, real displacex, real displacey, const real scale, int wrap, long start, long end)
 
void prop_grid_pts (const map_t *mapin, const pts_t *pts, real *phiout, const real alpha, real displacex, real displacey, const real scale, int wrap, long start, long end)
 
void prop_grid_stat (const map_t *mapin, const locstat_t *ostat, real *phiout, const real alpha, real displacex, real displacey, const real scale, int wrap, long start, long end)
 
void prop_nongrid (const loc_t *locin, const real *phiin, const loc_t *locout, real *phiout, const real alpha, real displacex, real displacey, const real scale, long start, long end)
 
void prop_nongrid_map (const loc_t *locin, const real *phiin, map_t *mapout, const real alpha, real displacex, real displacey, const real scale, long start, long end)
 
void prop_nongrid_pts (const loc_t *locin, const real *phiin, const pts_t *pts, real *phiout, const real alpha, real displacex, real displacey, const real scale, long start, long end)
 
void prop_nongrid_rot (const loc_t *locin, const real *phiin, const loc_t *locout, real *phiout, const real alpha, real displacex, real displacey, const real scale, long start, long end, real theta)
 
void prop_grid_cubic (const map_t *mapin, const loc_t *locout, real *phiout, const real alpha, real displacex, real displacey, const real scale, real cubic_iac, long start, long end)
 
void prop_grid_map_cubic (const map_t *mapin, map_t *mapout, const real alpha, real displacex, real displacey, const real scale, real cubic_iac, long start, long end)
 
void prop_grid_pts_cubic (const map_t *mapin, const pts_t *pts, real *phiout, const real alpha, real displacex, real displacey, const real scale, real cubic_iac, long start, long end)
 
void prop_grid_stat_cubic (const map_t *mapin, const locstat_t *ostat, real *phiout, const real alpha, real displacex, real displacey, const real scale, real cubic_iac, long start, long end)
 
void prop_nongrid_cubic (const loc_t *locin, const real *phiin, const loc_t *locout, real *phiout, const real alpha, real displacex, real displacey, const real scale, real cubic_iac, long start, long end)
 
void prop_nongrid_pts_cubic (const loc_t *locin, const real *phiin, const pts_t *pts, real *phiout, const real alpha, real displacex, real displacey, const real scale, real cubic_iac, long start, long end)
 
void prop_nongrid_map_cubic (const loc_t *locin, const real *phiin, map_t *mapout, const real alpha, real displacex, real displacey, const real scale, real cubic_iac, long start, long end)
 
void prop_grid_map_transpose (map_t *mapin, const map_t *mapout, const real alpha, real displacex, real displacey, const real scale, int wrap, long start, long end)
 
void prop_grid_stat_transpose (map_t *mapin, const locstat_t *ostat, const real *phiout, const real alpha, real displacex, real displacey, const real scale, int wrap, long start, long end)
 
void prop_nongrid_bin (const loc_t *locin, const real *phiin, const loc_t *locout, real *phiout, const real alpha, real displacex, real displacey, const real scale)
 

Detailed Description

Contains ray tracing routines optimized for different input/output formats. Notice that the OPDs are accumulated.


Data Structure Documentation

◆ propdata_t

struct propdata_t

Unified data structure for automatic selection of propagation.

+ Collaboration diagram for propdata_t:
Data Fields
map_t * mapin
loc_t * locin
const dmat * phiin
map_t * mapout
dmat * phiout
const pts_t * ptsout
const loc_t * locout
const locstat_t * ostat
real displacex0
real displacey0
real displacex1
real displacey1
real scale
real alpha
int wrap
int nooptim
int index

Macro Definition Documentation

◆ ARGIN_GRID

#define ARGIN_GRID   const map_t *mapin

[in] OPD defind on a square grid

◆ ARGIN_NONGRID

#define ARGIN_NONGRID
Value:
const loc_t *locin, \
const real *phiin
Definition: type.h:179

[in] Input OPD defined in locin

◆ ARGOUT_LOC

#define ARGOUT_LOC
Value:
const loc_t *locout, \
real* phiout
Definition: type.h:179

[in,out] Output OPD defined in locout

◆ ARGOUT_PTS

#define ARGOUT_PTS
Value:
const pts_t *pts, \
real *phiout
Definition: type.h:207

[in,out] OPD defined on locout

◆ ARGOUT_MAP

#define ARGOUT_MAP   map_t *mapout

[in,out] Output OPD defined in a square grid

◆ ARGOUT_STAT

#define ARGOUT_STAT
Value:
const locstat_t *ostat, \
real *phiout
Definition: type.h:165

[in, out] Output OPD defined on ostat

◆ ARG_PROP

#define ARG_PROP
Value:
const real alpha, \
real displacex, \
real displacey, \
const real scale

[in] scaling of the beam diameter (cone)

◆ ARG_INDEX

#define ARG_INDEX
Value:
long start, \
long end

[ind] end index

◆ ARG_PROP_WRAP

#define ARG_PROP_WRAP
Value:
int wrap, \
ARG_INDEX
#define ARG_PROP
Definition: accphi.h:88

◆ ARG_PROP_NOWRAP

#define ARG_PROP_NOWRAP
Value:
ARG_INDEX
#define ARG_PROP
Definition: accphi.h:88

◆ ARG_PROP_CUBIC

#define ARG_PROP_CUBIC
Value:
real cubic_iac, \
ARG_INDEX
#define ARG_PROP
Definition: accphi.h:88

Function Documentation

◆ prop()

void* prop ( thread_t data)

A wrapper prop routine that handles all the different cases by calling the different routines. Handles threading.

◆ prop_grid()

void prop_grid ( const map_t mapin,
const loc_t locout,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
int  wrap,
long  start,
long  end 
)

Propagate OPD defines on grid mapin to coordinate locout. alpha is the scaling of data. displacex, displacy is the displacement of the center of the beam on the input grid. scale is the cone effect.

Parameters
[in]mapinOPD defind on a square grid
[in]locoutCoordinate of irregular output grid
[in,out]phioutOutput OPD defined in locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]wrapwarp around
[in]startstart index
[in]endend index

◆ prop_grid_map()

void prop_grid_map ( const map_t mapin,
map_t mapout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
int  wrap,
long  start,
long  end 
)

Propagate OPD defines on grid mapin to grid mapout. alpha is the scaling of data. displacex, displacy is the displacement of the center of the beam on the input grid. scale is the cone effect.

Parameters
[in]mapinOPD defind on a square grid
[in,out]mapoutoutput OPD defined on a square grid
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]wrapwarp around
[in]startstart index
[in]endend index

◆ prop_grid_pts()

void prop_grid_pts ( const map_t mapin,
const pts_t pts,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
int  wrap,
long  start,
long  end 
)
Parameters
[in]mapinOPD defind on a square grid
[in]ptscoordinate of destination grid
[in,out]phioutOPD defined on locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]wrapwarp around
[in]startstart index
[in]endend index

◆ prop_grid_stat()

void prop_grid_stat ( const map_t mapin,
const locstat_t ostat,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
int  wrap,
long  start,
long  end 
)
Parameters
[in]mapinOPD defind on a square grid
[in]ostatstatics of columns in a loc_t
[in,out]phioutOutput OPD defined on ostat
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]wrapwarp around
[in]startstart index
[in]endend index

◆ prop_nongrid()

void prop_nongrid ( const loc_t locin,
const real *  phiin,
const loc_t locout,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
long  start,
long  end 
)

Propagate OPD defines on coordinate locin to coordinate locout. This is the slowest. alpha is the scaling of data. displacex, displacy is the displacement of the center of the beam on the input grid. scale is the cone effect. See prop_grid() for definition of other parameters.

Parameters
[in]locinCoordinate of iregular source grid
[in]phiinInput OPD defined in locin
[in]locoutCoordinate of irregular output grid
[in,out]phioutOutput OPD defined in locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]startstart index
[in]endend index

◆ prop_nongrid_map()

void prop_nongrid_map ( const loc_t locin,
const real *  phiin,
map_t mapout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
long  start,
long  end 
)

Propagate OPD defines on coordinate locin to grid mapout. alpha is the scaling of data. displacex, displacy is the displacement of the center of the beam on the input grid. scale is the cone effect.

Parameters
[in]locinCoordinate of iregular source grid
[in]phiinInput OPD defined in locin
[in,out]mapoutOutput OPD defined in a square grid
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]startstart index
[in]endend index

◆ prop_nongrid_pts()

void prop_nongrid_pts ( const loc_t locin,
const real *  phiin,
const pts_t pts,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
long  start,
long  end 
)

Propagate OPD defines on coordinate locin to subapertures pts. alpha is the scaling of data. displacex, displacy is the displacement of the center of the beam on the input grid. scale is the cone effect. See prop_groid().

Parameters
[in]locinCoordinate of iregular source grid
[in]phiinInput OPD defined in locin
[in]ptscoordinate of destination grid
[in,out]phioutOPD defined on locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]startstart index
[in]endend index

◆ prop_nongrid_rot()

void prop_nongrid_rot ( const loc_t locin,
const real *  phiin,
const loc_t locout,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
long  start,
long  end,
real  theta 
)

Propagate OPD defines on locin to locout with rotation. locout is rotated by theta CW which means OPD is rotated CCW by theta. alpha is the scaling of data. displacex, displacy is the displacement of the center of the beam on the input grid. scale is the cone effect. See prop_grid() for definition of other parameters.

Parameters
[in]locinCoordinate of iregular source grid
[in]phiinInput OPD defined in locin
[in]locoutCoordinate of irregular output grid
[in,out]phioutOutput OPD defined in locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]startstart index
[in]endend index

◆ prop_grid_cubic()

void prop_grid_cubic ( const map_t mapin,
const loc_t locout,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
real  cubic_iac,
long  start,
long  end 
)

Propagate OPD defines on grid mapin to coordinate locout with cubic influence functions. alpha is the scaling of data. displacex, displacy is the displacement of the center of the beam on the input grid. scale is the cone effect. The input grid must cover the output loc completely (we aim for best efficiency), with at least one full guard ring.

Parameters
[in]mapinOPD defind on a square grid
[in]locoutCoordinate of irregular output grid
[in,out]phioutOutput OPD defined in locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]cubic_iacinter-actuator coupling coeffcient
[in]startstart index
[in]endend index

◆ prop_grid_map_cubic()

void prop_grid_map_cubic ( const map_t mapin,
map_t mapout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
real  cubic_iac,
long  start,
long  end 
)

like prop_grid_map() but with cubic influence functions. cubic_iac is the inter-actuator-coupling.

Parameters
[in]mapinOPD defind on a square grid
[in,out]mapoutOutput OPD defined in a square grid
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]cubic_iacinter-actuator coupling coeffcient
[in]startstart index
[in]endend index

◆ prop_grid_pts_cubic()

void prop_grid_pts_cubic ( const map_t mapin,
const pts_t pts,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
real  cubic_iac,
long  start,
long  end 
)

Propagate OPD defines on grid mapin to coordinate locout with cubic influence functions. alpha is the scaling of data. displacex, displacy is the displacement of the center of the beam on the input grid. scale is the cone effect. The input grid must cover the output loc completely (we aim for best efficiency), with at least one full guard ring.

Parameters
[in]mapinOPD defind on a square grid
[in]ptscoordinate of destination grid
[in,out]phioutOPD defined on locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]cubic_iacinter-actuator coupling coeffcient
[in]startstart index
[in]endend index

◆ prop_grid_stat_cubic()

void prop_grid_stat_cubic ( const map_t mapin,
const locstat_t ostat,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
real  cubic_iac,
long  start,
long  end 
)

like prop_grid_stat() but with cubic influence function.

Parameters
[in]mapinOPD defind on a square grid
[in]ostatstatics of columns in a loc_t
[in,out]phioutOutput OPD defined on ostat
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]cubic_iacinter-actuator coupling coeffcient
[in]startstart index
[in]endend index

◆ prop_nongrid_cubic()

void prop_nongrid_cubic ( const loc_t locin,
const real *  phiin,
const loc_t locout,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
real  cubic_iac,
long  start,
long  end 
)

like prop_nongrid() but with cubic influence functions. cubic_iac is the inter-actuator coupling. Consider embed the input into a map_t and call prop_grid_cubic instead, which is must faster.

Parameters
[in]locinCoordinate of iregular source grid
[in]phiinInput OPD defined in locin
[in]locoutCoordinate of irregular output grid
[in,out]phioutOutput OPD defined in locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]cubic_iacinter-actuator coupling coeffcient
[in]startstart index
[in]endend index

◆ prop_nongrid_pts_cubic()

void prop_nongrid_pts_cubic ( const loc_t locin,
const real *  phiin,
const pts_t pts,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
real  cubic_iac,
long  start,
long  end 
)

like prop_nongrid_pts() but with cubic influence functions. cubic_iac is the inter-actuator-coupling.

Parameters
[in]locinCoordinate of iregular source grid
[in]phiinInput OPD defined in locin
[in]ptscoordinate of destination grid
[in,out]phioutOPD defined on locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]cubic_iacinter-actuator coupling coeffcient
[in]startstart index
[in]endend index

◆ prop_nongrid_map_cubic()

void prop_nongrid_map_cubic ( const loc_t locin,
const real *  phiin,
map_t mapout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
real  cubic_iac,
long  start,
long  end 
)

like prop_nongrid_map() but with cubic influence functions. cubic_iac is the inter-actuator-coupling.

Parameters
[in]locinCoordinate of iregular source grid
[in]phiinInput OPD defined in locin
[in,out]mapoutOutput OPD defined in a square grid
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]cubic_iacinter-actuator coupling coeffcient
[in]startstart index
[in]endend index

◆ prop_grid_map_transpose()

void prop_grid_map_transpose ( map_t mapin,
const map_t mapout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
int  wrap,
long  start,
long  end 
)

Do the reverse propagation of prop_grid_map. If prop_grid_map does y+=H*x; This just does x+=H'*y;

Parameters
[out]mapinOPD defind on a square grid
[in]mapoutOPD defined in a square grid
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]wrapwarp around
[in]startstart index
[in]endend index

◆ prop_grid_stat_transpose()

void prop_grid_stat_transpose ( map_t mapin,
const locstat_t ostat,
const real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale,
int  wrap,
long  start,
long  end 
)

Do the reverse propagation of prop_grid_stat. If prop_grid_stat does y+=H*x; This just does x+=H'*y;

Parameters
[out]mapinOPD defind on a square grid
[in]ostatstatics of columns in a loc_t
[in]phioutOutput OPD defined in locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)
[in]wrapwarp around
[in]startstart index
[in]endend index

◆ prop_nongrid_bin()

void prop_nongrid_bin ( const loc_t locin,
const real *  phiin,
const loc_t locout,
real *  phiout,
const real  alpha,
real  displacex,
real  displacey,
const real  scale 
)

The following routine is used to do down sampling by doing binning ray tracing using reverse interplation. locout is coarse sampling, locin is fine sampling. phiout is the destination OPD. The weightings are obtained by interpolating from locout to locin, but the OPD are reversed computed. Simply replace prop_nongrid by prop_nongrid_bin without changing arguments, except removing start, end, will do the same ray tracing using reverse interpolation (binning).

2011-04-27: Revised usage of alpha, displacex/y so that the result agrees with prop_nongrid when used in the same situation. Report missing does not make sense here since locin is usually bigger than locout.

2014-06-04: Notice that this operation is not direct transpose of prop_nongrid() to avoid accumulate bumps around the edge.

Parameters
[in]locinCoordinate of iregular source grid
[in]phiinInput OPD defined in locin
[in]locoutCoordinate of irregular output grid
[in,out]phioutOutput OPD defined in locout
[in]alphascaling of OPD
[in]displacexdisplacement of the ray
[in]displaceydisplacement of the ray
[in]scalescaling of the beam diameter (cone)