cacao  Release 0.1.03-dev
Compute And Control For Adaptive Optics
AOloopControl_computeCalib_CM.c File Reference

Adaptive Optics Control loop engine compute calibration. More...

#include <math.h>
#include <stdint.h>
#include <unistd.h>
#include <malloc.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <pthread.h>
#include <time.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_eigen.h>
#include <gsl/gsl_blas.h>
#include <fitsio.h>
#include "CommandLineInterface/CLIcore.h"
#include "00CORE/00CORE.h"
#include "COREMOD_memory/COREMOD_memory.h"
#include "COREMOD_iofits/COREMOD_iofits.h"
#include "COREMOD_tools/COREMOD_tools.h"
#include "COREMOD_arith/COREMOD_arith.h"
#include "info/info.h"
#include "linopt_imtools/linopt_imtools.h"
#include "statistic/statistic.h"
#include "ZernikePolyn/ZernikePolyn.h"
#include "image_filter/image_filter.h"
#include "AOloopControl/AOloopControl.h"
#include "AOloopControl_IOtools/AOloopControl_IOtools.h"
#include "AOloopControl_acquireCalib/AOloopControl_acquireCalib.h"
#include "AOloopControl_computeCalib/AOloopControl_computeCalib.h"
Include dependency graph for AOloopControl_computeCalib_CM.c:

Macros

#define _GNU_SOURCE
 
#define MAX_MBLOCK   20
 

Functions

imageID AOloopControl_computeCalib_compute_ControlMatrix (long loop, __attribute__((unused)) long NB_MODE_REMOVED, const char *ID_Rmatrix_name, const char *ID_Cmatrix_name, const char *ID_VTmatrix_name, double Beta, long NB_MODE_REMOVED_STEP, float eigenvlim)
 Computes control matrix using SVD. More...
 
errno_t AOloopControl_computeCalib_compute_CombinedControlMatrix (const char *IDcmat_name, const char *IDmodes_name, const char *IDwfsmask_name, const char *IDdmmask_name, const char *IDcmatc_name, const char *IDcmatc_active_name)
 
imageID AOloopControl_computeCalib_loadCM (long loop, const char *CMfname)
 

Variables

long LOOPNUMBER
 
AOLOOPCONTROL_CONFAOconf
 CLI function for AOloopControl_setframesAve. More...
 
AOloopControl_var aoloopcontrol_var
 
long aoconfID_imWFS2_active [100]
 

Detailed Description

Adaptive Optics Control loop engine compute calibration.

AO engine uses stream data structure

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ MAX_MBLOCK

#define MAX_MBLOCK   20

Function Documentation

◆ AOloopControl_computeCalib_compute_CombinedControlMatrix()

errno_t AOloopControl_computeCalib_compute_CombinedControlMatrix ( const char *  IDcmat_name,
const char *  IDmodes_name,
const char *  IDwfsmask_name,
const char *  IDdmmask_name,
const char *  IDcmatc_name,
const char *  IDcmatc_active_name 
)

◆ AOloopControl_computeCalib_compute_ControlMatrix()

imageID AOloopControl_computeCalib_compute_ControlMatrix ( long  loop,
__attribute__((unused)) long  NB_MODE_REMOVED,
const char *  ID_Rmatrix_name,
const char *  ID_Cmatrix_name,
const char *  ID_VTmatrix_name,
double  Beta,
long  NB_MODE_REMOVED_STEP,
float  eigenvlim 
)

Computes control matrix using SVD.

Conventions: m: number of actuators (= NB_MODES); n: number of sensors (= # of pixels) works even for m != n

gain applied to modes to enhance low orders in SVD

number of modes removed

in this procedure, m=number of actuators/modes, n=number of WFS elements

Write rotation matrix to go from DM modes to eigenmodes

Compute eigenmodes responses

eigen mode index

if modesM exists, compute eigenmodes using rotation matrix

eigen mode index

second, build the "inverse" of the diagonal matrix of eigenvalues (matrix1)

◆ AOloopControl_computeCalib_loadCM()

imageID AOloopControl_computeCalib_loadCM ( long  loop,
const char *  CMfname 
)

Variable Documentation

◆ AOconf

CLI function for AOloopControl_setframesAve.

◆ aoconfID_imWFS2_active

long aoconfID_imWFS2_active[100]

◆ aoloopcontrol_var

AOloopControl_var aoloopcontrol_var

◆ LOOPNUMBER

long LOOPNUMBER