10 #include <det/Detector.h>
11 #include <atm/AerosolDB.h>
12 #include <atm/AerosolZone.h>
13 #include <atm/AttSlice.h>
14 #include <atm/PFSlice.h>
15 #include <atm/MolecularZone.h>
16 #include <atm/ProfileResult.h>
18 #include <atm/USStdADBProfileModel.h>
20 #include <fwk/CentralConfig.h>
22 #include <utl/TimeStamp.h>
23 #include <utl/ErrorLogger.h>
25 #include <cppunit/extensions/HelperMacros.h>
26 #include <tst/Verify.h>
42 CPPUNIT_TEST(testHasData);
44 CPPUNIT_TEST(testEvaluateDepthVsHeight);
45 CPPUNIT_TEST(testEvaluateHeightVsDepth);
46 CPPUNIT_TEST(testEvaluateTemperatureVsHeight);
47 CPPUNIT_TEST(testEvaluateDensityVsHeight);
48 CPPUNIT_TEST(testEvaluateRefractionIndexVsHeight);
50 CPPUNIT_TEST_SUITE_END();
58 CentralConfig::GetInstance(BOOTSTRAPFILE);
66 Detector::GetInstance().Update(
TimeStamp(1111112));
69 CPPUNIT_ASSERT(Verify<Equal>(modelWithData.
HasData(),
true));
71 Detector::GetInstance().Update(
TimeStamp());
73 modelWithoutData.
Init();
74 CPPUNIT_ASSERT(Verify<Equal>(modelWithoutData.
HasData(),
false));
78 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
85 Detector::GetInstance().Update(
TimeStamp(1111112));
86 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
89 CPPUNIT_ASSERT(Verify<CloseTo>( depthVsHeight.
Y(500.*
meter), 973.732*
gram/
cm/
cm, 1e-3));
92 CPPUNIT_ASSERT(Verify<CloseTo>( depthVsHeight.
Y(11000.*
meter), 230.918*
gram/
cm/
cm, 1e-3));
95 CPPUNIT_ASSERT(Verify<CloseTo>( depthVsHeight.
Y(26500.*
meter), 20.3484*
gram/
cm/
cm, 1e-3));
98 CPPUNIT_ASSERT(Verify<CloseTo>( depthVsHeight.
Y(0.), 1033.93*
gram/
cm/
cm, 1e-3));
106 Detector::GetInstance().Update(
TimeStamp(1111112));
107 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
110 CPPUNIT_ASSERT(Verify<CloseTo>( heightVsDepth.
Y(20.3484*
gram/
cm/
cm), 26500.*
meter, 1e-3));
114 CPPUNIT_ASSERT(Verify<CloseTo>( heightVsDepth.
Y(973.732*
gram/
cm/
cm), 500.*
meter, 1e-3));
118 CPPUNIT_ASSERT(Verify<CloseTo>( heightVsDepth.
Y(230.918*
gram/
cm/
cm), 11000.*
meter, 1e-3));
126 Detector::GetInstance().Update(
TimeStamp(1111112));
127 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
130 CPPUNIT_ASSERT(Verify<CloseTo>( temperatureVsHeight.
Y(0.), 288.15*
kelvin, 1e-3));
133 CPPUNIT_ASSERT(Verify<CloseTo>( temperatureVsHeight.
Y(11500.), 216.65*
kelvin, 1e-3));
136 CPPUNIT_ASSERT(Verify<CloseTo>( temperatureVsHeight.
Y(29500.), 226.15*
kelvin, 1e-3));
143 Detector::GetInstance().Update(
TimeStamp(1111112));
144 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
147 CPPUNIT_ASSERT(Verify<CloseTo>( densityVsHeight.
Y(0.), 1.23e-3*
g/
cm/
cm/
cm));
150 CPPUNIT_ASSERT(Verify<CloseTo>( densityVsHeight.
Y(11500.*
meter), 3.36458e-4*
g/
cm/
cm/
cm));
153 CPPUNIT_ASSERT(Verify<CloseTo>( densityVsHeight.
Y(29000.*
meter), 2.10e-5*
g/
cm/
cm/
cm));
160 Detector::GetInstance().Update(
TimeStamp(1111112));
161 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
164 CPPUNIT_ASSERT(Verify<CloseTo>( riVsHeight.
Y(0.), 1.00029, 1e-3));
Top of the interface to Atmosphere information.
void testEvaluateRefractionIndexVsHeight()
void testEvaluateHeightVsDepth()
void testEvaluateTemperatureVsHeight()
const atm::ProfileResult & EvaluateDensityVsHeight() const
Tabulated function giving Y=density as a function of X=height.
void testNoDataForTimeStamp()
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
A TimeStamp holds GPS second and nanosecond for some event.
Extracts profile info from US Standard Atmosphere.
Class describing the Atmospheric profile.
const atm::ProfileResult & EvaluateDepthVsHeight() const
Tabulated function giving Y=depth as a function of X=height.
bool HasData() const override
True if a data source is for the given model.
void testEvaluateDensityVsHeight()
const atm::ProfileResult & EvaluateHeightVsDepth() const
Tabulated function giving Y=height as a function of X=depth.
const atm::ProfileResult & EvaluateRefractionIndexVsHeight() const
Tabulated function giving Y=refraction index as a function of X=height.
void testEvaluateDepthVsHeight()
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.