4#include "../../../catch2/catch.hpp"
6#define MX_NO_ERROR_REPORTS
12using namespace mx::app;
13using namespace mx::AO::analysis;
23TEST_CASE(
"Loading aoPSD config settings",
"[ao::analysis::aoPSD]" )
25 GIVEN(
"a valid config file" )
29 WHEN(
"all normal settings: phase" )
34 {
"psd",
"psd",
"psd",
"psd",
"psd" },
35 {
"D",
"subPiston",
"subTipTilt",
"scintillation",
"component" },
36 {
"5.5",
"true",
"true",
"true",
"phase" } );
42 REQUIRE( psd.
D() == 5.5 );
48 WHEN(
"all normal settings: amplitude" )
53 {
"psd",
"psd",
"psd",
"psd",
"psd" },
54 {
"D",
"subPiston",
"subTipTilt",
"scintillation",
"component" },
55 {
"3.5",
"false",
"false",
"false",
"amplitude" } );
61 REQUIRE( psd.
D() == 3.5 );
67 WHEN(
"all normal settings: dispPhase" )
72 {
"psd",
"psd",
"psd",
"psd",
"psd" },
73 {
"D",
"subPiston",
"subTipTilt",
"scintillation",
"component" },
74 {
"7.2",
"true",
"false",
"true",
"dispPhase" } );
80 REQUIRE( psd.
D() == 7.2 );
86 WHEN(
"all normal settings: dispAmplitude" )
91 {
"psd",
"psd",
"psd",
"psd",
"psd" },
92 {
"D",
"subPiston",
"subTipTilt",
"scintillation",
"component" },
93 {
"25.4",
"false",
"true",
"false",
"dispAmplitude" } );
99 REQUIRE( psd.
D() == 25.4 );
Spatial power spectra used in adaptive optics.
@ dispAmplitude
The amplitude component of dispersive anisoplanatism.
@ dispPhase
The phase component of dispersive anisoplanatism.
@ amplitude
The amplitude.
void writeConfigFile(const std::string &fname, const std::vector< std::string > §ions, const std::vector< std::string > &keywords, const std::vector< std::string > &values)
A simple config file writing function, useful for testing.
TEST_CASE("Loading aoPSD config settings", "[ao::analysis::aoPSD]")
Manage calculations using the von Karman spatial power spectrum.
bool subTipTilt()
Get the value of m_subTipTilt.
realT D()
Get the value of the diameter m_D.
void setupConfig(app::appConfigurator &config)
Setup the configurator to configure this class.
bool subPiston()
Get the value of m_subPiston.
bool scintillation()
Get the value of m_scintillation.
void loadConfig(app::appConfigurator &config)
Load the configuration of this class from a configurator.
int component()
Get the value of m_component.
Class to manage a set of configurable values, and read their values from config/ini files and the com...
int readConfig(const std::string &fname, bool reportFileNotFound=true)
Read and parse a config/ini file, updating the targets.