![]() |
cacao
Release 0.1.03-dev
Compute And Control For Adaptive Optics
|
Function prototypes for Adaptive Optics Control loop engine acquire calibration. More...
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) |
Function prototypes for Adaptive Optics Control loop engine acquire calibration.
AO engine uses stream data structure
void __attribute__ | ( | (constructor) | ) |
Initialize module.
errno_t AOcontrolLoop_acquireCalib_Measure_WFS_linResponse_FPCONF | ( | ) |
Measure linear response to set of DM modes/patterns.
errno_t AOcontrolLoop_acquireCalib_Measure_WFS_linResponse_RUN | ( | ) |
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
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 | ||
) |
delayRM1us | Frame delay [# of frame] |
NBave | Sub-frame delay [us] |
NBexcl | Number of frames averaged for a single poke measurement |
IDpokeC_name | Number of frames excluded |
NBinnerCycle | Number of measurement cycles to be repeated Number of inner cycles (how many consecutive times should a single +/- poke be repeated) |
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.
Acquire WFS response to a series of DM patterns.
[in] | loop | Loop index |
[in] | delayfr | Integer delay [frame] |
[in] | delayRM1us | Fractional delay [us] |
[in] | NBave | Number of frames averaged per DM state |
[in] | NBexcl | Number of frames excluded |
[in] | IDpokeC_name | Poke pattern |
[out] | IDoutC_name | Output cube |
[in] | normalize | Normalize flag |
[in] | AOinitMode | AO structure initialization flag |
[in] | NBcycle | Number of cycles averaged (outer) |
[in] | SequInitMode | Sequence 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
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
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
imageID AOloopControl_acquireCalib_mkRandomLinPokeSequence | ( | char * | IDmodeC_name, |
long | NBpokemap, | ||
char * | IDpokemapC_name, | ||
char * | IDpokeC_name | ||
) |
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 | ||
) |
Processes a series of RMs that are overlapping in time
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