mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
turbAtmosphere_test.cpp
Go to the documentation of this file.
1/** \file turbAtmosphere_test.cpp
2 * \brief Tests simulated turbulent-atmosphere generation.
3 */
4#include "../../../catch2/catch.hpp"
5
6#define MX_NO_ERROR_REPORTS
7
10
11/** \defgroup turbAtmosphere_unit_tests turbAtmosphere Unit Tests
12 * \ingroup ao_sim_unit_tests
13 */
14
15namespace unitTest::ao_sim_turbAtmosphere_test
16{
17
18/** \brief Verifies a configured one-layer atmosphere produces a finite phase screen.
19 *
20 * Exercises mx::AO::sim::turbAtmosphere::setup, mx::AO::sim::turbAtmosphere::setLayers, and
21 * mx::AO::sim::turbAtmosphere::genLayers with subharmonics enabled.
22 *
23 * \ingroup turbAtmosphere_unit_tests
24 */
25TEST_CASE( "turbAtmosphere generates a one-layer subharmonic screen", "[ao::sim::turbAtmosphere]" )
26{
27 using realT = double;
30
31 aoSystemT aosys;
32 aosys.D( 25.0 );
33 aosys.lam_sci( 0.5e-6 );
34 aosys.atm.setSingleLayer( 0.16, 0.5e-6, 0.0, 0.0, 0.0, 0.0, 0.0 );
35
36 atmosphereT atmosphere;
37 atmosphere.setup( 64, 0, &aosys, 1 );
38 atmosphere.retain( true );
39 atmosphere.setLayers( 192 );
40 atmosphere.normVar().seed( 67890 );
41 atmosphere.genLayers();
42
43 REQUIRE( atmosphere.nLayers() == 1 );
44 REQUIRE( atmosphere.layer( 0 ).m_phase.isFinite().all() );
45 REQUIRE( atmosphere.layer( 0 ).m_phase.square().sum() > 0 );
46}
47
48} // namespace unitTest::ao_sim_turbAtmosphere_test
Declares and defines an analytical AO system.
void setSingleLayer(realT r0, realT lam0, realT L0, realT l0, realT lz, realT vw, realT dir)
Set a single layer model.
Describes an analytic adaptive optics (AO) system.
Definition aoSystem.hpp:64
void D(realT nD)
Set the value of the primary mirror diameter.
void lam_sci(realT nlam)
Set the science wavelength.
TEST_CASE("turbAtmosphere generates a one-layer subharmonic screen", "[ao::sim::turbAtmosphere]")
Verifies a configured one-layer atmosphere produces a finite phase screen.
AO-system test type that forces local template instantiation under sanitizers.
A turbulent atmosphere simulator.
Declaration and definition of a turbulent atmosphere.