00001 #pragma ident "$Id: ORDEpoch.hpp 330 2006-12-01 15:58:14Z ocibu $"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00045 #ifndef ORDEPOCH_HPP
00046 #define ORDEPOCH_HPP
00047
00048 #include <map>
00049 #include "Exception.hpp"
00050 #include "ObsRngDev.hpp"
00051 #include "ClockModel.hpp"
00052 #include "SatID.hpp"
00053
00054 namespace gpstk
00055 {
00056 class ORDEpoch
00057 {
00058 public:
00059 ORDEpoch() : wonky(false) {};
00060
00062 typedef std::map<SatID, ObsRngDev> ORDMap;
00063
00064 ORDEpoch& removeORD(const SatID& svid) throw()
00065 {
00066 ORDMap::iterator i = ords.find(svid);
00067 if(i != ords.end())
00068 ords.erase(i);
00069 return *this;
00070 }
00071
00072 ORDEpoch& applyClockModel(const ClockModel& cm) throw()
00073 {
00074 if (cm.isOffsetValid(time))
00075 {
00076 clockOffset = cm.getOffset(time);
00077 removeOffset(clockOffset);
00078 }
00079 return *this;
00080 }
00081
00082 ORDEpoch& removeOffset(const double offset) throw()
00083 {
00084 ORDMap::iterator i;
00085 for (i = ords.begin(); i != ords.end(); i++)
00086 i->second.applyClockOffset(offset);
00087 return *this;
00088 }
00089
00090 vdouble clockOffset;
00091 vdouble clockResidual;
00092 ORDMap ords;
00093 gpstk::DayTime time;
00094 bool wonky;
00095
00096 friend std::ostream& operator<<(std::ostream& s,
00097 const ORDEpoch& oe)
00098 throw()
00099 {
00100 s << "t=" << oe.time
00101 << " clk=" << oe.clockOffset << std::endl;
00102 ORDMap::const_iterator i;
00103 for (i=oe.ords.begin(); i!=oe.ords.end(); i++)
00104 s << i->second << std::endl;
00105 return s;
00106 }
00107
00108 };
00109
00110
00111 typedef std::map<gpstk::DayTime, gpstk::ORDEpoch> ORDEpochMap;
00112 }
00113 #endif