LidarZone.cc
Go to the documentation of this file.
1 
9 #include <iostream>
10 #include <boost/lexical_cast.hpp>
11 
12 #include <atm/Atmosphere.h>
13 #include <atm/LidarZone.h>
14 #include <atm/VAODSlice.h>
15 #include <utl/ErrorLogger.h>
16 #include <utl/AugerException.h>
17 #include <det/Detector.h>
18 
19 using namespace det;
20 using namespace std;
21 using namespace atm;
22 using namespace utl;
23 
24 
25 LidarZone::LidarZone(const string& zoneId, const string& lidarId,
26  const string& zoneName,
27  const double northing, const double easting) :
28  VZone(zoneId, zoneName, northing, easting),
29  fVAODSliceVector(0),
30  fLidarIdString(lidarId),
31  fLidarMaxHeight(0),
32  fCoverage(0),
33  fLowestHeight(0),
34  fLowestThickness(0),
35  fLowestVAOD(0)
36 {
37  // Find the id for this LidarZone object.
38  // This is just the primary key in the lidar_zone table for the
39  // given lidar_id and zone_id
40  //
41  VManager::IndexMap indexMap;
42  indexMap["lidar_id"] = fLidarIdString;
43  indexMap["zone_id"] = fZoneIdString;
44 
45  const VManager& manager =
46  Detector::GetInstance().GetAManagerRegister();
47  const VManager::Status stat =
48  manager.GetData(fLidarZoneIdString, "lidar_zone", "lidar_zone_id", indexMap);
49  if (stat == VManager::eNotFound)
50  throw DataNotFoundInDBException("lidar_zone", "lidar_zone_id", indexMap,
51  boost::lexical_cast<string>(Detector::GetInstance().GetTime()));
52 }
53 
54 
56 {
57  if (fVAODSliceVector) {
58  for (InternalVAODSliceIterator vaodIt = fVAODSliceVector->begin();
59  vaodIt != fVAODSliceVector->end(); ++vaodIt)
60  delete *vaodIt;
61  delete fVAODSliceVector;
62  }
63 
64  delete fLidarMaxHeight;
65  delete fCoverage;
66  delete fLowestHeight;
67  delete fLowestThickness;
68  delete fLowestVAOD;
69 }
70 
71 
74  const
75 {
76  if (!fVAODSliceVector)
78  Detector::GetInstance().GetAManagerRegister().GetManager("ALidarSQLManager"));
79  return VAODSliceIterator(fVAODSliceVector->begin());
80 }
81 
82 
85  const
86 {
87  if (!fVAODSliceVector)
89  Detector::GetInstance().GetAManagerRegister().GetManager("ALidarSQLManager"));
90  return VAODSliceIterator(fVAODSliceVector->end());
91 }
92 
93 
94 double
96  const
97 {
98  if (!fLidarMaxHeight)
99  GetCloudData(fLidarMaxHeight, "lidar_max_height");
100 
101  return (*fLidarMaxHeight) * meter;
102 }
103 
104 
105 double
107  const
108 {
109  if (!fCoverage)
110  GetCloudData(fCoverage, "coverage");
111 
112  return *fCoverage;
113 }
114 
115 
116 double
118  const
119 {
120  if (!fLowestHeight)
121  GetCloudData(fLowestHeight, "lowest_height");
122 
123  return (*fLowestHeight) * meter;
124 }
125 
126 
127 double
129  const
130 {
131  if (!fLowestThickness)
132  GetCloudData(fLowestThickness, "lowest_thickness");
133 
134  return (*fLowestThickness) * meter;
135 }
136 
137 
138 double
140  const
141 {
142  if (!fLowestVAOD)
143  GetCloudData(fLowestVAOD, "lowest_VAOD");
144 
145  return (*fLowestVAOD) * meter;
146 }
147 
148 
149 // Configure (x)emacs for this file ...
150 // Local Variables:
151 // mode: c++
152 // End:
double * fLidarMaxHeight
Definition: LidarZone.h:83
double GetLowestCloudThickness() const
Lowest cloud thickness for the zone.
Definition: LidarZone.cc:128
std::string fLidarIdString
Definition: LidarZone.h:80
double GetLowestCloudHeight() const
Lowest cloud height for the zone.
Definition: LidarZone.cc:117
const double meter
Definition: GalacticUnits.h:29
Interface for detector managers.
Definition: VManager.h:115
VAODSliceIterator VAODSlicesEnd() const
End of the collection of VAODenuation data slices.
Definition: LidarZone.cc:84
double GetLidarMaxHeight() const
Return the lidar maximum signal range.
Definition: LidarZone.cc:95
boost::indirect_iterator< InternalVAODSliceIterator, const VAODSlice & > VAODSliceIterator
VAODSlice iterator returns a pointer to the attenuation data slice for this zone. ...
Definition: LidarZone.h:50
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
double GetLowestCloudVAOD() const
Lowest cloud VAOD for the zone.
Definition: LidarZone.cc:139
Exception to use in case requested data not found in the database with detailed printout.
void GetCloudData(T *&requestedData, const std::string &property) const
Definition: LidarZone.h:93
virtual ~LidarZone()
Definition: LidarZone.cc:55
InternalVAODSliceVector::const_iterator InternalVAODSliceIterator
Definition: LidarZone.h:43
double * fLowestThickness
Definition: LidarZone.h:86
Base class for Aerosol, Molecula, Overall Quality and Lidar atmosphere zones.
Definition: VZone.h:28
double * fCoverage
Definition: LidarZone.h:84
double GetCloudCoverage() const
Return cloud coverage for the zone (in percent)
Definition: LidarZone.cc:106
double * fLowestHeight
Definition: LidarZone.h:85
InternalVAODSliceVector * fVAODSliceVector
Definition: LidarZone.h:45
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
VAODSliceIterator VAODSlicesBegin() const
Beginning of the collection of VAODenuation data slices.
Definition: LidarZone.cc:73
std::string fLidarZoneIdString
Definition: LidarZone.h:81
std::string fZoneIdString
Definition: VZone.h:51
Status
Specifies success or (eventually) various possible failure modes.
Definition: VManager.h:127
void CacheSlices(std::vector< const Slice * > *&slices, const std::string &database, const std::string &property, const std::string &zone, const det::VManager &manager) const
Definition: VZone.h:60
double * fLowestVAOD
Definition: LidarZone.h:87

, generated on Tue Sep 26 2023.