2 #include <boost/lexical_cast.hpp>
4 #include <det/Detector.h>
6 #include <rdet/RDetector.h>
7 #include <rdet/Channel.h>
8 #include <rdet/Station.h>
10 #include <revt/Channel.h>
12 #include <fwk/LocalCoordinateSystem.h>
14 #include <utl/ErrorLogger.h>
15 #include <utl/Point.h>
16 #include <utl/UTMPoint.h>
17 #include <utl/TimeStamp.h>
18 #include <utl/UTCDateTime.h>
19 #include <utl/TimeInterval.h>
20 #include <utl/Reader.h>
21 #include <utl/AugerUnits.h>
22 #include <utl/CoordinateSystem.h>
23 #include <utl/AugerCoordinateSystem.h>
24 #include <utl/ReferenceEllipsoid.h>
32 Station::Station(
const int id) :
34 fStationIdString(boost::lexical_cast<string>(id))
60 err <<
"Invalid Channel Id requested : " <<
id
61 <<
", available channel Id's are";
95 GetStationData(isvirtual,
"virtual",
"stationList",
"station is virtual");
105 GetStationData(IsInAcquisition,
"station_in_acquisition",
"is_in_acquisition",
"station in acquisition flag");
116 GetStationData(timeString,
"commission",
"stationList",
"commission time");
118 GetStationData(timeString,
"decommission",
"stationList",
"commission time");
119 const TimeStamp stop = boost::lexical_cast<UTCDateTime>(timeString).GetTimeStamp();
132 double northing, easting, altitude;
138 GetStationData(ellipsoid,
"ellipsoid",
"stationList",
"ellipsoid for UTM conversion");
139 fEllipsoid = ReferenceEllipsoid::GetEllipsoidIDFromString(ellipsoid);
142 GetStationData(band,
"band",
"stationList",
"band for UTM conversion");
145 GetStationData(zone,
"zone",
"stationList",
"zone for UTM conversion");
163 if (
fId > det::Detector::GetInstance().GetRDetector().GetRdSdStationIdLink())
178 err <<
"Did not find requested component: '" << msg
238 (*channelIt)->Update();
246 std::vector<int> requestedData;
248 if (
fId > det::Detector::GetInstance().GetRDetector().GetRdSdStationIdLink()) {
249 std::vector<int> defaultChannelIds{0, 1};
250 requestedData = defaultChannelIds;
253 const det::VManager& manager = det::Detector::GetInstance().GetRManagerRegister();
269 template <
typename T>
272 const std::string& property,
273 const std::string& component,
274 const std::string& errorMsg,
275 const bool throwOnFailure)
283 int rdsdLink = det::Detector::GetInstance().GetRDetector().GetRdSdStationIdLink();
284 if (
fId <= rdsdLink) {
286 const det::VManager& manager = det::Detector::GetInstance().GetRManagerRegister();
287 status = manager.
GetData(requestedData, property, component, indexMap);
290 indexMap[
"stationId"] = boost::lexical_cast<std::string>(
fId - rdsdLink);
291 const det::VManager& manager = det::Detector::GetInstance().GetSManagerRegister();
292 status = manager.
GetData(requestedData, property, component, indexMap);
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger reference system centered on the station.
bool IsInAcquisition() const
Station in data acquisition.
int GetId() const
Return Id of the Channel.
Time interval defined by two TimeStamps.
void NotFoundAndThrow(const std::string &msg) const
Class to hold and convert a point in geodetic coordinates.
det::VManager::Status GetStationData(T &requestedData, const std::string &property, const std::string &component, const std::string &errorMsg, const bool throwOnFailure=true) const
Base class for exceptions trying to access non-existing components.
Detector description interface for Channel-related data.
Interface for detector managers.
InternalChannelVector fChannelVector
std::vector< int > fListOfChannelIds
A TimeStamp holds GPS second and nanosecond for some event.
std::string fStationIdString
utl::CoordinateSystemPtr fReferenceSystem
utl::Validated< utl::Point > fPosition
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
InternalChannelVector::const_iterator InternalChannelIterator
utl::Validated< std::string > fName
utl::Validated< int > fIsInAcquisition
const Channel & GetChannel(const int id) const
Get specified Channel by id.
std::map< std::string, std::string > IndexMap
utl::Validated< utl::TimeRange > fCommissionTimeRange
void SetListOfChannelIds()
set list of channel ids of the station
Class that holds the data associated to an individual radio channel.
void SetValid(const bool valid=true)
std::map< int, int > fChannelIdToInternalChannelId
utl::Validated< int > fInGrid
utl::ReferenceEllipsoid::EllipsoidID fEllipsoid
utl::Point GetPosition() const
Tank position in Site Cartesian Coordinates.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
Point GetPoint(const CoordinateSystemPtr &theCS=CoordinateSystemPtr()) const
Get a cartesian point from an UTMPoint.
#define ERROR(message)
Macro for logging error messages.
bool IsInGrid(const int level=0) const
Tells whether the station is in the regular triangular grid.
Status
Specifies success or (eventually) various possible failure modes.
const utl::TimeRange & GetCommissionTimeRange() const
Station commission time range.
std::string GetName() const
Station name.