mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::AO::sim::leakyIntegrator< _realT > Class Template Reference

template<typename _realT>
class mx::AO::sim::leakyIntegrator< _realT >

Implements the leaky integrator controller.

Template Parameters
_realTis the floating point type for all calculations.

Definition at line 35 of file leakyIntegrator.hpp.

#include <ao/sim/leakyIntegrator.hpp>

Public Types

typedef _realT realT
 The real data type. More...
 
typedef wavefront< realTwavefrontT
 The wavefront data type. More...
 
typedef wfMeasurement< realTcommandT
 The command type. More...
 
typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic > imageT
 The image type, used here as a general storage array. More...
 

Public Member Functions

 leakyIntegrator ()
 Default c'tor. More...
 
int initialize (int nModes)
 Allocate and initialize all state. More...
 
int nModes ()
 Get the number of modes. More...
 
int openLoop (bool ol)
 Set the _openLoop flag. More...
 
bool openLoop ()
 Get the value of the _openLoop flag. More...
 
int closingDelay (int cd)
 Set _closingDelay. More...
 
int closingDelay ()
 Get the value of the _closingDelay. More...
 
int lowOrders (int lo)
 Set _lowOrders. More...
 
int lowOrders ()
 Get the value of the _lowOrders. More...
 
realT gain (int i)
 Get the gain for a single mode. More...
 
int gain (int i, realT g)
 Set the gain for a single mode. More...
 
int gains (realT g)
 Set the gain for all modes to a single value. More...
 
int gains (const std::vector< realT > &vgains)
 Set the gains for all modes, using a vector to specify each gain. More...
 
int gains (const std::string &ogainf)
 Set the gains for all modes, using a file to specify each gain. More...
 
int leak (int i, realT l)
 Set the leak for a single mode. More...
 
int leaks (realT l)
 Set a leak for all modes. More...
 
int initMeasurements (commandT &filtAmps, commandT &rawAmps)
 Allocate the provided command structures. More...
 
int filterCommands (commandT &filtAmps, commandT &rawAmps, int iterNo)
 Apply the leaky integrator. More...
 

Protected Attributes

int _nModes
 The number of modes being filtered. More...
 
bool _openLoop
 If true, then commands are not integrated. More...
 
int _closingDelay
 If > 0, then the gains are ramped linearly up to this value. Default = 0. More...
 
int _lowOrders
 If > 0, then this sets the maximum mode number which is filtered. All remaining modes are set to 0. Default = 0. More...
 
imageT _gains
 Column-vector of gains. More...
 
imageT _leaks
 Column-vector of leaks. More...
 
imageT _commands
 Column-vector past commands. More...
 

Member Typedef Documentation

◆ commandT

template<typename _realT >
typedef wfMeasurement<realT> mx::AO::sim::leakyIntegrator< _realT >::commandT

The command type.

Definition at line 47 of file leakyIntegrator.hpp.

◆ imageT

template<typename _realT >
typedef Eigen::Array< realT, Eigen::Dynamic, Eigen::Dynamic> mx::AO::sim::leakyIntegrator< _realT >::imageT

The image type, used here as a general storage array.

Definition at line 50 of file leakyIntegrator.hpp.

◆ realT

template<typename _realT >
typedef _realT mx::AO::sim::leakyIntegrator< _realT >::realT

The real data type.

Definition at line 41 of file leakyIntegrator.hpp.

◆ wavefrontT

template<typename _realT >
typedef wavefront<realT> mx::AO::sim::leakyIntegrator< _realT >::wavefrontT

The wavefront data type.

Definition at line 44 of file leakyIntegrator.hpp.

Constructor & Destructor Documentation

◆ leakyIntegrator()

template<typename realT >
mx::AO::sim::leakyIntegrator< realT >::leakyIntegrator

Default c'tor.

Definition at line 206 of file leakyIntegrator.hpp.

Member Function Documentation

◆ closingDelay() [1/2]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::closingDelay

Get the value of the _closingDelay.

Returns
the current value of _closingDelay.

Definition at line 268 of file leakyIntegrator.hpp.

◆ closingDelay() [2/2]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::closingDelay ( int  cd)

Set _closingDelay.

If _closingDelay > 0, then the gains are ramped linearly up to this value.

Returns
0 on success, a negative integer on error.
Parameters
cdThe new value of _closingDelay

Definition at line 260 of file leakyIntegrator.hpp.

◆ filterCommands()

template<class realT >
int mx::AO::sim::leakyIntegrator< realT >::filterCommands ( commandT filtAmps,
commandT rawAmps,
int  iterNo 
)

Apply the leaky integrator.

Returns
0 on success, negative number on error.
Parameters
[out]filtAmpsthe filtered commands
[in]rawAmpsthe raw commands
[in]iterNoThe current iteration number

Definition at line 396 of file leakyIntegrator.hpp.

◆ gain() [1/2]

template<typename realT >
realT mx::AO::sim::leakyIntegrator< realT >::gain ( int  i)

Get the gain for a single mode.

Returns
the gain value if mode exists.
Return values
0if the mode doesn't exist.
Parameters
[in]ithe mode number

Definition at line 288 of file leakyIntegrator.hpp.

◆ gain() [2/2]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::gain ( int  i,
realT  g 
)

Set the gain for a single mode.

Returns
0 on success, negative number on error.
Return values
0if the mode doesn't exist.
Parameters
[in]ithe mode number
[in]gthe new gain value

