LinearClockModel.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
45 #ifndef LINEARCLOCKMODEL_HPP
46 #define LINEARCLOCKMODEL_HPP
47 
48 #include <map>
49 
50 #include "Exception.hpp"
51 
52 #include "ObsClockModel.hpp"
53 #include "ORDEpoch.hpp"
54 
55 
56 
57 namespace gnsstk
58 {
60 
61 
63  {
64  public:
65  LinearClockModel(double sigma = 2, double elmask = 0, SvMode mode = ALWAYS)
66  :ObsClockModel(sigma, elmask, mode) {reset();};
67 
68  virtual double getOffset(const gnsstk::CommonTime& t) const
69  noexcept
70  {
71  if (!isOffsetValid(t))
72  return 0;
73  else
74  return clockModel.Slope()*(t-baseTime) + clockModel.Intercept();
75  };
76 
77  virtual bool isOffsetValid(const gnsstk::CommonTime& t) const noexcept
78  {return t >= startTime && t <= endTime && clockModel.N() > 1;};
79 
83  virtual void addEpoch(const ORDEpoch& oe);
84 
86  void reset() noexcept;
87 
88  void dump(std::ostream& s, short detail=1) const noexcept;
89 
90  friend std::ostream& operator<<(std::ostream& s, const LinearClockModel& r)
91  { r.dump(s, 0); return s; };
92 
93  private:
94  // x is time y is clock offset
96 
98 
99  unsigned long tossCount;
100 
101  // This is were we store what SVs were used to compute the individual
102  // clock observations
103  std::map<gnsstk::CommonTime, SvStatusMap> prnStatus;
104 
105  // This is a store of the clock observations that were added into the
106  // clockModel object
107  std::multimap<double,double> clockObs;
108  };
109 
111 
112 }
113 #endif
gnsstk::LinearClockModel::getOffset
virtual double getOffset(const gnsstk::CommonTime &t) const noexcept
Definition: LinearClockModel.hpp:68
gnsstk::ObsClockModel::SvMode
SvMode
Definition: ObsClockModel.hpp:69
const
#define const
Definition: getopt.c:43
gnsstk::TwoSampleStats::Slope
T Slope(void) const
return slope of best-fit line Y=slope*X + intercept
Definition: Stats.hpp:1060
gnsstk::ObsClockModel
Definition: ObsClockModel.hpp:66
gnsstk::TwoSampleStats::Intercept
T Intercept(void) const
return intercept of best-fit line Y=slope*X + intercept
Definition: Stats.hpp:1072
gnsstk::LinearClockModel::LinearClockModel
LinearClockModel(double sigma=2, double elmask=0, SvMode mode=ALWAYS)
Definition: LinearClockModel.hpp:65
gnsstk::LinearClockModel::reset
void reset() noexcept
Reset the accumulated statistics on the clock.
Definition: LinearClockModel.cpp:54
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::LinearClockModel::baseTime
gnsstk::CommonTime baseTime
Definition: LinearClockModel.hpp:97
ORDEpoch.hpp
gnsstk::LinearClockModel::isOffsetValid
virtual bool isOffsetValid(const gnsstk::CommonTime &t) const noexcept
Definition: LinearClockModel.hpp:77
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::LinearClockModel::tossCount
unsigned long tossCount
Definition: LinearClockModel.hpp:99
gnsstk::LinearClockModel::clockObs
std::multimap< double, double > clockObs
Definition: LinearClockModel.hpp:107
gnsstk::ObsClockModel::ALWAYS
@ ALWAYS
always include ORDs from this SV
Definition: ObsClockModel.hpp:73
gnsstk::LinearClockModel::prnStatus
std::map< gnsstk::CommonTime, SvStatusMap > prnStatus
Definition: LinearClockModel.hpp:103
gnsstk::LinearClockModel::clockModel
gnsstk::TwoSampleStats< double > clockModel
Definition: LinearClockModel.hpp:91
gnsstk::LinearClockModel
Definition: LinearClockModel.hpp:62
example5.oe
oe
Definition: example5.py:19
gnsstk::ORDEpoch
Definition: ORDEpoch.hpp:59
Exception.hpp
std
Definition: Angle.hpp:142
ObsClockModel.hpp
gnsstk::TwoSampleStats::N
unsigned int N(void) const
Definition: Stats.hpp:1037
gnsstk::LinearClockModel::startTime
gnsstk::CommonTime startTime
Definition: LinearClockModel.hpp:97
gnsstk::LinearClockModel::endTime
gnsstk::CommonTime endTime
Definition: LinearClockModel.hpp:97
gnsstk::LinearClockModel::addEpoch
virtual void addEpoch(const ORDEpoch &oe)
Definition: LinearClockModel.cpp:67
gnsstk::TwoSampleStats< double >
gnsstk::LinearClockModel::dump
void dump(std::ostream &s, short detail=1) const noexcept
Definition: LinearClockModel.cpp:144


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:39