10 #include <det/Detector.h>
12 #include <fdet/FDetector.h>
14 #include <fdet/Telescope.h>
15 #include <fdet/Pixel.h>
17 #include <atm/CloudResult.h>
18 #include <atm/LidarDB.h>
19 #include <atm/LidarZone.h>
20 #include <atm/LidarCloudDBModel.h>
22 #include <fwk/CoordinateSystemRegistry.h>
24 #include <utl/Point.h>
25 #include <utl/UTMPoint.h>
26 #include <utl/ErrorLogger.h>
27 #include <utl/ReferenceEllipsoid.h>
28 #include <utl/Vector.h>
42 LidarCloudDBModel::LidarCloudDBModel() :
45 fLidarDbIsEmptyNow(false)
81 const double cloudHeight = ((*fCloudHeightMap)[lidarZoneName]);
85 if ( cloudHeight < -998 )
90 if (pointHeight < cloudHeight)
96 if (det::Detector::GetInstance().GetFDetector().
97 GetEye(eyeId).GetTelescope(telescopeId).GetPixel(pixelId).HasCloudFraction()) {
98 float cloudFraction = det::Detector::GetInstance().GetFDetector().
99 GetEye(eyeId).GetTelescope(telescopeId).GetPixel(pixelId).GetCloudFraction();
129 det::Detector::GetInstance().GetAtmosphere().GetLidarDB();
131 unsigned int zoneCount = 0;
133 zIt != lidarDB.
ZonesEnd(); ++zIt, ++zoneCount)
137 UTMPoint(zIt->GetNorthing(), zIt->GetEasting(),
139 ReferenceEllipsoid::GetEllipsoidIDFromString(
"WGS84")).GetPoint();
141 (*fCloudHeightMap)[zIt->GetName()] = zIt->GetLowestCloudHeight();
147 if (zoneCount == 0) {
151 msg <<
"Cloud model requested data from lidar database, but none were found"
152 <<
" at " << det::Detector::GetInstance().GetTime();
168 det::Detector::GetInstance().GetFDetector().GetEye(eyeId).GetPosition();
173 for (map<string, Point>::const_iterator zIt =
fZonePositions.begin();
176 const double dist = (eyePos - zIt->second).GetMag();
178 if (dist <= smallestDist) {
180 zoneName = zIt->first;
195 for (map<string, Point>::const_iterator zIt =
fZonePositions.begin();
198 const double dist = (x - zIt->second).GetMag();
200 if (dist <= smallestDist) {
202 zoneName = zIt->first;
boost::transform_iterator< InternalZoneFunctor, InternalZoneIterator, const LidarZone & > ZoneIterator
ZoneIterator returns a pointer to an LidarZone.
CloudResult EvaluateCloudCoverage(const unsigned int eyeId, const unsigned int telescopeId, const unsigned int pixelId, const utl::Point &x) const
Evaluate coverage for a pixel with some Eye, Telescope, and Pixel ID.
std::map< std::string, double > * fCloudHeightMap
Class to hold and convert a point in geodetic coordinates.
ZoneIterator ZonesEnd() const
End of the collection of valid Zones.
virtual ~LidarCloudDBModel()
bool HasData() const
True if a data source is for the given model.
Reference ellipsoids for UTM transformations.
#define DEBUGLOG(message)
Macro for logging debugging messages.
Triple PointToLatitudeLongitudeHeight(const Point &thePoint) const
Convert Point to Lat/Long/Height.
std::string GetZoneName(const unsigned int eyeId) const
Store the obscuration of an FD pixel by a cloud in the field of view.
utl::TimeStamp fCurrentTime
Detector description interface for LidarDB-realted data.
bool CheckForUpdates() const
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
std::map< std::string, utl::Point > fZonePositions
Base class for cloud coverage calculations.
ZoneIterator ZonesBegin() const
Beginning of the collection of valid Zones.