MODIP_T.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 "TestUtil.hpp"
41 #include "MODIP.hpp"
42 #include "DebugTrace.hpp"
43 
44 class MODIP_T
45 {
46 public:
47  static const double MODIP_EPSILON;
48 
49  MODIP_T();
50 
52  unsigned stModipTest();
53 
55  class TestData
56  {
57  public:
59  TestData(double longitude, double dc1, double dc2, double dc3,
60  double latitude, double dc4, double dc5, double dc6,
61  double dc7, int dc8, double dc9, double dc10, double expect)
62  : pos(latitude,longitude,0,gnsstk::Position::Geodetic),
63  expMODIP(expect)
64  {}
66  double expMODIP;
67  };
69  static const TestData testData[];
70 };
71 
72 
73 // Copied value from NeQuickG_JRC_MODIP_test.c
74 const double MODIP_T::MODIP_EPSILON = 1e-5;
75 
76 // Copied data from NeQuickG_JRC_MODIP_test.c
78 {
79  {
80  297.65954, 0.0, 0.0, 0.0, 82.49429, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0,
81  76.28407
82  },
83  {
84  307.19404, 0.0, 0.0, 0.0, 5.25218, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0,
85  19.52877
86  },
87  {
88  355.75034, 0.0, 0.0, 0.0, 40.42916, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0,
89  47.85769
90  },
91  {
92  40.19439, 0.0, 0.0, 0.0, -2.99591, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0,
93  -23.31631
94  },
95  {
96  166.66933, 0.0, 0.0, 0.0, -77.83835, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0,
97  -71.81130
98  },
99  {
100  141.13283, 0.0, 0.0, 0.0, 39.13517, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0,
101  46.48742
102  },
103  {
104  204.54366, 0.0, 0.0, 0.0, 19.80135, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0,
105  33.05457
106  },
107  {
108  115.88525, 0.0, 0.0, 0.0, -31.80197, 0.0, 0.0, 0.0, 0.0, 0, 0.0, 0.0,
109  -51.37982
110  }
111 };
112 
113 
116 {
117 }
118 
119 
120 unsigned MODIP_T ::
122 {
123  TUDEF("MODIP", "MODIP()");
124  gnsstk::MODIP uut;
125  unsigned numTests = sizeof(testData)/sizeof(testData[0]);
126  for (unsigned testNum = 0; testNum < numTests; testNum++)
127  {
128  const TestData& td(testData[testNum]);
130  }
131  TURETURN();
132 }
133 
134 
135 
136 int main(int argc, char *argv[])
137 {
138  MODIP_T testClass;
139  unsigned errorTotal = 0;
140 
141  errorTotal += testClass.stModipTest();
142 
143  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
144  << std::endl;
145 
146  return errorTotal;
147 }
MODIP_T::TestData::expMODIP
double expMODIP
Definition: MODIP_T.cpp:66
MODIP_T::TestData
Hold input/truth data for stModipTest.
Definition: MODIP_T.cpp:55
MODIP_T::MODIP_T
MODIP_T()
Definition: MODIP_T.cpp:115
MODIP_T
Definition: MODIP_T.cpp:44
gnsstk::MODIP::stModip
double stModip(const Position &pos) const
Definition: MODIP.cpp:70
main
int main(int argc, char *argv[])
Definition: MODIP_T.cpp:136
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
MODIP_T::stModipTest
unsigned stModipTest()
Test stModip() and implicitly, interpolate().
Definition: MODIP_T.cpp:121
TestUtil.hpp
MODIP_T::TestData::pos
gnsstk::Position pos
Definition: MODIP_T.cpp:65
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
MODIP_T::MODIP_EPSILON
static const double MODIP_EPSILON
Definition: MODIP_T.cpp:47
TUASSERTFEPS
#define TUASSERTFEPS(EXP, GOT, EPS)
Definition: TestUtil.hpp:126
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
gnsstk::MODIP
Definition: MODIP.hpp:54
DebugTrace.hpp
MODIP_T::testData
static const TestData testData[]
Input/truth data for stModipTest.
Definition: MODIP_T.cpp:69
gnsstk::Position
Definition: Position.hpp:136
MODIP.hpp
MODIP_T::TestData::TestData
TestData(double longitude, double dc1, double dc2, double dc3, double latitude, double dc4, double dc5, double dc6, double dc7, int dc8, double dc9, double dc10, double expect)
dc* are don't-care values copied from EU test code.
Definition: MODIP_T.cpp:59


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