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

Focal Plane AO control. More...

#include <stdint.h>
#include <unistd.h>
#include <malloc.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <math.h>
#include <sys/file.h>
#include <sys/mman.h>
#include <err.h>
#include <fcntl.h>
#include <sched.h>
#include <ncurses.h>
#include <semaphore.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_eigen.h>
#include <gsl/gsl_blas.h>
#include <pthread.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 "linopt_imtools/linopt_imtools.h"
#include "AOloopControl/AOloopControl.h"
#include "image_filter/image_filter.h"
#include "info/info.h"
#include "ZernikePolyn/ZernikePolyn.h"
#include "image_gen/image_gen.h"
#include "statistic/statistic.h"
#include "AOloopControl_IOtools/AOloopControl_IOtools.h"
#include "FPAOloopControl/FPAOloopControl.h"
Include dependency graph for FPAOloopControl.c:

Macros

#define MODULE_SHORTNAME_DEFAULT   ""
 
#define MODULE_DESCRIPTION   "Focal place AO loop control"
 
#define MODULE_APPLICATION   "cacao"
 
#define _GNU_SOURCE
 
#define FPAOconfname   "/tmp/FPAOconf.shm"
 

Functions

errno_t FPAOloopControl_loadconfigure_cli ()
 
errno_t FPAOloopControl_showparams_cli ()
 
errno_t FPAOloopControl_set_hardwlatency_frame_cli ()
 
errno_t FPAOloopControl_MeasureResp_level1_cli ()
 
errno_t FPAOloopControl_MakeLinComb_seq_cli ()
 
static errno_t init_module_CLI ()
 
errno_t FPAOloopControl_InitializeMemory (__attribute__((unused)) int mode)
 
errno_t FPAOloopControl_loadconfigure (long loop, __attribute__((unused)) int mode, __attribute__((unused)) int level)
 
int FPAOloopControl_showparams (long loop)
 
int FPAOloopControl_set_hardwlatency_frame (float hardwlatency_frame)
 
int FPAOloopControl_Read_cam_frame (long loop, int semindex)
 
long FPAO_Measure_WFSrespC (long loop, long delayfr, long delayRM1us, long NBave, long NBexcl, char *IDpokeC_name, char *IDoutC_name, int FPAOinitMode, long NBcycle)
 
long FPAOloopControl_MeasureResp_level1 (float ampl, long delayfr, long delayRM1us, long NBave, long NBexcl, int FPAOinitMode, long NBiter)
 
long FPAOloopControl_MakeLinComb_seq (char *IDpC_name, long xsize0, long ysize0, long NBmaster0, long N, char *IDout_name)
 

Variables

static long NB_FPAOloopcontrol = 1
 
static long FPLOOPNUMBER = 0
 
static int FPAOloopcontrol_meminit = 0
 
static int FPAOlooploadconf_init = 0
 
FPAOLOOPCONTROL_CONFFPAOconf
 
static float * arrayftmp
 
static unsigned short * arrayutmp
 
static int FPcamReadInit = 0
 
static long FPaoconfID_wfsim = -1
 
static long FPaoconfID_imWFS0 = -1
 
static long FPaoconfID_imWFS1 = -1
 
static long FPaoconfID_wfsdark = -1
 
static long FPaoconfID_dmC = -1
 
static long FPaoconfID_dmRM = -1
 
static int FPAO_loadcreateshm_log
 
static FILE * FPAO_loadcreateshm_fplog
 

Detailed Description

Focal Plane AO control.

Wavefront control for high contrast imaging Uses focal plane image(s) as wavefront sensor

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ FPAOconfname

#define FPAOconfname   "/tmp/FPAOconf.shm"

◆ MODULE_APPLICATION

#define MODULE_APPLICATION   "cacao"

◆ MODULE_DESCRIPTION

#define MODULE_DESCRIPTION   "Focal place AO loop control"

◆ MODULE_SHORTNAME_DEFAULT

