ReadCloudHL.cc
Go to the documentation of this file.
1 #include <iomanip>
2 #include <sstream>
3 using namespace std;
4 
5 #include <evt/Event.h>
6 using namespace evt;
7 
8 #include <det/Detector.h>
9 using namespace det;
10 
11 #include <fdet/FDetector.h>
12 #include <fdet/Eye.h>
13 #include <fdet/Telescope.h>
14 #include <fdet/Pixel.h>
15 using namespace fdet;
16 
17 #include <utl/ErrorLogger.h>
18 #include <utl/Point.h>
19 #include <utl/TimeStamp.h>
20 #include <utl/Vector.h>
21 using namespace utl;
22 
23 #include <atm/CloudResult.h>
24 using namespace atm;
25 
26 #include "ReadCloudHL.h"
27 using namespace ReadCloudHLNS;
28 using namespace fwk;
29 
30 #include <atm/LidarDB.h>
31 #include <atm/LidarZone.h>
32 
33 ReadCloudHL::ReadCloudHL()
34 {
35 }
36 
37 ReadCloudHL::~ReadCloudHL()
38 {
39 }
40 
43 {
44  INFO("ReadCloudHL::Init()");
45  return eSuccess;
46 }
47 
49 ReadCloudHL::Run(evt::Event& event)
50 {
51  INFO("ReadCloudHL::Run()");
52 
53  // Set detector time to something .
54  Detector& detector = Detector::GetInstance();
55  detector.Update(TimeStamp(832384850) );
56 
57  const Atmosphere& atmos = detector.GetAtmosphere();
58 
59  try {
60  // Define points in the sky and determine whether a cloud obscures the
61  // view of these points from a given FD pixel.
62  //
63  const fdet::Eye& detLL = detector.GetFDetector().GetEye("Los Leones");
65 
66  // Get an fdet::Pixel and two points it looks at.
67  const fdet::Pixel& pixel = detLL.GetTelescope(1).GetPixel(22);
68 
69  double scale;
70  const Vector& pixelDir = pixel.GetDirection();
71  const Point origin(0., 0., 0., csLL);
72 
73  scale = 1. * km;
74  Point A = scale * pixelDir + origin;
75 
76  scale = 10. * km;
77  Point B = scale * pixelDir + origin;
78 
79  CloudResult cResult;
80 
81  // Is the fdet::Pixel obscured at point A? (Same syntax for fevt::Pixel.)
82  cResult = atmos.EvaluateCloudCoverage(pixel, A);
83  cout << "Cloud status in Pixel view to Point A:\n"
84  << cResult.GetCoverageString() << endl;
85 
86  // Is the fdet::Pixel obscured at point B? (Same syntax for fevt::Pixel.)
87  cResult = atmos.EvaluateCloudCoverage(pixel, B);
88  cout << "Cloud status in Pixel view to Point B:\n"
89  << cResult.GetCoverageString() << endl;
90  }
91  catch (const AugerException& e) {
92  ERROR(e.GetMessage());
93  }
94  return eSuccess;
95 }
96 
98 ReadCloudHL::Finish()
99 {
100  INFO("ReadCloudHL::Finish()");
101  return eSuccess;
102 }
103 
const utl::Vector & GetDirection() const
pointing direction of this pixel
void Update(const utl::TimeStamp &time, const bool invData=true, const bool invComp=true, const bool forceRadio=false)
Update detector: deletes currently constructed stations and sets new time.
Definition: Detector.cc:179
Top of the interface to Atmosphere information.
Point object.
Definition: Point.h:32
Base class for all exceptions used in the auger offline code.
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
void Init()
Initialise the registry.
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
Definition: FDetector.cc:68
Detector description interface for Eye-related data.
Definition: FDetector/Eye.h:45
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
const Pixel & GetPixel(const unsigned int pixelId) const
Get Pixel by id, throw utl::NonExistentComponentException if n.a.
const atm::Atmosphere & GetAtmosphere() const
Definition: Detector.h:113
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
utl::CoordinateSystemPtr GetEyeCoordinateSystem() const
Returns the Eye Coordinate system.
const Telescope & GetTelescope(const unsigned int telescopeId) const
Find Telescope by numerical Id.
Top of the hierarchy of the detector description interface.
Definition: Detector.h:81
const fdet::FDetector & GetFDetector() const
Definition: Detector.cc:131
const double km
Store the obscuration of an FD pixel by a cloud in the field of view.
Definition: CloudResult.h:43
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Description of a pixel.
std::string GetCoverageString() const
Definition: CloudResult.cc:35
Vector object.
Definition: Vector.h:30
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165
atm::CloudResult EvaluateCloudCoverage(const fdet::Pixel &pix, const utl::Point &x) const
const std::string & GetMessage() const
Retrieve the message from the exception.

, generated on Tue Sep 26 2023.