MAOS
Multithreaded Adaptive Optics Simulator
|
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) |
Contains ray tracing routines optimized for different input/output formats. Notice that the OPDs are accumulated.
struct propdata_t |
Unified data structure for automatic selection of propagation.
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 |
#define ARGIN_GRID const map_t *mapin |
[in] OPD defind on a square grid
#define ARGIN_NONGRID |
#define ARGOUT_LOC |
#define ARGOUT_PTS |
#define ARGOUT_MAP map_t *mapout |
[in,out] Output OPD defined in a square grid
#define ARGOUT_STAT |
#define ARG_PROP |
[in] scaling of the beam diameter (cone)
#define ARG_INDEX |
[ind] end index
#define ARG_PROP_WRAP |
#define ARG_PROP_CUBIC |
void* prop | ( | thread_t * | data | ) |
A wrapper prop routine that handles all the different cases by calling the different routines. Handles threading.
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.
[in] | mapin | OPD defind on a square grid |
[in] | locout | Coordinate of irregular output grid |
[in,out] | phiout | Output OPD defined in locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | wrap | warp around |
[in] | start | start index |
[in] | end | end index |
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.
[in] | mapin | OPD defind on a square grid |
[in,out] | mapout | output OPD defined on a square grid |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | wrap | warp around |
[in] | start | start index |
[in] | end | end index |
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 | ||
) |
[in] | mapin | OPD defind on a square grid |
[in] | pts | coordinate of destination grid |
[in,out] | phiout | OPD defined on locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | wrap | warp around |
[in] | start | start index |
[in] | end | end index |
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 | ||
) |
[in] | mapin | OPD defind on a square grid |
[in] | ostat | statics of columns in a loc_t |
[in,out] | phiout | Output OPD defined on ostat |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | wrap | warp around |
[in] | start | start index |
[in] | end | end index |
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.
[in] | locin | Coordinate of iregular source grid |
[in] | phiin | Input OPD defined in locin |
[in] | locout | Coordinate of irregular output grid |
[in,out] | phiout | Output OPD defined in locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | start | start index |
[in] | end | end index |
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.
[in] | locin | Coordinate of iregular source grid |
[in] | phiin | Input OPD defined in locin |
[in,out] | mapout | Output OPD defined in a square grid |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | start | start index |
[in] | end | end index |
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().
[in] | locin | Coordinate of iregular source grid |
[in] | phiin | Input OPD defined in locin |
[in] | pts | coordinate of destination grid |
[in,out] | phiout | OPD defined on locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | start | start index |
[in] | end | end index |
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.
[in] | locin | Coordinate of iregular source grid |
[in] | phiin | Input OPD defined in locin |
[in] | locout | Coordinate of irregular output grid |
[in,out] | phiout | Output OPD defined in locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | start | start index |
[in] | end | end index |
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.
[in] | mapin | OPD defind on a square grid |
[in] | locout | Coordinate of irregular output grid |
[in,out] | phiout | Output OPD defined in locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | cubic_iac | inter-actuator coupling coeffcient |
[in] | start | start index |
[in] | end | end index |
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.
[in] | mapin | OPD defind on a square grid |
[in,out] | mapout | Output OPD defined in a square grid |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | cubic_iac | inter-actuator coupling coeffcient |
[in] | start | start index |
[in] | end | end index |
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.
[in] | mapin | OPD defind on a square grid |
[in] | pts | coordinate of destination grid |
[in,out] | phiout | OPD defined on locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | cubic_iac | inter-actuator coupling coeffcient |
[in] | start | start index |
[in] | end | end index |
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.
[in] | mapin | OPD defind on a square grid |
[in] | ostat | statics of columns in a loc_t |
[in,out] | phiout | Output OPD defined on ostat |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | cubic_iac | inter-actuator coupling coeffcient |
[in] | start | start index |
[in] | end | end index |
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.
[in] | locin | Coordinate of iregular source grid |
[in] | phiin | Input OPD defined in locin |
[in] | locout | Coordinate of irregular output grid |
[in,out] | phiout | Output OPD defined in locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | cubic_iac | inter-actuator coupling coeffcient |
[in] | start | start index |
[in] | end | end index |
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.
[in] | locin | Coordinate of iregular source grid |
[in] | phiin | Input OPD defined in locin |
[in] | pts | coordinate of destination grid |
[in,out] | phiout | OPD defined on locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | cubic_iac | inter-actuator coupling coeffcient |
[in] | start | start index |
[in] | end | end index |
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.
[in] | locin | Coordinate of iregular source grid |
[in] | phiin | Input OPD defined in locin |
[in,out] | mapout | Output OPD defined in a square grid |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | cubic_iac | inter-actuator coupling coeffcient |
[in] | start | start index |
[in] | end | end index |
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;
[out] | mapin | OPD defind on a square grid |
[in] | mapout | OPD defined in a square grid |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | wrap | warp around |
[in] | start | start index |
[in] | end | end index |
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;
[out] | mapin | OPD defind on a square grid |
[in] | ostat | statics of columns in a loc_t |
[in] | phiout | Output OPD defined in locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |
[in] | wrap | warp around |
[in] | start | start index |
[in] | end | end index |
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.
[in] | locin | Coordinate of iregular source grid |
[in] | phiin | Input OPD defined in locin |
[in] | locout | Coordinate of irregular output grid |
[in,out] | phiout | Output OPD defined in locout |
[in] | alpha | scaling of OPD |
[in] | displacex | displacement of the ray |
[in] | displacey | displacement of the ray |
[in] | scale | scaling of the beam diameter (cone) |