cfitsTK
AOloopControl.c File Reference

Adaptive Optics Control loop engine. More...

Functions

int clock_gettime (int clk_id, struct mach_timespec *t)
 
AOloopControl - 1. INITIALIZATION, configurations
int_fast8_t AOloopControl_loadconfigure_cli ()
 CLI function for AOloopControl_loadconfigure. More...
 
float AOloopControl_readParam_float (char *paramname, float defaultValue, FILE *fplog)
 
int AOloopControl_readParam_int (char *paramname, int defaultValue, FILE *fplog)
 
char * AOloopControl_readParam_string (char *paramname, char *defaultValue, FILE *fplog)
 
int_fast8_t AOloopControl_loadconfigure (long loop, int mode, int level)
 Load configuation parameters from disk. More...
 
int_fast8_t AOloopControl_InitializeMemory (int mode)
 
AOloopControl - 6. REAL TIME COMPUTING ROUTINES
int_fast8_t AOloopControl_WFSzpupdate_loop_cli ()
 CLI function for AOloopControl_WFSzpupdate_loop. More...
 
int_fast8_t AOloopControl_WFSzeropoint_sum_update_loop_cli ()
 CLI function for AOloopControl_WFSzeropoint_sum_update_loop. More...
 
int_fast8_t AOloopControl_CompModes_loop_cli ()
 CLI function for AOloopControl_CompModes_loop. More...
 
int_fast8_t AOloopControl_GPUmodecoeffs2dm_filt_loop_cli ()
 CLI function for AOloopControl_GPUmodecoeffs2dm_filt. More...
 
int_fast8_t AOloopControl_computeWFSresidualimage_cli ()
 CLI function for AOloopControl_computeWFSresidualimage. More...
 
int_fast8_t AOloopControl_ComputeOpenLoopModes_cli ()
 CLI function for AOloopControl_ComputeOpenLoopModes. More...
 
int_fast8_t AOloopControl_AutoTuneGains_cli ()
 CLI function for AOloopControl_AutoTuneGains. More...
 
int_fast8_t AOloopControl_dm2dm_offload_cli ()
 CLI function for AOloopControl_dm2dm_offload. More...
 
int_fast8_t AOloopControl_sig2Modecoeff_cli ()
 CLI function for AOloopControl_sig2Modecoeff. More...
 
int_fast8_t AOloopControl_WFSzpupdate_loop (const char *IDzpdm_name, const char *IDzrespM_name, const char *IDwfszp_name)
 
int_fast8_t AOloopControl_WFSzeropoint_sum_update_loop (long loopnb, const char *ID_WFSzp_name, int NBzp, const char *IDwfsref0_name, const char *IDwfsref_name)
 
int_fast8_t AOloopControl_run ()
 Main loop function. More...
 
int_fast8_t ControlMatrixMultiply (float *cm_array, float *imarray, long m, long n, float *outvect)
 
int_fast8_t set_DM_modes (long loop)
 Sends modal commands to DM by matrix-vector multiplication. More...
 
int_fast8_t set_DM_modesRM (long loop)
 
int_fast8_t AOcompute (long loop, int normalize)
 Main computation function, runs once per loop iteration. More...
 
int_fast8_t AOloopControl_CompModes_loop (const char *ID_CM_name, const char *ID_WFSref_name, const char *ID_WFSim_name, const char *ID_WFSimtot_name, const char *ID_coeff_name)
 
int_fast8_t AOloopControl_GPUmodecoeffs2dm_filt_loop (const char *modecoeffs_name, const char *DMmodes_name, int semTrigg, const char *out_name, int GPUindex, long loop, int offloadMode)
 
long AOloopControl_sig2Modecoeff (const char *WFSim_name, const char *IDwfsref_name, const char *WFSmodes_name, const char *outname)
 
long AOloopControl_computeWFSresidualimage (long loop, char *IDalpha_name)
 
