mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Implements the leaky integrator controller.
_realT | is 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< realT > | wavefrontT |
The wavefront data type. More... | |
typedef wfMeasurement< realT > | commandT |
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... | |
typedef wfMeasurement<realT> mx::AO::sim::leakyIntegrator< _realT >::commandT |
The command type.
Definition at line 47 of file leakyIntegrator.hpp.
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.
typedef _realT mx::AO::sim::leakyIntegrator< _realT >::realT |
The real data type.
Definition at line 41 of file leakyIntegrator.hpp.
typedef wavefront<realT> mx::AO::sim::leakyIntegrator< _realT >::wavefrontT |
The wavefront data type.
Definition at line 44 of file leakyIntegrator.hpp.
mx::AO::sim::leakyIntegrator< realT >::leakyIntegrator |
Default c'tor.
Definition at line 206 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::closingDelay |
Get the value of the _closingDelay.
Definition at line 268 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::closingDelay | ( | int | cd | ) |
Set _closingDelay.
If _closingDelay > 0, then the gains are ramped linearly up to this value.
cd | The new value of _closingDelay |
Definition at line 260 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::filterCommands | ( | commandT & | filtAmps, |
commandT & | rawAmps, | ||
int | iterNo | ||
) |
Apply the leaky integrator.
[out] | filtAmps | the filtered commands |
[in] | rawAmps | the raw commands |
[in] | iterNo | The current iteration number |
Definition at line 396 of file leakyIntegrator.hpp.
realT mx::AO::sim::leakyIntegrator< realT >::gain | ( | int | i | ) |
Get the gain for a single mode.
0 | if the mode doesn't exist. |
[in] | i | the mode number |
Definition at line 288 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::gain | ( | int | i, |
realT | g | ||
) |
Set the gain for a single mode.
0 | if the mode doesn't exist. |
[in] | i | the mode number |
[in] | g | the new gain value |
Definition at line 301 of file leakyIntegrator.hpp.
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.
-1 | if file open fails |
[in] | ogainf | the name of the file, full path |
Definition at line 344 of file leakyIntegrator.hpp.
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.
-1 | on vector size mismatch |
[in] | vgains | vector of gains. |
Definition at line 326 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::gains | ( | realT | g | ) |
Set the gain for all modes to a single value.
[in] | g | the new gain value |
Definition at line 315 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::initialize | ( | int | nModes | ) |
Allocate and initialize all state.
[in] | nModes | the number of modes to be filtered |
Definition at line 222 of file leakyIntegrator.hpp.
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.
filtAmps | The structure to contain the filtered commands |
rawAmps | The structure to contain the raw commands |
Definition at line 384 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::leak | ( | int | i, |
realT | l | ||
) |
Set the leak for a single mode.
[in] | i | the mode number |
[in] | l | the new leak value for this mode |
Definition at line 370 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::leaks | ( | realT | l | ) |
Set a leak for all modes.
[in] | l | the new leak value to set for all modes |
Definition at line 376 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::lowOrders |
Get the value of the _lowOrders.
Definition at line 282 of file leakyIntegrator.hpp.
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.
lo | The new value of _lowOrders |
Definition at line 274 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::nModes |
Get the number of modes.
nModes is only set by calling initialize.
Definition at line 241 of file leakyIntegrator.hpp.
bool mx::AO::sim::leakyIntegrator< realT >::openLoop |
Get the value of the _openLoop flag.
Definition at line 254 of file leakyIntegrator.hpp.
int mx::AO::sim::leakyIntegrator< realT >::openLoop | ( | bool | ol | ) |
Set the _openLoop flag.
If _openLoop is true, then commands are not filtered.
ol | The new value of _openLoop |
Definition at line 247 of file leakyIntegrator.hpp.
|
protected |
If > 0, then the gains are ramped linearly up to this value. Default = 0.
Definition at line 61 of file leakyIntegrator.hpp.
|
protected |
Column-vector past commands.
Definition at line 70 of file leakyIntegrator.hpp.
|
protected |
Column-vector of gains.
Definition at line 66 of file leakyIntegrator.hpp.
|
protected |
Column-vector of leaks.
Definition at line 68 of file leakyIntegrator.hpp.
|
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.
|
protected |
The number of modes being filtered.
Definition at line 57 of file leakyIntegrator.hpp.
|
protected |
If true, then commands are not integrated.
Definition at line 59 of file leakyIntegrator.hpp.