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

Macros

#define mapwrite(out, A...)   writebin(dmat_cast(out), A)
 
#define mapread(A...)   map_convert(dmat_cast(readbin_id(M_MAP, 0, A)))
 
#define mapcellread(A...)   (mapcell*)cellconvert(readbin_id(M_MAP, 1, A), (cell * (*)(cell *))map_convert)
 
#define mapcellread_mmap(A...)   (mapcell*)cellconvert((cell*)dcellread_mmap(A), (cell * (*)(cell *))map_convert)
 
#define mapcellnew   (mapcell*)cellnew
 
#define mapccellnew   (mapccell*)cellnew
 
#define rmapread(A...)   rmap_convert(dmat_cast(readbin_id(M_RMAP, 0, A)))
 
#define rmapwrite(out, A...)   writebin(dmat_cast(out), A)
 
#define rmapcellnew   (rmapcell*)cellnew
 
#define rmapccellnew   (rmapccell*)cellnew
 
#define rmapfree(A)   cellfree(A)
 
#define mapfree(A)   cellfree(A)
 

Functions

map_tmap_convert (dmat *A)
 Convert a dmat to map object. Ensure that the type is properly initialized.
 
rmap_trmap_convert (dmat *A)
 Convert a dmat to rmap object. Ensure that the type is properly initialized.
 
map_tmapnew (long nx, long ny, real dx, real dy)
 
map_tmapnew2 (map_t *A)
 
map_tmapref (const map_t *A)
 
map_tmapdup (const map_t *A)
 
void mapcircle (map_t *map, real r, real val)
 
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)
 
void map_make_keywords (cell *map)
 
void map_parse_keywords (map_t *in)
 
void rmap_make_keywords (cell *map)
 
void rmap_parse_keywords (rmap_t *in)
 
void map_blend (map_t *atm1, map_t *atm2, long overx, long overy)
 

Detailed Description

This file defines functions relates to map_t, etc.

Function Documentation

◆ map_convert()

map_t * map_convert ( dmat A)

Convert a dmat to map object. Ensure that the type is properly initialized.

Parameters
Ainput dmat object. will be changed in place.
Returns
map_t*

◆ rmap_convert()

rmap_t * rmap_convert ( dmat A)

Convert a dmat to rmap object. Ensure that the type is properly initialized.

Parameters
Ainput dmat object. will be changed in place.
Returns
map_t*

◆ 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.

◆ 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

◆ map_make_keywords()

void map_make_keywords ( cell p)

convert fields to keyword string

◆ map_parse_keywords()

void map_parse_keywords ( map_t map)

parse keywords for 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)

◆ rmap_make_keywords()

void rmap_make_keywords ( cell p)

convert fields to keyword string

◆ rmap_parse_keywords()

void rmap_parse_keywords ( rmap_t map)

Parse keywords for 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

◆ map_blend()

void map_blend ( map_t atm1,
map_t atm2,
long  overx,
long  overy 
)

blend atm1 with atm2 according to wind direction angle and required overlapping region of at least overx*overy. Not used.