long AOloopControl_ComputeOpenLoopModes (long loop)
 
int_fast8_t AOloopControl_AutoTuneGains (long loop, const char *IDout_name, float GainCoeff, long NBsamples)
 
long AOloopControl_dm2dm_offload (const char *streamin, const char *streamout, float twait, float offcoeff, float multcoeff)
 
AOloopControl - 8. LOOP CONTROL INTERFACE
int_fast8_t AOloopControl_setLoopNumber_cli ()
 CLI function for AOloopControl_setLoopNumber. More...
 
int_fast8_t AOloopControl_setLoopNumber (long loop)
 
int_fast8_t AOloopControl_setparam (long loop, const char *key, double value)
 
AOloopControl - 8.7. LOOP CONTROL INTERFACE - CONTROL LOOP PARAMETERS
int_fast8_t AOloopControl_set_modeblock_gain_cli ()
 CLI function for AOloopControl_set_modeblock_gain. More...
 
int_fast8_t AOloopControl_loopstep_cli ()
 CLI function for AOloopControl_loopstep. More...
 
int_fast8_t AOloopControl_set_loopfrequ_cli ()
 CLI function for AOloopControl_set_loopfrequ. More...
 
int_fast8_t AOloopControl_set_hardwlatency_frame_cli ()
 CLI function for AOloopControl_set_hardwlatency_frame. More...
 
int_fast8_t AOloopControl_set_complatency_frame_cli ()
 CLI function for AOloopControl_set_complatency_frame. More...
 
int_fast8_t AOloopControl_set_wfsmextrlatency_frame_cli ()
 CLI function for AOloopControl_set_wfsmextrlatency_frame. More...
 
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_delta_cli ()
 CLI function for AOloopControl_set_AUTOTUNE_LIMITS_delta. More...
 
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_perc_cli ()
 CLI function for AOloopControl_set_AUTOTUNE_LIMITS_perc. More...
 
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_mcoeff_cli ()
 CLI function for AOloopControl_set_AUTOTUNE_LIMITS_mcoeff. More...
 
int_fast8_t AOloopControl_setgain_cli ()
 CLI function for AOloopControl_setgain. More...
 
int_fast8_t AOloopControl_setARPFgain_cli ()
 CLI function for AOloopControl_setARPFgain. More...
 
int_fast8_t AOloopControl_setWFSnormfloor_cli ()
 CLI function for AOloopControl_setWFSnormfloor. More...
 
int_fast8_t AOloopControl_setmaxlimit_cli ()
 CLI function for AOloopControl_setmaxlimit. More...
 
int_fast8_t AOloopControl_setmult_cli ()
 CLI function for AOloopControl_setmult. More...
 
int_fast8_t AOloopControl_setframesAve_cli ()
 CLI function for AOloopControl_setframesAve. More...
 
int_fast8_t AOloopControl_setgainrange_cli ()
 CLI function for AOloopControl_setgainrange. More...
 
int_fast8_t AOloopControl_setlimitrange_cli ()
 CLI function for AOloopControl_setlimitrange. More...
 
int_fast8_t AOloopControl_setmultfrange_cli ()
 CLI function for AOloopControl_setmultfrange. More...
 
int_fast8_t AOloopControl_setgainblock_cli ()
 CLI function for AOloopControl_setgainblock. More...
 
int_fast8_t AOloopControl_setlimitblock_cli ()
 CLI function for AOloopControl_setlimitblock. More...
 
int_fast8_t AOloopControl_setmultfblock_cli ()
 CLI function for AOloopControl_setmultfblock. More...
 
int_fast8_t AOloopControl_scanGainBlock_cli ()
 CLI function for AOloopControl_scanGainBlock. More...
 
int_fast8_t AOloopControl_setgain (float gain)
 
int_fast8_t AOloopControl_setARPFgain (float gain)
 
int_fast8_t AOloopControl_setWFSnormfloor (float WFSnormfloor)
 