Definition at line 301 of file leakyIntegrator.hpp.

◆ gains() [1/3]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::gains ( const std::string &  ogainf)

Set the gains for all modes, using a file to specify each gain.

The file format is a simple ASCII single column, with 1 gain per line. Must be exactly as long as _nModes.

Returns
0 on success, negative number on error.
Return values
-1if file open fails
Parameters
[in]ogainfthe name of the file, full path

Definition at line 344 of file leakyIntegrator.hpp.

◆ gains() [2/3]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::gains ( const std::vector< realT > &  vgains)

Set the gains for all modes, using a vector to specify each gain.

The vector must be exactly as long as _nModes.

Returns
0 on success, negative number on error.
Return values
-1on vector size mismatch
Parameters
[in]vgainsvector of gains.

Definition at line 326 of file leakyIntegrator.hpp.

◆ gains() [3/3]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::gains ( realT  g)

Set the gain for all modes to a single value.

Returns
0 on success, negative number on error.
Parameters
[in]gthe new gain value

Definition at line 315 of file leakyIntegrator.hpp.

◆ initialize()

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::initialize ( int  nModes)

Allocate and initialize all state.

Returns
0 on success, a negative integer otherwise.
Parameters
[in]nModesthe number of modes to be filtered

Definition at line 222 of file leakyIntegrator.hpp.

◆ initMeasurements()

template<class realT >
int mx::AO::sim::leakyIntegrator< realT >::initMeasurements ( commandT filtAmps,
commandT rawAmps 
)

Allocate the provided command structures.

Used by the calling system to allocate the commands being passed between components.

Returns
0 on success, negative number on error.
Parameters
filtAmpsThe structure to contain the filtered commands
rawAmpsThe structure to contain the raw commands

Definition at line 384 of file leakyIntegrator.hpp.

◆ leak()

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::leak ( int  i,
realT  l 
)

Set the leak for a single mode.

Returns
0 on success, negative number on error.
Parameters
[in]ithe mode number
[in]lthe new leak value for this mode

Definition at line 370 of file leakyIntegrator.hpp.

◆ leaks()

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::leaks ( realT  l)

Set a leak for all modes.

Returns
0 on success, negative number on error.
Parameters
[in]lthe new leak value to set for all modes

Definition at line 376 of file leakyIntegrator.hpp.

◆ lowOrders() [1/2]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::lowOrders

Get the value of the _lowOrders.

Returns
the current value of _lowOrders.

Definition at line 282 of file leakyIntegrator.hpp.

◆ lowOrders() [2/2]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::lowOrders ( int  lo)

Set _lowOrders.

If _lowOrders > 0, then this sets the maximum mode number which is filtered. All remaining modes are set to 0.

Returns
0 on success, a negative integer on error.
Parameters
loThe new value of _lowOrders

Definition at line 274 of file leakyIntegrator.hpp.

◆ nModes()

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::nModes

Get the number of modes.

nModes is only set by calling initialize.

Returns
the current value of _nModes

Definition at line 241 of file leakyIntegrator.hpp.

◆ openLoop() [1/2]

template<typename realT >
bool mx::AO::sim::leakyIntegrator< realT >::openLoop

Get the value of the _openLoop flag.

Returns
the current value of _openLoop.

Definition at line 254 of file leakyIntegrator.hpp.

◆ openLoop() [2/2]

template<typename realT >
int mx::AO::sim::leakyIntegrator< realT >::openLoop ( bool  ol)

Set the _openLoop flag.

If _openLoop is true, then commands are not filtered.

Returns
0 on success, a negative integer on error.
Parameters
olThe new value of _openLoop

Definition at line 247 of file leakyIntegrator.hpp.

Member Data Documentation

◆ _closingDelay

template<typename _realT >
int mx::AO::sim::leakyIntegrator< _realT >::_closingDelay
protected

If > 0, then the gains are ramped linearly up to this value. Default = 0.

Definition at line 61 of file leakyIntegrator.hpp.

◆ _commands

template<typename _realT >
imageT mx::AO::sim::leakyIntegrator< _realT >::_commands
protected

Column-vector past commands.

Definition at line 70 of file leakyIntegrator.hpp.

◆ _gains

template<typename _realT >
imageT mx::AO::sim::leakyIntegrator< _realT >::_gains
protected

Column-vector of gains.

Definition at line 66 of file leakyIntegrator.hpp.

◆ _leaks

template<typename _realT >
imageT mx::AO::sim::leakyIntegrator< _realT >::_leaks
protected

Column-vector of leaks.

Definition at line 68 of file leakyIntegrator.hpp.

◆ _lowOrders

template<typename _realT >
int mx::AO::sim::leakyIntegrator< _realT >::_lowOrders
protected

If > 0, then this sets the maximum mode number which is filtered. All remaining modes are set to 0. Default = 0.

Definition at line 63 of file leakyIntegrator.hpp.

◆ _nModes

template<typename _realT >
int mx::AO::sim::leakyIntegrator< _realT >::_nModes
protected

The number of modes being filtered.

Definition at line 57 of file leakyIntegrator.hpp.

◆ _openLoop

template<typename _realT >
bool mx::AO::sim::leakyIntegrator< _realT >::_openLoop
protected

If true, then commands are not integrated.

Definition at line 59 of file leakyIntegrator.hpp.


The documentation for this class was generated from the following file: