7#ifndef wooferTweeterRecon_hpp
8#define wooferTweeterRecon_hpp
12#include <mx/improc/eigenCube.hpp>
13#include <mx/improc/eigenImage.hpp>
14#include <mx/sigproc/gramSchmidt.hpp>
15#include <mx/math/templateBLAS.hpp>
17#include "../../libMagAOX/libMagAOX.hpp"
18#include "../../magaox_git_version.h"
58 return "tweeterModes";
63 return "tweeterModes";
310 config.add(
"integrator.fpsSource",
312 "integrator.fpsSource",
318 "Device name for getting fps of the loop. This device should have *.fps.current. Default is camwfs" );
320 config.add(
"woofer.offset",
328 "Offset, in seconds, for the woofer command from its write time" );
330 config.add(
"tweeter.offset",
338 "Offset, in seconds, for the tweeter command from its write time" );
340 config.add(
"wfs.offset",
348 "Offset, in seconds, for the wfs from its acquisition time and 1/fps" );
436 float cz =
pow( cos( 3.14159 / 180. * ( 90 -
m_el ) ), 3 / 5. );
452 float r01 = mx::math::vectorMean(
cr0 );
473 float r010 = mx::math::vectorMean(
cr0 );
490 "fwhm_10sec_zenith" },
524 std::cerr <<
"woofer modes not ready\n";
535 mx::sys::milliSleep( 1000 );
546 val.reconstructed =
false;
551 std::cerr <<
"woofer modes ready\n";
587 std::cerr <<
"tweeter modes not ready\n";
591 m_r0.resize( 3600*30, 0 );
592 m_sig.resize( 3600*30,0 );
597 val.reconstructed =
false;
603 std::cerr <<
"tweeter modes ready\n";
634 std::cerr <<
"wfs modes not ready\n";
644 mx::sys::milliSleep( 1000 );
655 val.reconstructed =
false;
660 std::cerr <<
"wfs modes ready\n";
690 st = m_wfsVals.size(); \
698 std::cerr <<
"we're behind!\n";
833 float r0 =
pow( 1.0299 *
pow( 6.5, 5. / 3. ) / ( 4 *
var *
pow( 2 * 3.14159 / 0.5, 2 ) ), 3. / 5. );
852 std::cerr <<
"we're behind more\n";
867 if(
ipRecv.getName() != m_indiP_fpsSource.getName() )
869 log<software_error>( { __FILE__, __LINE__,
"Invalid INDI property." } );
873 if(
ipRecv.find(
"current" ) !=
true )
878 std::lock_guard<std::mutex> guard( m_indiMutex );
880 realT fps =
ipRecv[
"current"].get<
float>();
891 m_invFps = 1.0 / m_fps;
902 if(
ipRecv.getName() != m_indiP_elSource.getName() )
904 log<software_error>( { __FILE__, __LINE__,
"Invalid INDI property." } );
908 if(
ipRecv.find(
"el" ) !=
true )
913 std::lock_guard<std::mutex> guard( m_indiMutex );
915 m_el =
ipRecv[
"el"].get<
float>();
The base-class for XWCTk applications.
stateCodes::stateCodeT state()
Get the current state code.
static int log(const typename logT::messageT &msg, logPrioT level=logPrio::LOG_DEFAULT)
Make a log entry.
int createROIndiNumber(pcf::IndiProperty &prop, const std::string &propName, const std::string &propLabel="", const std::string &propGroup="")
Create a ReadOnly INDI Number property.
int registerIndiPropertyReadOnly(pcf::IndiProperty &prop)
Register an INDI property which is read only.
std::mutex m_indiMutex
Mutex for locking INDI communications.
uint32_t m_width
The width of the images in the stream.
IMAGE m_imageStream
The ImageStreamIO shared memory buffer.
bool m_restart
Flag indicating tha the shared memory should be reinitialized.
#define INDI_SETCALLBACK_DEFN(class, prop)
Define the callback for a set property request.
#define REG_INDI_SETPROP(prop, devName, propName)
Register a SET INDI property with the class, using the standard callback name.
@ OPERATING
The device is operating, other than homing.
const pcf::IndiProperty & ipRecv
updateIfChanged(m_indiP_angle, "target", m_angle)
std::unique_lock< std::mutex > lock(m_indiMutex)
#define SHMIMMONITORT_APP_STARTUP(SHMIMMONITORT)
Call shmimMonitorT::appStartup with error checking for a typedef-ed shmimMonitor.
#define SHMIMMONITORT_UPDATE_INDI(SHMIMMONITORT)
Call shmimMonitorT::updateINDI with error checking for a typedef-ed shmimMonitor.
#define SHMIMMONITORT_SETUP_CONFIG(SHMIMMONITORT, cfig)
Call shmimMonitorT::setupConfig with error checking for a typedef-ed shmimMonitor.
#define SHMIMMONITORT_APP_LOGIC(SHMIMMONITORT)
Call shmimMonitorT::appLogic with error checking for a typedef-ed shmimMonitor.
#define SHMIMMONITORT_APP_SHUTDOWN(SHMIMMONITORT)
Call shmimMonitorT::appShutodwn with error checking for a typedef-ed shmimMonitor.
#define SHMIMMONITORT_LOAD_CONFIG(SHMIMMONITORT, cfig)
Call shmimMonitorT::loadConfig with error checking for a typedef-ed shmimMonitor.
static std::string configSection()
static std::string indiPrefix()
static std::string configSection()
static std::string indiPrefix()
Log entry recording the build-time git state.
Log entry recording the build-time git state.