int_fast8_t AOloopControl_setmaxlimit (float maxlimit)
 
int_fast8_t AOloopControl_setmult (float multcoeff)
 
int_fast8_t AOloopControl_setframesAve (long nbframes)
 
int_fast8_t AOloopControl_set_modeblock_gain (long loop, long blocknb, float gain, int add)
 
int_fast8_t AOloopControl_scanGainBlock (long NBblock, long NBstep, float gainStart, float gainEnd, long NBgain)
 
AOloopControl - 10. FOCAL PLANE SPECKLE MODULATION / CONTROL
int_fast8_t AOloopControl_DMmodulateAB_cli ()
 CLI function for AOloopControl_DMmodulateAB. More...
 
int_fast8_t AOloopControl_OptimizePSF_LO (const char *psfstream_name, const char *IDmodes_name, const char *dmstream_name, long delayframe, long NBframes)
 
int_fast8_t AOloopControl_DMmodulateAB (const char *IDprobeA_name, const char *IDprobeB_name, const char *IDdmstream_name, const char *IDrespmat_name, const char *IDwfsrefstream_name, double delay, long NBprobes)
 
AOloopControl - 11. PROCESS LOG FILES
int_fast8_t AOloopControl_logprocess_modeval_cli ()
 CLI function for AOloopControl_logprocess_modeval. More...
 
int_fast8_t AOloopControl_setparam_cli ()
 
int_fast8_t AOloopControl_logprocess_modeval (const char *IDname)
 
long AOloopControl_TweakRM (char *ZRMinname, char *DMinCname, char *WFSinCname, char *DMmaskname, char *WFSmaskname, char *RMoutname)
 
AOloopControl - 8.1. LOOP CONTROL INTERFACE - MAIN CONTROL : LOOP ON/OFF START/STOP/STEP/RESET
int_fast8_t AOloopControl_loopon ()
 
int_fast8_t AOloopControl_loopoff ()
 
int_fast8_t AOloopControl_loopkill ()
 
int_fast8_t AOloopControl_loopstep (long loop, long NBstep)
 
int_fast8_t AOloopControl_loopreset ()
 
AOloopControl - 8.3. LOOP CONTROL INTERFACE - PRIMARY AND FILTERED DM WRITE
int_fast8_t AOloopControl_DMprimaryWrite_on ()
 
int_fast8_t AOloopControl_DMprimaryWrite_off ()
 
int_fast8_t AOloopControl_DMfilteredWrite_on ()
 
int_fast8_t AOloopControl_DMfilteredWrite_off ()
 
AOloopControl - 8.4. LOOP CONTROL INTERFACE - INTEGRATOR AUTO TUNING
int_fast8_t AOloopControl_AUTOTUNE_LIMITS_on ()
 
int_fast8_t AOloopControl_AUTOTUNE_LIMITS_off ()
 
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_delta (float AUTOTUNE_LIMITS_delta)
 
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_perc (float AUTOTUNE_LIMITS_perc)
 
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_mcoeff (float AUTOTUNE_LIMITS_mcoeff)
 
int_fast8_t AOloopControl_AUTOTUNE_GAINS_on ()
 
int_fast8_t AOloopControl_AUTOTUNE_GAINS_off ()
 
AOloopControl - 8.5. LOOP CONTROL INTERFACE - PREDICTIVE FILTER ON/OFF
int_fast8_t AOloopControl_ARPFon ()
 
int_fast8_t AOloopControl_ARPFoff ()
 
AOloopControl - 8.6. LOOP CONTROL INTERFACE - TIMING PARAMETERS
int_fast8_t AOloopControl_set_loopfrequ (float loopfrequ)
 
int_fast8_t AOloopControl_set_hardwlatency_frame (float hardwlatency_frame)
 
int_fast8_t AOloopControl_set_complatency_frame (float complatency_frame)
 
