cacao  Release 0.1.03-dev
Compute And Control For Adaptive Optics
AOloopControl_acquireCalib.h File Reference

Function prototypes for Adaptive Optics Control loop engine acquire calibration. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void __attribute__ ((constructor)) libinit_AOloopControl_acquireCalib()
 Initialize module. More...
 
AOloopControl_acquireCalib - 1. ACQUIRING CALIBRATION

Measure system response

imageID AOloopControl_acquireCalib_mkRandomLinPokeSequence (char *IDmodeC_name, long NBpokemap, char *IDpokemapC_name, char *IDpokeC_name)
 
imageID AOloopControl_acquireCalib_Measure_WFSrespC (long loop, long delayfr, long delayRM1us, uint32_t NBave, uint32_t NBexcl, const char *IDpokeC_name, const char *IDoutC_name, int normalize, int AOinitMode, uint32_t NBcycle, uint32_t SequInitMode)
 Acquire WFS response to a series of DM pattern. More...
 
errno_t AOcontrolLoop_acquireCalib_Measure_WFS_linResponse_FPCONF ()
 Measure linear response to set of DM modes/patterns. More...
 
errno_t AOcontrolLoop_acquireCalib_Measure_WFS_linResponse_RUN ()
 
errno_t AOloopControl_acquireCalib_Measure_WFS_linResponse (__attribute__((unused)) long loop, __attribute__((unused)) float ampl, __attribute__((unused)) long delayfr, __attribute__((unused)) long delayRM1us, __attribute__((unused)) long NBave, __attribute__((unused)) long NBexcl, __attribute__((unused)) const char *IDpokeC_name, __attribute__((unused)) const char *IDrespC_name, __attribute__((unused)) const char *IDwfsref_name, __attribute__((unused)) int normalize, __attribute__((unused)) int AOinitMode, __attribute__((unused)) long NBcycle, __attribute__((unused)) long NBinnerCycle)
 
imageID AOloopControl_acquireCalib_Measure_zonalRM (long loop, double ampl, long delayfr, long delayRM1us, uint32_t NBave, uint32_t NBexcl, const char *zrespm_name, const char *WFSref0_name, const char *WFSmap_name, const char *DMmap_name, long mode, int normalize, int AOinitMode, uint32_t NBcycle)
 
errno_t AOloopControl_acquireCalib_Measure_Resp_Matrix (long loop, uint32_t NbAve, float amp, long nbloop, long fDelay, uint64_t NBiter)
 
long AOloopControl_acquireCalib_RespMatrix_Fast (const char *DMmodes_name, const char *dmRM_name, const char *imWFS_name, long semtrig, float HardwareLag, float loopfrequ, float ampl, const char *outname)
 
long AOloopControl_acquireCalib_RMseries_deinterlace (int NBRM, int refstart, int refend, char *IDout_name, int dmode, int NBtstep)
 

Detailed Description

Function prototypes for Adaptive Optics Control loop engine acquire calibration.

AO engine uses stream data structure

Function Documentation

◆ __attribute__()

void __attribute__ ( (constructor)  )

Initialize module.

◆ AOcontrolLoop_acquireCalib_Measure_WFS_linResponse_FPCONF()

errno_t AOcontrolLoop_acquireCalib_Measure_WFS_linResponse_FPCONF ( )

Measure linear response to set of DM modes/patterns.

◆ AOcontrolLoop_acquireCalib_Measure_WFS_linResponse_RUN()

errno_t AOcontrolLoop_acquireCalib_Measure_WFS_linResponse_RUN ( )

◆ AOloopControl_acquireCalib_Measure_Resp_Matrix()

errno_t AOloopControl_acquireCalib_Measure_Resp_Matrix ( long  loop,
uint32_t  NbAve,
float  amp,
long  nbloop,
long  fDelay,
uint64_t  NBiter 
)

measures response matrix AND reference

local arrays for image acquision

◆ AOloopControl_acquireCalib_Measure_WFS_linResponse()