#define MODULE_SHORTNAME_DEFAULT   ""

Function Documentation

◆ FPAO_Measure_WFSrespC()

long FPAO_Measure_WFSrespC ( long  loop,
long  delayfr,
long  delayRM1us,
long  NBave,
long  NBexcl,
char *  IDpokeC_name,
char *  IDoutC_name,
int  FPAOinitMode,
long  NBcycle 
)

Measures image response to a series of DM patterns

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

◆ FPAOloopControl_InitializeMemory()

errno_t FPAOloopControl_InitializeMemory ( __attribute__((unused)) int  mode)

◆ FPAOloopControl_loadconfigure()

errno_t FPAOloopControl_loadconfigure ( long  loop,
__attribute__((unused)) int  mode,
__attribute__((unused)) int  level 
)

◆ FPAOloopControl_loadconfigure_cli()

errno_t FPAOloopControl_loadconfigure_cli ( )

◆ FPAOloopControl_MakeLinComb_seq()

long FPAOloopControl_MakeLinComb_seq ( char *  IDpC_name,
long  xsize0,
long  ysize0,
long  NBmaster0,
long  N,
char *  IDout_name 
)

◆ FPAOloopControl_MakeLinComb_seq_cli()

errno_t FPAOloopControl_MakeLinComb_seq_cli ( )

◆ FPAOloopControl_MeasureResp_level1()

long FPAOloopControl_MeasureResp_level1 ( float  ampl,
long  delayfr,
long  delayRM1us,
long  NBave,
long  NBexcl,
int  FPAOinitMode,
long  NBiter 
)

◆ FPAOloopControl_MeasureResp_level1_cli()

errno_t FPAOloopControl_MeasureResp_level1_cli ( )

◆ FPAOloopControl_Read_cam_frame()

int FPAOloopControl_Read_cam_frame ( long  loop,
int  semindex 
)

Read image from WFS camera

supports ring buffer puts image from camera buffer aoconfID_wfsim into aoconfID_imWFS1 (supplied by user)

◆ FPAOloopControl_set_hardwlatency_frame()

int FPAOloopControl_set_hardwlatency_frame ( float  hardwlatency_frame)

◆ FPAOloopControl_set_hardwlatency_frame_cli()

errno_t FPAOloopControl_set_hardwlatency_frame_cli ( )

◆ FPAOloopControl_showparams()

int FPAOloopControl_showparams ( long  loop)

◆ FPAOloopControl_showparams_cli()

errno_t FPAOloopControl_showparams_cli ( )

◆ init_module_CLI()

static errno_t init_module_CLI ( )
static

Variable Documentation

◆ arrayftmp

float* arrayftmp
static

◆ arrayutmp

unsigned short* arrayutmp
static

◆ FPAO_loadcreateshm_fplog

FILE* FPAO_loadcreateshm_fplog
static

◆ FPAO_loadcreateshm_log

int FPAO_loadcreateshm_log
static
Initial value:
=
0

◆ FPAOconf

◆ FPaoconfID_dmC

long FPaoconfID_dmC = -1
static

◆ FPaoconfID_dmRM

long FPaoconfID_dmRM = -1
static

◆ FPaoconfID_imWFS0

long FPaoconfID_imWFS0 = -1
static

◆ FPaoconfID_imWFS1

long FPaoconfID_imWFS1 = -1
static

◆ FPaoconfID_wfsdark

long FPaoconfID_wfsdark = -1
static

◆ FPaoconfID_wfsim

long FPaoconfID_wfsim = -1
static

◆ FPAOloopcontrol_meminit

int FPAOloopcontrol_meminit = 0
static

◆ FPAOlooploadconf_init

int FPAOlooploadconf_init = 0
static

◆ FPcamReadInit

int FPcamReadInit = 0
static

◆ FPLOOPNUMBER

long FPLOOPNUMBER = 0
static

◆ NB_FPAOloopcontrol

long NB_FPAOloopcontrol = 1
static