cacao  Release 0.1.03-dev
Compute And Control For Adaptive Optics
AOloopControl_computeCalib_modes.c File Reference
#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_modes.c:

Macros

#define _GNU_SOURCE
 
#define MAX_MBLOCK   20
 

Functions

imageID AOloopControl_computeCalib_mkModes (const char *ID_name, uint32_t msizex, uint32_t msizey, float CPAmax, float deltaCPA, double xc, double yc, double r0, double r1, int MaskMode, int BlockNB, float SVDlim, char *stagedir)
 
imageID AOloopControl_computeCalib_mkModes_Simple (const char *IDin_name, long NBmblock, long Cmblock, float SVDlim)
 
errno_t AOloopControl_computeCalib_mkCalib_map_mask (long loop, const char *zrespm_name, const char *WFSmap_name, const char *DMmap_name, float dmmask_perclow, float dmmask_coefflow, float dmmask_perchigh, float dmmask_coeffhigh, float wfsmask_perclow, float wfsmask_coefflow, float wfsmask_perchigh, float wfsmask_coeffhigh)
 

Variables

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

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ MAX_MBLOCK

#define MAX_MBLOCK   20

Function Documentation

◆ AOloopControl_computeCalib_mkCalib_map_mask()

errno_t AOloopControl_computeCalib_mkCalib_map_mask ( long  loop,
const char *  zrespm_name,
const char *  WFSmap_name,
const char *  DMmap_name,
float  dmmask_perclow,
float  dmmask_coefflow,
float  dmmask_perchigh,
float  dmmask_coeffhigh,
float  wfsmask_perclow,
float  wfsmask_coefflow,
float  wfsmask_perchigh,
float  wfsmask_coeffhigh 
)

◆ AOloopControl_computeCalib_mkModes()

imageID AOloopControl_computeCalib_mkModes ( const char *  ID_name,
uint32_t  msizex,
uint32_t  msizey,
float  CPAmax,
float  deltaCPA,
double  xc,
double  yc,
double  r0,
double  r1,
int  MaskMode,
int  BlockNB,
float  SVDlim,
char *  stagedir 
)

CPA for each Zernike (somewhat arbitrary... used to sort modes in CPA)

STEP 1: CREATE STARTING POINT : ZERNIKES + FOURIER MODES

if Mmask exists, use it, otherwise create it

extract xc and yc from mask

Remove excluded modes if they exist

Remove excluded modes if they exist

COMPUTE WFS RESPONSE TO MODES -> fmodesWFS00all.fits

STEP 2: SEPARATE DM MODES INTO BLOCKS AND MASK

STEP 3: REMOVE NULL SPACE WITHIN EACH BLOCK - USE SVDlim00 FOR CUTOFF -> fmodes1all.fits (DM space)

STEP 4: REMOVE MODES THAT ARE CONTAINED IN PREVIOUS BLOCKS, AND ENFORCE DM-SPACE ORTHOGONALITY BETWEEN BLOCKS -> fmodes2all.fits (DM space) fmodes1all -> fmodes2all

STEP 5: REMOVE NULL SPACE WITHIN EACH BLOCK - USE SVDlim01 FOR CUTOFF -> fmodes2ball.fits (DM space)

STEP 6: COMPUTE WFS RESPONSE TO MODES fmodes2ball -> fmodesWFS0all.fits

Load ... or create WFS mask

STEP 7: REMOVE WFS MODES THAT ARE CONTAINED IN PREVIOUS BLOCKS, AND ENFORCE WFS-SPACE ORTHOGONALITY BETWEEN BLOCKS Input: fmodesWFS0all (corresponding to fmodes2ball) Output -> fmodesWFS1all / fmodes3all

STEP 8: SVD WFS SPACE IN EACH BLOCK fmodesWFS1all, fmodes3 -> fmodesall

eigen mode index

WFS MODES, MODAL CONTROL MATRICES

◆ AOloopControl_computeCalib_mkModes_Simple()

imageID AOloopControl_computeCalib_mkModes_Simple ( const char *  IDin_name,
long  NBmblock,
long  Cmblock,
float  SVDlim 
)

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