3#include "../../../catch2/catch.hpp"
5#define MX_NO_ERROR_REPORTS
7#include "../../../../include/ao/analysis/aoPSDs.hpp"
11using namespace mx::app;
12using namespace mx::AO::analysis;
20SCENARIO(
"Loading aoPSD config settings",
"[ao::analysis::aoPSD]" )
22 GIVEN(
"a valid config file" )
26 WHEN(
"all normal settings: phase" )
31 {
"psd",
"psd",
"psd",
"psd",
"psd" },
32 {
"D",
"subPiston",
"subTipTilt",
"scintillation",
"component" },
33 {
"5.5",
"true",
"true",
"true",
"phase" } );
39 REQUIRE( psd.
D() == 5.5 );
43 REQUIRE( psd.
component() == PSDComponent::phase );
45 WHEN(
"all normal settings: amplitude" )
50 {
"psd",
"psd",
"psd",
"psd",
"psd" },
51 {
"D",
"subPiston",
"subTipTilt",
"scintillation",
"component" },
52 {
"3.5",
"false",
"false",
"false",
"amplitude" } );
58 REQUIRE( psd.
D() == 3.5 );
62 REQUIRE( psd.
component() == PSDComponent::amplitude );
64 WHEN(
"all normal settings: dispPhase" )
69 {
"psd",
"psd",
"psd",
"psd",
"psd" },
70 {
"D",
"subPiston",
"subTipTilt",
"scintillation",
"component" },
71 {
"7.2",
"true",
"false",
"true",
"dispPhase" } );
77 REQUIRE( psd.
D() == 7.2 );
81 REQUIRE( psd.
component() == PSDComponent::dispPhase );
83 WHEN(
"all normal settings: dispAmplitude" )
88 {
"psd",
"psd",
"psd",
"psd",
"psd" },
89 {
"D",
"subPiston",
"subTipTilt",
"scintillation",
"component" },
90 {
"25.4",
"false",
"true",
"false",
"dispAmplitude" } );
96 REQUIRE( psd.
D() == 25.4 );
100 REQUIRE( psd.
component() == PSDComponent::dispAmplitude );
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.
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.