GLOCNavLTDMP.cpp
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 //
28 // This software was developed by Applied Research Laboratories at the
29 // University of Texas at Austin, under contract to an agency or agencies
30 // within the U.S. Department of Defense. The U.S. Government retains all
31 // rights to use, duplicate, distribute, disclose, or release this software.
32 //
33 // Pursuant to DoD Directive 523024
34 //
35 // DISTRIBUTION STATEMENT A: This software has been approved for public
36 // release, distribution is unlimited.
37 //
38 //==============================================================================
39 
40 #include "GLOCNavLTDMP.hpp"
41 #include "DebugTrace.hpp"
42 
43 using namespace std;
44 
45 namespace gnsstk
46 {
47  GLOCNavLTDMP ::
48  GLOCNavLTDMP()
49  : tb31(-1), tb32(-1),
50  dax0(std::numeric_limits<double>::quiet_NaN()),
51  day0(std::numeric_limits<double>::quiet_NaN()),
52  daz0(std::numeric_limits<double>::quiet_NaN()),
53  ax1(std::numeric_limits<double>::quiet_NaN()),
54  ay1(std::numeric_limits<double>::quiet_NaN()),
55  az1(std::numeric_limits<double>::quiet_NaN()),
56  ax2(std::numeric_limits<double>::quiet_NaN()),
57  ay2(std::numeric_limits<double>::quiet_NaN()),
58  az2(std::numeric_limits<double>::quiet_NaN()),
59  ax3(std::numeric_limits<double>::quiet_NaN()),
60  ay3(std::numeric_limits<double>::quiet_NaN()),
61  az3(std::numeric_limits<double>::quiet_NaN()),
62  ax4(std::numeric_limits<double>::quiet_NaN()),
63  ay4(std::numeric_limits<double>::quiet_NaN()),
64  az4(std::numeric_limits<double>::quiet_NaN())
65  {
66  }
67 
68 
69  bool GLOCNavLTDMP ::
70  validate() const
71  {
72  return ((tb31 == tb32) &&
73  (std::isnan(dax0) == 0) &&
74  (std::isnan(day0) == 0) &&
75  (std::isnan(daz0) == 0) &&
76  (std::isnan(ax1) == 0) &&
77  (std::isnan(ay1) == 0) &&
78  (std::isnan(az1) == 0) &&
79  (std::isnan(ax2) == 0) &&
80  (std::isnan(ay2) == 0) &&
81  (std::isnan(az2) == 0) &&
82  (std::isnan(ax3) == 0) &&
83  (std::isnan(ay3) == 0) &&
84  (std::isnan(az3) == 0) &&
85  (std::isnan(ax4) == 0) &&
86  (std::isnan(ay4) == 0) &&
87  (std::isnan(az4) == 0) &&
88  ((dax0 != 0) ||
89  (day0 != 0) ||
90  (daz0 != 0) ||
91  (ax1 != 0) ||
92  (ay1 != 0) ||
93  (az1 != 0) ||
94  (ax2 != 0) ||
95  (ay2 != 0) ||
96  (az2 != 0) ||
97  (ax3 != 0) ||
98  (ay3 != 0) ||
99  (az3 != 0) ||
100  (ax4 != 0) ||
101  (ay4 != 0) ||
102  (az4 != 0)));
103  }
104 
105 
107  geta(double deltat) const
108  {
109  // I'm not positive but I think this is basically trading
110  // optimal speed for optimal precision (by avoiding using
111  // really big numbers in conjunction with really small
112  // numbers).
114  DEBUGTRACE("dax0 = " << scientific << dax0);
115  DEBUGTRACE("ax1 = " << scientific << ax1);
116  DEBUGTRACE("ax2 = " << scientific << ax2);
117  DEBUGTRACE("ax3 = " << scientific << ax3);
118  DEBUGTRACE("ax4 = " << scientific << ax4);
119  Vector<double> rv({
120  dax0 + ax1*deltat + ax2*deltat*deltat + ax3*deltat*deltat*deltat +
121  ax4*deltat*deltat*deltat*deltat,
122  day0 + ay1*deltat + ay2*deltat*deltat + ay3*deltat*deltat*deltat +
123  ay4*deltat*deltat*deltat*deltat,
124  daz0 + az1*deltat + az2*deltat*deltat + az3*deltat*deltat*deltat +
125  az4*deltat*deltat*deltat*deltat });
126  DEBUGTRACE("dt=" << fixed << deltat << setprecision(12) << scientific
127  << " rv={" << rv(0) << ", " << rv(1) << ", " << rv(2) << "}");
128  return rv;
129  }
130 
131 
132  void GLOCNavLTDMP ::
133  dump(std::ostream& s) const
134  {
135  ios::fmtflags oldFlags = s.flags();
136  s.setf(ios::fixed, ios::floatfield);
137  s.setf(ios::right, ios::adjustfield);
138  s.setf(ios::uppercase);
139  s.fill(' ');
140  s << scientific << setprecision(6)
141  << " LONG-TERM ORBIT PARAMETERS" << endl << endl
142  << " "
143  << "X Y Z"
144  << endl
145  << "da0: " << setw(16) << dax0 << ", " << setw(16) << day0
146  << ", " << setw(16) << daz0 << " km/s**2" << endl
147  << "a1: " << setw(16) << ax1 << ", " << setw(16) << ay1
148  << ", " << setw(16) << az1 << " km/s**3" << endl
149  << "a2: " << setw(16) << ax2 << ", " << setw(16) << ay2
150  << ", " << setw(16) << az2 << " km/s**4" << endl
151  << "a3: " << setw(16) << ax3 << ", " << setw(16) << ay3
152  << ", " << setw(16) << az3 << " km/s**5" << endl
153  << "a4: " << setw(16) << ax4 << ", " << setw(16) << ay4
154  << ", " << setw(16) << az4 << " km/s**6" << endl;
155  s.flags(oldFlags);
156  }
157 
158 } // namespace gnsstk
gnsstk::GLOCNavLTDMP::dump
void dump(std::ostream &s) const
Dump (in full detail) the contents of this object.
Definition: GLOCNavLTDMP.cpp:133
gnsstk::GLOCNavLTDMP::day0
double day0
Definition: GLOCNavLTDMP.hpp:86
gnsstk::GLOCNavLTDMP::tb31
unsigned long tb31
Reference instant in Moscow time for string 31.
Definition: GLOCNavLTDMP.hpp:80
DEBUGTRACE
#define DEBUGTRACE(EXPR)
Definition: DebugTrace.hpp:119
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GLOCNavLTDMP::dax0
double dax0
Definition: GLOCNavLTDMP.hpp:85
gnsstk::GLOCNavLTDMP::ay4
double ay4
Definition: GLOCNavLTDMP.hpp:98
gnsstk::GLOCNavLTDMP::az4
double az4
Definition: GLOCNavLTDMP.hpp:99
gnsstk::GLOCNavLTDMP::ax3
double ax3
Definition: GLOCNavLTDMP.hpp:94
gnsstk::GLOCNavLTDMP::tb32
unsigned long tb32
Reference instant in Moscow time for string 32.
Definition: GLOCNavLTDMP.hpp:81
gnsstk::GLOCNavLTDMP::ay3
double ay3
Definition: GLOCNavLTDMP.hpp:95
gnsstk::GLOCNavLTDMP::daz0
double daz0
Definition: GLOCNavLTDMP.hpp:87
gnsstk::GLOCNavLTDMP::ax1
double ax1
Definition: GLOCNavLTDMP.hpp:88
gnsstk::Vector< double >
gnsstk::GLOCNavLTDMP::az2
double az2
Definition: GLOCNavLTDMP.hpp:93
gnsstk::GLOCNavLTDMP::ay1
double ay1
Definition: GLOCNavLTDMP.hpp:89
gnsstk::GLOCNavLTDMP::az3
double az3
Definition: GLOCNavLTDMP.hpp:96
DebugTrace.hpp
std
Definition: Angle.hpp:142
gnsstk::GLOCNavLTDMP::ax4
double ax4
Definition: GLOCNavLTDMP.hpp:97
GLOCNavLTDMP.hpp
DEBUGTRACE_FUNCTION
#define DEBUGTRACE_FUNCTION()
Definition: DebugTrace.hpp:117
gnsstk::GLOCNavLTDMP::az1
double az1
Definition: GLOCNavLTDMP.hpp:90
gnsstk::GLOCNavLTDMP::ax2
double ax2
Definition: GLOCNavLTDMP.hpp:91
gnsstk::GLOCNavLTDMP::ay2
double ay2
Definition: GLOCNavLTDMP.hpp:92
gnsstk::GLOCNavLTDMP::validate
bool validate() const
Definition: GLOCNavLTDMP.cpp:70
gnsstk::GLOCNavLTDMP::geta
Vector< double > geta(double deltat) const
Definition: GLOCNavLTDMP.cpp:107


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