10 #include <cppunit/extensions/HelperMacros.h>
12 #include <det/Detector.h>
13 #include <fdet/FDetector.h>
16 #include <fwk/CoordinateSystemRegistry.h>
18 #include <atm/AerosolDB.h>
19 #include <atm/AttenuationResult.h>
20 #include <atm/ScatteringResult.h>
21 #include <atm/MeasuredDBMieModel.h>
23 #include <fwk/CentralConfig.h>
25 #include <utl/TimeStamp.h>
26 #include <utl/UTCDateTime.h>
27 #include <utl/ErrorLogger.h>
28 #include <utl/Point.h>
29 #include <utl/TabulatedFunctionErrors.h>
30 #include <utl/ReferenceEllipsoid.h>
32 #include <tst/Verify.h>
49 CPPUNIT_TEST(testZoneSelection);
50 CPPUNIT_TEST(testAttenuation);
51 CPPUNIT_TEST(testLambdaDependence);
52 CPPUNIT_TEST(testScattering);
56 CPPUNIT_TEST(testHasData);
58 CPPUNIT_TEST(testNoDataMultipleCalls);
59 CPPUNIT_TEST(testUncertainty);
61 CPPUNIT_TEST_SUITE_END();
67 CentralConfig::GetInstance(BOOTSTRAPFILE);
76 Detector::GetInstance().Update(
UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
77 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
79 vector<double> wlength;
87 CSll(Detector::GetInstance().GetFDetector().GetEye(
"Los Leones").GetLocalCoordinateSystem() );
89 Point All(0, 0, 0, CSll);
90 Point Bll(0, 0, 9000*
m, CSll);
97 CSco(Detector::GetInstance().GetFDetector().GetEye(
"Coihueco").GetLocalCoordinateSystem() );
99 Point Aco(0, 0, 0, CSco);
100 Point Bco(0, 0, 9000*
m, CSco);
109 Detector::GetInstance().Update(
UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
112 CSll(Detector::GetInstance().GetFDetector().GetEye(
"Los Leones").GetLocalCoordinateSystem() );
134 Point All(0, 0, 0, CSll);
135 Point Bll(0, 0, 2600*
m, CSll);
136 Point Cll(0, 0, 9000*
m, CSll);
137 Point Dll(0, 2000*
m, 2600*
m, CSll);
138 Point Ell(0, 9000*
m, 2600*
m, CSll);
141 Point Cst(0, 0, 10000*
m, CSst);
143 vector<double> wlength;
148 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
196 Detector::GetInstance().Update(
UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
197 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
201 CSco(Detector::GetInstance().GetFDetector().GetEye(
"Coihueco").GetLocalCoordinateSystem() );
203 Point Aco(0, 0, 0*
m, CSco);
204 Point Bco(0, 0, 200*
m, CSco);
206 vector<double> wlength;
225 Detector::GetInstance().Update(
UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
226 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
228 CSll(Detector::GetInstance().GetFDetector().GetEye(
"Los Leones").GetLocalCoordinateSystem() );
230 vector<double> wlength;
235 Point pointA(0, 0, 0 , CSll);
236 Point pointB(0, 0, 1400*
m, CSll);
237 Point pointC(0, 600*
m, 1600*
m, CSll);
318 Detector::GetInstance().Update(
UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
319 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
321 CSll(Detector::GetInstance().GetFDetector().GetEye(
"Los Leones").GetLocalCoordinateSystem() );
323 vector<double> wlength;
328 Point A(0, 0, 0, CSll);
338 Detector::GetInstance().Update(
TimeStamp(123));
339 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
341 CSll(Detector::GetInstance().GetFDetector().GetEye(
"Los Leones").GetLocalCoordinateSystem() );
343 vector<double> wlength;
348 Point A(0, 0, 0, CSll);
360 Detector::GetInstance().Update(
TimeStamp(123));
362 mieModelWithoutData.
Init();
363 CPPUNIT_ASSERT(Verify<Equal>(mieModelWithoutData.
HasData(),
false));
365 Detector::GetInstance().Update(
UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
367 mieModelWithData.
Init();
368 CPPUNIT_ASSERT(Verify<Equal>(mieModelWithData.
HasData(),
true));
374 Detector::GetInstance().Update(
TimeStamp(123));
375 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
377 CSll(Detector::GetInstance().GetFDetector().GetEye(
"Los Leones").GetLocalCoordinateSystem() );
379 vector<double> wlength;
384 Point A(0, 0, 0, CSll);
389 int numExceptions = 0;
390 for (
int i=0 ; i<5 ; i++){
398 CPPUNIT_ASSERT(Verify<Equal>(numExceptions, 5));
402 Detector::GetInstance().Update(
UTCDateTime(2005,1,1,0,0,0).GetTimeStamp());
405 CSll(Detector::GetInstance().GetFDetector().GetEye(
"Los Leones").GetLocalCoordinateSystem() );
409 Point All(0, 0, 0, CSll);
410 Point Bll(0, 0, 2600*
m, CSll);
412 vector<double> wlength;
417 const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
double GetScatteringAngle() const
Get calculated scattering angle.
Top of the interface to Atmosphere information.
atm::AttenuationResult EvaluateMieAttenuation(const utl::Point &xInit, const utl::Point &xFinal, const std::vector< double > &wLength) const
const utl::TabulatedFunctionErrors & GetTransmissionFactor() const
Transmission factor.
double pow(const double x, const unsigned int i)
Class for computing aerosol scattering and attenuation using database measurements.
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
A TimeStamp holds GPS second and nanosecond for some event.
constexpr double nanometer
Class holding the output of the ScatteringResult function.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Reference ellipsoids for UTM transformations.
bool HasData() const
Determine if the DB tables are full or if an update is needed.
void Init()
Initialize model using an XML card.
const utl::TabulatedFunctionErrors & GetScatteringFactor() const
Scattering factor.
void testNoDataMultipleCalls()
void testLambdaDependence()
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
double Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
void SetUncertaintyBound(const ModelWithUncertainty model, const double nSigma) const
alter Model "model" by "nSigma" standard deviations
Class describing the Atmospheric attenuation.
atm::ScatteringResult EvaluateMieScattering(const utl::Point &xA, const utl::Point &xB, const double angle, const double distance, const std::vector< double > &xLength) const