EpochClockModel.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 EPOCHCLOCKMODEL_HPP
46 #define EPOCHCLOCKMODEL_HPP
47 
48 #include <map>
49 #include "Exception.hpp"
50 #include "gps_constants.hpp"
51 
52 #include "ObsClockModel.hpp"
53 #include "ORDEpoch.hpp"
54 
55 namespace gnsstk
56 {
58 
59 
61  {
62  public:
63 #pragma clang diagnostic push
64 #pragma clang diagnostic ignored "-Wreorder"
65  EpochClockModel(double sigma = 2,
66  double elmask = 0,
67  SvMode mode = ALWAYS)
68  : ObsClockModel(sigma, elmask, mode), valid(false), clkc(0){}
69 #pragma clang diagnostic pop
70 
73  virtual double getOffset(const gnsstk::CommonTime& t) const
74  {
75  if (t!=time)
76  {
77  gnsstk::InvalidArgumentException e;
78  GNSSTK_THROW(e);
79  }
80  return clkc;
81  };
82 
86  virtual bool isOffsetValid(const gnsstk::CommonTime& t) const
87  {
88  if (t!=time)
89  {
90  gnsstk::InvalidArgumentException e;
91  GNSSTK_THROW(e);
92  }
93  return valid;
94  };
95 
96 
97  // An unchecked accessor for programs that don't need the generic
98  // interface
99  double getOffset() const
100  noexcept {return clkc;};
101 
103  noexcept {return valid;};
104 
108  virtual void addEpoch(const ORDEpoch& oe)
109  {
111  clkc = stat.Average();
112  valid = stat.N() >= 3;
113  time = oe.time;
114  }
115 
116  private:
118  double clkc;
119  bool valid;
120  };
121 
123 
124 }
125 #endif
gnsstk::EpochClockModel::time
gnsstk::CommonTime time
The time of this offset.
Definition: EpochClockModel.hpp:117
gnsstk::ObsClockModel::SvMode
SvMode
Definition: ObsClockModel.hpp:69
gnsstk::ObsClockModel::simpleOrdClock
Stats< double > simpleOrdClock(const ORDEpoch &oe)
Definition: ObsClockModel.cpp:104
const
#define const
Definition: getopt.c:43
gnsstk::EpochClockModel::getOffset
double getOffset() const noexcept
Definition: EpochClockModel.hpp:99
gnsstk::ObsClockModel
Definition: ObsClockModel.hpp:66
gps_constants.hpp
gnsstk::EpochClockModel::valid
bool valid
flag indicating clock bias statistical validity
Definition: EpochClockModel.hpp:119
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::Stats< double >
gnsstk::EpochClockModel::isOffsetValid
virtual bool isOffsetValid(const gnsstk::CommonTime &t) const
Definition: EpochClockModel.hpp:86
gnsstk::EpochClockModel::isOffsetValid
bool isOffsetValid() const noexcept
Definition: EpochClockModel.hpp:102
gnsstk::EpochClockModel::EpochClockModel
EpochClockModel(double sigma=2, double elmask=0, SvMode mode=ALWAYS)
Definition: EpochClockModel.hpp:65
ORDEpoch.hpp
gnsstk::EpochClockModel
Definition: EpochClockModel.hpp:60
gnsstk::EpochClockModel::getOffset
virtual double getOffset(const gnsstk::CommonTime &t) const
Definition: EpochClockModel.hpp:73
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::EpochClockModel::addEpoch
virtual void addEpoch(const ORDEpoch &oe)
Definition: EpochClockModel.hpp:108
gnsstk::ObsClockModel::ALWAYS
@ ALWAYS
always include ORDs from this SV
Definition: ObsClockModel.hpp:73
example5.oe
oe
Definition: example5.py:19
gnsstk::ORDEpoch
Definition: ORDEpoch.hpp:59
Exception.hpp
ObsClockModel.hpp
gnsstk::Stats::Average
T Average(void) const
return the average
Definition: Stats.hpp:329
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::EpochClockModel::clkc
double clkc
clock bias value (same units as residuals)
Definition: EpochClockModel.hpp:118
gnsstk::Stats::N
unsigned int N(void) const
return the sample size
Definition: Stats.hpp:318


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