errno_t AOloopControl_acquireCalib_Measure_WFS_linResponse ( __attribute__((unused)) long  loop,
__attribute__((unused)) float  ampl,
__attribute__((unused)) long  delayfr,
__attribute__((unused)) long  delayRM1us,
__attribute__((unused)) long  NBave,
__attribute__((unused)) long  NBexcl,
__attribute__((unused)) const char *  IDpokeC_name,
__attribute__((unused)) const char *  IDrespC_name,
__attribute__((unused)) const char *  IDwfsref_name,
__attribute__((unused)) int  normalize,
__attribute__((unused)) int  AOinitMode,
__attribute__((unused)) long  NBcycle,
__attribute__((unused)) long  NBinnerCycle 
)
Parameters
delayRM1usFrame delay [# of frame]
NBaveSub-frame delay [us]
NBexclNumber of frames averaged for a single poke measurement
IDpokeC_nameNumber of frames excluded
NBinnerCycleNumber of measurement cycles to be repeated Number of inner cycles (how many consecutive times should a single +/- poke be repeated)

◆ AOloopControl_acquireCalib_Measure_WFSrespC()

imageID AOloopControl_acquireCalib_Measure_WFSrespC ( long  loop,
long  delayfr,
long  delayRM1us,
uint32_t  NBave,
uint32_t  NBexcl,
const char *  IDpokeC_name,
const char *  IDoutC_name,
int  normalize,
int  AOinitMode,
uint32_t  NBcycle,
uint32_t  SequInitMode 
)

Acquire WFS response to a series of DM pattern.

Purpose

Acquire WFS response to a series of DM patterns.

Arguments

Parameters
[in]loopLoop index
[in]delayfrInteger delay [frame]
[in]delayRM1usFractional delay [us]
[in]NBaveNumber of frames averaged per DM state
[in]NBexclNumber of frames excluded
[in]IDpokeC_namePoke pattern
[out]IDoutC_nameOutput cube
[in]normalizeNormalize flag
[in]AOinitModeAO structure initialization flag
[in]NBcycleNumber of cycles averaged (outer)
[in]SequInitModeSequence initialization mode bitmask 0x01 swap pairs every 4 indices 0x02 adjacent pairs are swapped between cycles

AOinitMode = 0: create AO shared mem struct AOinitMode = 1: connect only to AO shared mem struct

INPUT : DMpoke_name : set of DM patterns OUTPUT : WFSmap_name : WFS response maps

USR1 signal will stop acquisition immediately USR2 signal completes current cycles and stops acquisition

Returns
IDoutC

DETAILS, STEPS

If NBcycle is set to zero, then the process should run in an infinite loop. The process will then run until receiving USR1.

A temporary array is created and initialized to hold the WFS response to each poke mode.

WFS frames will arrive in aol_imWFS1

A temporary array is created to hold the DM command

Memory is allocated to arrays

Poke sequence defines the sequence of mode poked

The outermost loop increments the measurement cycle. Signal is to be averaged among cycles. Each measurement cycle repeats the same sequence.

First inner loop increment poke mode

◆ AOloopControl_acquireCalib_Measure_zonalRM()

imageID AOloopControl_acquireCalib_Measure_zonalRM ( long  loop,
double  ampl,
long  delayfr,
long  delayRM1us,
uint32_t  NBave,
uint32_t  NBexcl,
const char *  zrespm_name,
const char *  WFSref0_name,
const char *  WFSmap_name,
const char *  DMmap_name,
long  mode,
int  normalize,
int  AOinitMode,
uint32_t  NBcycle 
)

Measures zonal response matrix -> collapses it to DM response map and WFS response map (both maps show amplitude of actuator effect on WFS)

mode : 0: compute WFSmap and DMmap 1: compute WFSmap, DMmap, WFSmask and DMmask -> images wfsmask and dmmask NOTE can take custom poke matrix (loaded in image name RMpokeCube)

ASYNC = 1 -> record ALL frames and assemble the RM off-line

AOinitMode = 0: create AO shared mem struct AOinitMode = 1: connect only to AO shared mem struct

◆ AOloopControl_acquireCalib_mkRandomLinPokeSequence()

imageID AOloopControl_acquireCalib_mkRandomLinPokeSequence ( char *  IDmodeC_name,
long  NBpokemap,
char *  IDpokemapC_name,
char *  IDpokeC_name 
)

◆ AOloopControl_acquireCalib_RespMatrix_Fast()

long AOloopControl_acquireCalib_RespMatrix_Fast ( const char *  DMmodes_name,
const char *  dmRM_name,
const char *  imWFS_name,
long  semtrig,
float  HardwareLag,
float  loopfrequ,
float  ampl,
const char *  outname 
)

◆ AOloopControl_acquireCalib_RMseries_deinterlace()

long AOloopControl_acquireCalib_RMseries_deinterlace ( int  NBRM,
int  refstart,
int  refend,
char *  IDout_name,
int  dmode,
int  NBtstep 
)

Purpose

Processes a series of RMs that are overlapping in time

Arguments

Input RMs are named imrespC_000, imrespC_001 etc...
They are assumed to be regularly spaced in time
In each of these RM cubes, the z axis is time, increments by 1 frame
The reference is built by integrating from time refstart to refend as measured from the first RMsequence