int_fast8_t AOloopControl_set_wfsmextrlatency_frame (float wfsmextrlatency_frame)
 
AOloopControl - 12. OBSOLETE ?
int_fast8_t AOloopControl_setgainrange (long m0, long m1, float gainval)
 
int_fast8_t AOloopControl_setlimitrange (long m0, long m1, float limval)
 
int_fast8_t AOloopControl_setmultfrange (long m0, long m1, float multfval)
 
int_fast8_t AOloopControl_setgainblock (long mb, float gainval)
 
int_fast8_t AOloopControl_setlimitblock (long mb, float limitval)
 
int_fast8_t AOloopControl_setmultfblock (long mb, float multfval)
 
int_fast8_t AOloopControl_AutoTune ()
 

Variables

static int AOLOOPCONTROL_logfunc_level = 0
 
static int AOLOOPCONTROL_logfunc_level_max = 2
 
static char AOLOOPCONTROL_logfunc_fname [] = "AOloopControl.fcall.log"
 
static char flogcomment [200]
 
static struct timespec tnow
 
static struct timespec tdiff
 
static double tdiffv
 
static int initWFSref_GPU [100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 
static int initcontrMcact_GPU [100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 
float GPU_alpha = 0.0
 
float GPU_beta = 0.0
 
static int COMPUTE_PIXELSTREAMING = 0
 
int PIXSTREAM_NBSLICES = 1
 
int PIXSTREAM_SLICE
 
long aoconfID_wfsim = -1
 
uint8_t WFSatype
 
long aoconfID_dmC = -1
 
long aoconfID_dmRM = -1
 
long aoconfID_wfsdark = -1
 
long aoconfID_imWFS0 = -1
 
long aoconfID_imWFS0tot = -1
 
long aoconfID_imWFS1 = -1
 
long aoconfID_imWFS2 = -1
 
static long aoconfID_wfsref0 = -1
 
long aoconfID_wfsref = -1
 
static long long aoconfcnt0_wfsref_current = -1
 
long aoconfID_DMmodes = -1
 
static long aoconfID_dmdisp = -1
 
long aoconfID_cmd_modes = -1
 
long aoconfID_meas_modes = -1
 
long aoconfID_RMS_modes = -1
 
long aoconfID_AVE_modes = -1
 
long aoconfID_gainb = -1
 
long aoconfID_multfb = -1
 
long aoconfID_limitb = -1
 
long aoconfID_DMmode_GAIN = -1
 
long aoconfID_LIMIT_modes = -1
 
long aoconfID_MULTF_modes = -1
 
long aoconfID_cmd_modesRM = -1
 
long aoconfID_wfsmask = -1
 
static long aoconfID_dmmask = -1
 
static long aoconfID_respM = -1
 
static long aoconfID_contrM = -1
 
static long long aoconfcnt0_contrM_current = -1
 
static long aoconfID_contrMc = -1
 
static long aoconfID_meas_act = -1
 
static long aoconfID_contrMcact [100] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
 
long aoconfID_pixstream_wfspixindex
 
long aoconfID_looptiming = -1
 
static long NBtimers = 21
 
static long aoconfIDlogdata = -1
 
static long aoconfIDlog0 = -1
 
static long aoconfIDlog1 = -1
 
int * WFS_active_map
 
int * DM_active_map
 
static long aoconfID_meas_act_active
 
static long aoconfID_imWFS2_active [100]
 
float normfloorcoeff = 1.0
 
static long wfsrefcnt0 = -1
 
static long contrMcactcnt0 [100] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
 
static int GPUcntMax = 100
 
static int * GPUset0
 
static int * GPUset1
 
DATA data
 
long LOOPNUMBER = 0
 
int AOloopcontrol_meminit = 0
 
static int AOlooploadconf_init = 0
 
AOLOOPCONTROL_CONFAOconf
 

Detailed Description

Adaptive Optics Control loop engine.

AO engine uses stream data structure

Author
O. Guyon
Date
25 Aug 2017
Bug:
No known bugs.
See also
http://oguyon.github.io/AdaptiveOpticsControl/src/AOloopControl/doc/AOloopControl.html

Function Documentation

int_fast8_t AOcompute ( long  loop,
int  normalize 
)

Main computation function, runs once per loop iteration.

int_fast8_t AOloopControl_ARPFoff ( )
int_fast8_t AOloopControl_ARPFon ( )
int_fast8_t AOloopControl_AutoTune ( )
int_fast8_t AOloopControl_AUTOTUNE_GAINS_off ( )
int_fast8_t AOloopControl_AUTOTUNE_GAINS_on ( )
int_fast8_t AOloopControl_AUTOTUNE_LIMITS_off ( )
int_fast8_t AOloopControl_AUTOTUNE_LIMITS_on ( )
int_fast8_t AOloopControl_AutoTuneGains ( long  loop,
const char *  IDout_name,
float  GainCoeff,
long  NBsamples 
)
int_fast8_t AOloopControl_AutoTuneGains_cli ( )

CLI function for AOloopControl_AutoTuneGains.

int_fast8_t AOloopControl_CompModes_loop ( const char *  ID_CM_name,
const char *  ID_WFSref_name,
const char *  ID_WFSim_name,
const char *  ID_WFSimtot_name,
const char *  ID_coeff_name 
)
int_fast8_t AOloopControl_CompModes_loop_cli ( )

CLI function for AOloopControl_CompModes_loop.

long AOloopControl_ComputeOpenLoopModes ( long  loop)
int_fast8_t AOloopControl_ComputeOpenLoopModes_cli ( )

CLI function for AOloopControl_ComputeOpenLoopModes.

long AOloopControl_computeWFSresidualimage ( long  loop,
char *  IDalpha_name 
)

Purpose

Computes average of residual in WFS

Arguments

Parameters
[in]loopINT loop number
[in]alphaFLOAT averaging coefficient

Output files

  • aol_wfsres_ave
  • aol_wfsres_ave
  • aol_wfsresm
  • aol_wfsresm_ave
  • aol_wfsres_rms
int_fast8_t AOloopControl_computeWFSresidualimage_cli ( )

CLI function for AOloopControl_computeWFSresidualimage.

long AOloopControl_dm2dm_offload ( const char *  streamin,
const char *  streamout,
float  twait,
float  offcoeff,
float  multcoeff 
)
int_fast8_t AOloopControl_dm2dm_offload_cli ( )

CLI function for AOloopControl_dm2dm_offload.

int_fast8_t AOloopControl_DMfilteredWrite_off ( )
int_fast8_t AOloopControl_DMfilteredWrite_on ( )
int_fast8_t AOloopControl_DMmodulateAB ( const char *  IDprobeA_name,
const char *  IDprobeB_name,
const char *  IDdmstream_name,
const char *  IDrespmat_name,
const char *  IDwfsrefstream_name,
double  delay,
long  NBprobes 
)
int_fast8_t AOloopControl_DMmodulateAB_cli ( )

CLI function for AOloopControl_DMmodulateAB.

int_fast8_t AOloopControl_DMprimaryWrite_off ( )
int_fast8_t AOloopControl_DMprimaryWrite_on ( )
int_fast8_t AOloopControl_GPUmodecoeffs2dm_filt_loop ( const char *  modecoeffs_name,
const char *  DMmodes_name,
int  semTrigg,
const char *  out_name,
int  GPUindex,
long  loop,
int  offloadMode 
)
int_fast8_t AOloopControl_GPUmodecoeffs2dm_filt_loop_cli ( )

CLI function for AOloopControl_GPUmodecoeffs2dm_filt.

int_fast8_t AOloopControl_InitializeMemory ( int  mode)
int_fast8_t AOloopControl_loadconfigure_cli ( )

CLI function for AOloopControl_loadconfigure.

int_fast8_t AOloopControl_logprocess_modeval ( const char *  IDname)
int_fast8_t AOloopControl_logprocess_modeval_cli ( )

CLI function for AOloopControl_logprocess_modeval.

int_fast8_t AOloopControl_loopkill ( )
int_fast8_t AOloopControl_loopoff ( )
int_fast8_t AOloopControl_loopon ( )
int_fast8_t AOloopControl_loopreset ( )
int_fast8_t AOloopControl_loopstep ( long  loop,
long  NBstep 
)
int_fast8_t AOloopControl_loopstep_cli ( )

CLI function for AOloopControl_loopstep.

int_fast8_t AOloopControl_OptimizePSF_LO ( const char *  psfstream_name,
const char *  IDmodes_name,
const char *  dmstream_name,
long  delayframe,
long  NBframes 
)
float AOloopControl_readParam_float ( char *  paramname,
float  defaultValue,
FILE *  fplog 
)

Purpose

Read parameter value (float)

Arguments

Parameters
[in]paramnameCHAR* parameter name
[in]defaultValueFLOAT default value if file conf/param_paramname.txt not found
[in]fplogFILE* log file. If NULL, do not log
int AOloopControl_readParam_int ( char *  paramname,
int  defaultValue,
FILE *  fplog 
)

Purpose

Read parameter value (int)

Arguments

Parameters
[in]paramnameCHAR* parameter name
[in]defaultValueINT default value if file conf/param_paramname.txt not found
[in]fplogFILE* log file. If NULL, do not log
char* AOloopControl_readParam_string ( char *  paramname,
char *  defaultValue,
FILE *  fplog 
)

Purpose

Read parameter value (char*)

Arguments

Parameters
[in]paramnameCHAR* parameter name
[in]defaultValueCHAR* default value if file conf/param_paramname.txt not found
[in]fplogFILE* log file. If NULL, do not log
int_fast8_t AOloopControl_run ( )

Main loop function.

Purpose

Main AO loop function

Details

STEP 1: Setting up

Load arrays

int_fast8_t AOloopControl_scanGainBlock ( long  NBblock,
long  NBstep,
float  gainStart,
float  gainEnd,
long  NBgain 
)
int_fast8_t AOloopControl_scanGainBlock_cli ( )

CLI function for AOloopControl_scanGainBlock.

int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_delta ( float  AUTOTUNE_LIMITS_delta)
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_delta_cli ( )

CLI function for AOloopControl_set_AUTOTUNE_LIMITS_delta.

int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_mcoeff ( float  AUTOTUNE_LIMITS_mcoeff)
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_mcoeff_cli ( )

CLI function for AOloopControl_set_AUTOTUNE_LIMITS_mcoeff.

int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_perc ( float  AUTOTUNE_LIMITS_perc)
int_fast8_t AOloopControl_set_AUTOTUNE_LIMITS_perc_cli ( )

CLI function for AOloopControl_set_AUTOTUNE_LIMITS_perc.

int_fast8_t AOloopControl_set_complatency_frame ( float  complatency_frame)
int_fast8_t AOloopControl_set_complatency_frame_cli ( )

CLI function for AOloopControl_set_complatency_frame.

int_fast8_t AOloopControl_set_hardwlatency_frame ( float  hardwlatency_frame)
int_fast8_t AOloopControl_set_hardwlatency_frame_cli ( )

CLI function for AOloopControl_set_hardwlatency_frame.

int_fast8_t AOloopControl_set_loopfrequ ( float  loopfrequ)
int_fast8_t AOloopControl_set_loopfrequ_cli ( )

CLI function for AOloopControl_set_loopfrequ.

int_fast8_t AOloopControl_set_modeblock_gain ( long  loop,
long  blocknb,
float  gain,
int  add 
)
int_fast8_t AOloopControl_set_modeblock_gain_cli ( )

CLI function for AOloopControl_set_modeblock_gain.

int_fast8_t AOloopControl_set_wfsmextrlatency_frame ( float  wfsmextrlatency_frame)
int_fast8_t AOloopControl_set_wfsmextrlatency_frame_cli ( )

CLI function for AOloopControl_set_wfsmextrlatency_frame.

int_fast8_t AOloopControl_setARPFgain ( float  gain)
int_fast8_t AOloopControl_setARPFgain_cli ( )

CLI function for AOloopControl_setARPFgain.

int_fast8_t AOloopControl_setframesAve ( long  nbframes)
int_fast8_t AOloopControl_setframesAve_cli ( )

CLI function for AOloopControl_setframesAve.

int_fast8_t AOloopControl_setgain ( float  gain)
int_fast8_t AOloopControl_setgain_cli ( )

CLI function for AOloopControl_setgain.

int_fast8_t AOloopControl_setgainblock ( long  mb,
float  gainval 
)
int_fast8_t AOloopControl_setgainblock_cli ( )

CLI function for AOloopControl_setgainblock.

int_fast8_t AOloopControl_setgainrange ( long  m0,
long  m1,
float  gainval 
)
int_fast8_t AOloopControl_setgainrange_cli ( )

CLI function for AOloopControl_setgainrange.

int_fast8_t AOloopControl_setlimitblock ( long  mb,
float  limitval 
)
int_fast8_t AOloopControl_setlimitblock_cli ( )

CLI function for AOloopControl_setlimitblock.

int_fast8_t AOloopControl_setlimitrange ( long  m0,
long  m1,
float  limval 
)
int_fast8_t AOloopControl_setlimitrange_cli ( )

CLI function for AOloopControl_setlimitrange.

int_fast8_t AOloopControl_setLoopNumber ( long  loop)

append process name with loop number

int_fast8_t AOloopControl_setLoopNumber_cli ( )

CLI function for AOloopControl_setLoopNumber.

int_fast8_t AOloopControl_setmaxlimit ( float  maxlimit)
int_fast8_t AOloopControl_setmaxlimit_cli ( )

CLI function for AOloopControl_setmaxlimit.

int_fast8_t AOloopControl_setmult ( float  multcoeff)
int_fast8_t AOloopControl_setmult_cli ( )

CLI function for AOloopControl_setmult.

int_fast8_t AOloopControl_setmultfblock ( long  mb,
float  multfval 
)
int_fast8_t AOloopControl_setmultfblock_cli ( )

CLI function for AOloopControl_setmultfblock.

int_fast8_t AOloopControl_setmultfrange ( long  m0,
long  m1,
float  multfval 
)
int_fast8_t AOloopControl_setmultfrange_cli ( )

CLI function for AOloopControl_setmultfrange.

int_fast8_t AOloopControl_setparam ( long  loop,
const char *  key,
double  value 
)
int_fast8_t AOloopControl_setparam_cli ( )
int_fast8_t AOloopControl_setWFSnormfloor ( float  WFSnormfloor)
int_fast8_t AOloopControl_setWFSnormfloor_cli ( )

CLI function for AOloopControl_setWFSnormfloor.

long AOloopControl_sig2Modecoeff ( const char *  WFSim_name,
const char *  IDwfsref_name,
const char *  WFSmodes_name,
const char *  outname 
)
int_fast8_t AOloopControl_sig2Modecoeff_cli ( )

CLI function for AOloopControl_sig2Modecoeff.

long AOloopControl_TweakRM ( char *  ZRMinname,
char *  DMinCname,
char *  WFSinCname,
char *  DMmaskname,
char *  WFSmaskname,
char *  RMoutname 
)
int_fast8_t AOloopControl_WFSzeropoint_sum_update_loop ( long  loopnb,
const char *  ID_WFSzp_name,
int  NBzp,
const char *  IDwfsref0_name,
const char *  IDwfsref_name 
)
int_fast8_t AOloopControl_WFSzeropoint_sum_update_loop_cli ( )

CLI function for AOloopControl_WFSzeropoint_sum_update_loop.

int_fast8_t AOloopControl_WFSzpupdate_loop ( const char *  IDzpdm_name,
const char *  IDzrespM_name,
const char *  IDwfszp_name 
)
int_fast8_t AOloopControl_WFSzpupdate_loop_cli ( )

CLI function for AOloopControl_WFSzpupdate_loop.

int clock_gettime ( int  clk_id,
struct mach_timespec *  t 
)
int_fast8_t ControlMatrixMultiply ( float *  cm_array,
float *  imarray,
long  m,
long  n,
float *  outvect 
)
int_fast8_t set_DM_modes ( long  loop)

Sends modal commands to DM by matrix-vector multiplication.

Purpose

Send modal commands to DM.
Converts mode coefficient to DM map by matrix-vector multiplication
Runs in CPU or GPU.

Takes mode values from aol_DMmode_cmd (ID = aoconfID_cmd_modes)

int_fast8_t set_DM_modesRM ( long  loop)

Variable Documentation

long long aoconfcnt0_contrM_current = -1
static
long long aoconfcnt0_wfsref_current = -1
static
long aoconfID_AVE_modes = -1
long aoconfID_cmd_modes = -1
long aoconfID_cmd_modesRM = -1
long aoconfID_contrM = -1
static
long aoconfID_contrMc = -1
static
long aoconfID_contrMcact[100] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
static
long aoconfID_dmC = -1
long aoconfID_dmdisp = -1
static
long aoconfID_dmmask = -1
static
long aoconfID_DMmode_GAIN = -1
long aoconfID_DMmodes = -1
long aoconfID_dmRM = -1
long aoconfID_gainb = -1
long aoconfID_imWFS0 = -1
long aoconfID_imWFS0tot = -1
long aoconfID_imWFS1 = -1
long aoconfID_imWFS2 = -1
long aoconfID_imWFS2_active[100]
static
long aoconfID_LIMIT_modes = -1
long aoconfID_limitb = -1
long aoconfID_looptiming = -1
long aoconfID_meas_act = -1
static
long aoconfID_meas_act_active
static
long aoconfID_meas_modes = -1
long aoconfID_MULTF_modes = -1
long aoconfID_multfb = -1
long aoconfID_pixstream_wfspixindex
long aoconfID_respM = -1
static
long aoconfID_RMS_modes = -1
long aoconfID_wfsdark = -1
long aoconfID_wfsim = -1
long aoconfID_wfsmask = -1
long aoconfID_wfsref = -1
long aoconfID_wfsref0 = -1
static
long aoconfIDlog0 = -1
static
long aoconfIDlog1 = -1
static
long aoconfIDlogdata = -1
static
char AOLOOPCONTROL_logfunc_fname[] = "AOloopControl.fcall.log"
static
int AOLOOPCONTROL_logfunc_level = 0
static
int AOLOOPCONTROL_logfunc_level_max = 2
static
int AOloopcontrol_meminit = 0
int AOlooploadconf_init = 0
static
int COMPUTE_PIXELSTREAMING = 0
static
long contrMcactcnt0[100] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
static
DATA data
int* DM_active_map
char flogcomment[200]
static
float GPU_alpha = 0.0
float GPU_beta = 0.0
int GPUcntMax = 100
static
int* GPUset0
static
int* GPUset1
static
int initcontrMcact_GPU[100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
static
int initWFSref_GPU[100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
static
long LOOPNUMBER = 0
long NBtimers = 21
static
float normfloorcoeff = 1.0
int PIXSTREAM_NBSLICES = 1
int PIXSTREAM_SLICE
struct timespec tdiff
static
double tdiffv
static
struct timespec tnow
static
int* WFS_active_map
uint8_t WFSatype
long wfsrefcnt0 = -1
static