MAOS
Multithreaded Adaptive Optics Simulator
map.h File Reference

Macros

#define rmapfree(A)   if(A){dfree_do((dmat*)A);A=NULL;}
 
#define mapfree(A)   if(A){dfree_do((dmat*)A);A=NULL;}
 

Functions

map_tmapnew (long nx, long ny, real dx, real dy)
 
map_tmapnew2 (map_t *A)
 
map_tmapref (map_t *A)
 
void mapcircle (map_t *map, real r, real val)
 
void mapcircle_symbolic (map_t *map, real r)
 
void map_d_din (map_t *map, real *d, real *din)
 
void create_metapupil (map_t **map, long *nx, long *ny, dmat *dirs, real D, real ht, real dx, real dy, real offset, real guard, long ninx, long niny, int pad, int square)
 
map_td2map (const dmat *in)
 
mapcelldcell2map (const dcell *in)
 
rmap_td2rmap (const dmat *in)
 
rmap_t ** dcell2rmap (int *nlayer, const dcell *in)
 
void map_header (map_t *map)
 
void rmap_header (rmap_t *map)
 

Detailed Description

This file defines functions relates to map_t, etc.

Function Documentation

◆ mapnew()

map_t* mapnew ( long  nx,
long  ny,
real  dx,
real  dy 
)

create a new map_t object.

◆ mapnew2()

map_t* mapnew2 ( map_t A)

ceate a new map_t object from existing one. P is left empty.

◆ mapcircle()

void mapcircle ( map_t map,
real  r,
real  val 
)

Create a circular aperture on map_t.

◆ mapcircle_symbolic()

void mapcircle_symbolic ( map_t map,
real  r 
)

Create a circular aperture on map_t.

◆ map_d_din()

void map_d_din ( map_t map,
real *  d,
real *  din 
)

Find the inner and outer diameter of an amplitude map contained in map_t.

◆ create_metapupil()

void create_metapupil ( map_t **  mapout,
long nxout,
long nyout,
dmat dirs,
real  D,
real  ht0,
real  dx,
real  dy,
real  offset,
real  guard,
long  ninx,
long  niny,
int  pad,
int  square 
)

create a metapupil map, with size nx*ny, origin at (ox,oy), sampling of dx, dy, height of ht, that can cover all the directions specified in dirs

offset: distance in pixel from the point closest to the origin to origin (right side). 0: there is a point on the origin. 1/2: the closest point to origin is 1/2 pixel.

pad!=0: round nx, ny to power of 2.

Parameters
[out]mapoutmap
[out]nxoutnx
[out]nyoutny
[in]dirsAll Directions to cover (thetax, thetay, hs, hc)
[in]DDiameter (meter)
[in]ht0Conjugation Height (meter)
[in]dxSampling along x (meter)
[in]dySampling along y (meter)
[in]offsetFractional offset of point closet from origin. between [0, 1)
[in]guardWidth of guard area, in meter
[in]ninxSuggested size along x
[in]ninySuggested size along y
[in]padIncrease nx, ny to power of 2
[in]squareFull square/rectangular grid

◆ d2map()

map_t* d2map ( const dmat in)

convert a dmat to map_t.

keywords are used to specify parameters:

  • the sampling (dx or D; strong recommended; default to 1/64; also specify dy if spacing is different.),
  • layer heiht (default to 0),
  • frozen flow speed (vx, vy)
  • origin (ox, oy; will use nx/2*dx or ny/2*dy if not specified)
  • for DM grid only: inter-actuator-coupling (iac)

◆ dcell2map()

mapcell* dcell2map ( const dcell in)

convert a mmap'ed dcell to map_t array

◆ d2rmap()

rmap_t* d2rmap ( const dmat in)

convert a dmat to rmap_t.

keywords are used to specify parameters:

  • the sampling (dx or D; strong recommended; default to 1/64; also specify dy if spacing is different.),
  • origin (ox, oy; will use nx/2*dx or ny/2*dy if not specified)
  • txdeg, dydeg: tilt of surface in degree wrt beam. only 1 can be less than 90 degree.
  • ftel: focal length of the telescope
  • fexit: distance from exit pupil to focus
  • fsurf distance from surface to focu

◆ dcell2rmap()

rmap_t** dcell2rmap ( int *  nlayer,
const dcell in 
)

convert a mmap'ed dcell to map_t array

◆ map_header()

void map_header ( map_t map)

convert fields to keyword string

◆ rmap_header()

void rmap_header ( rmap_t map)

convert fields to keyword string