GalFNavISC_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 #include "GalFNavISC.hpp"
40 #include "TestUtil.hpp"
41 #include "GALWeekSecond.hpp"
42 
43 namespace gnsstk
44 {
45  std::ostream& operator<<(std::ostream& s, gnsstk::NavMessageType e)
46  {
47  s << StringUtils::asString(e);
48  return s;
49  }
50 }
51 
53 {
54 public:
55  GalFNavISC_T();
57  unsigned constructorTest();
59  unsigned validateTest();
61  unsigned getUserTimeTest();
63  unsigned getISCSFTest();
65  unsigned getISCDFTest();
66 
68 };
69 
70 
73  : oid1(gnsstk::ObservationType::Unknown,
75  gnsstk::TrackingCode::E1B),
76  oid2(gnsstk::ObservationType::Unknown,
78  gnsstk::TrackingCode::E1C),
79  oid3(gnsstk::ObservationType::Unknown,
80  gnsstk::CarrierBand::L5,
81  gnsstk::TrackingCode::E5aI),
82  oid4(gnsstk::ObservationType::SNR,
83  gnsstk::CarrierBand::L5,
84  gnsstk::TrackingCode::E5aQ),
85  oid5(gnsstk::ObservationType::Unknown,
86  gnsstk::CarrierBand::E5b,
87  gnsstk::TrackingCode::E5bI),
88  oid6(gnsstk::ObservationType::SNR,
89  gnsstk::CarrierBand::E5b,
90  gnsstk::TrackingCode::E5bQ),
91  oid7(gnsstk::ObservationType::SNR,
93  gnsstk::TrackingCode::CA)
94 {
95 }
96 
97 
98 unsigned GalFNavISC_T ::
100 {
101  TUDEF("GalFNavISC", "GalFNavISC");
102  gnsstk::GalFNavISC uut;
104  uut.signal.messageType);
105  TUASSERTE(bool, true, std::isnan(uut.isc));
106  TURETURN();
107 }
108 
109 
110 unsigned GalFNavISC_T ::
112 {
113  TUDEF("GalFNavISC", "validate");
114  gnsstk::GalFNavISC uut;
115  TUASSERTE(bool, false, uut.validate());
116  uut.isc = 0;
117  TUASSERTE(bool, true, uut.validate());
118  TURETURN();
119 }
120 
121 
122 unsigned GalFNavISC_T ::
124 {
125  TUDEF("GalFNavISC", "getUserTime");
126  gnsstk::GalFNavISC uut;
127  uut.timeStamp = gnsstk::GALWeekSecond(2100,141.0);
128  gnsstk::CommonTime exp(uut.timeStamp + 10);
135  TURETURN();
136 }
137 
138 
139 unsigned GalFNavISC_T ::
141 {
142  TUDEF("GalFNavISC", "getISC(single-frequency)");
143  gnsstk::GalFNavISC uut;
144  double corr = 0.123456;
145  const double gammaE1E5a = (1575.42/1176.45)*(1575.42/1176.45);
146  const double expCorr1 = 0.123456;
147  const double expCorr2 = gammaE1E5a * 4.656613E-09;
148  TUASSERTE(bool, false, uut.getISC(oid1, corr));
149  TUASSERTFE(expCorr1, corr); // corr should not change.
150  // set isc
151  uut.isc = -4.656613E-09;
152  TUASSERTE(bool, false, uut.getISC(oid1, corr));
153  TUASSERTFE(expCorr1, corr);
154  // try again with same band, different code.
155  corr = 0.123456;
156  TUASSERTE(bool, false, uut.getISC(oid2, corr));
157  TUASSERTFE(expCorr1, corr);
158  // different band/code
159  corr = 0.123456;
160  TUASSERTE(bool, true, uut.getISC(oid3, corr));
161  TUASSERTFE(expCorr2, corr);
162  // try again with same band, different code.
163  corr = 0.123456;
164  TUASSERTE(bool, true, uut.getISC(oid4, corr));
165  TUASSERTFE(expCorr2, corr);
166  // different band/code
167  corr = 0.123456;
168  TUASSERTE(bool, false, uut.getISC(oid5, corr));
169  TUASSERTFE(expCorr1, corr);
170  // try again with same band, different code.
171  corr = 0.123456;
172  TUASSERTE(bool, false, uut.getISC(oid6, corr));
173  TUASSERTFE(expCorr1, corr);
174  // try with unsupported signal
175  corr = 0.123456;
176  TUASSERTE(bool, false, uut.getISC(oid7, corr));
177  TUASSERTFE(expCorr1, corr);
178  TURETURN();
179 }
180 
181 
182 unsigned GalFNavISC_T ::
184 {
185  TUDEF("GalFNavISC", "getISC(dual-frequency)");
186  gnsstk::GalFNavISC uut;
187  double corr = 0.123456;
188  // dual frequency getISC should always return 0 for this class
189  TUASSERTE(bool, true, uut.getISC(oid1, oid3, corr));
190  TUASSERTFE(0, corr);
191  corr = 0.123456;
192  TUASSERTE(bool, true, uut.getISC(oid3, oid1, corr));
193  TUASSERTFE(0, corr);
194  TURETURN();
195 }
196 
197 
198 int main()
199 {
200  GalFNavISC_T testClass;
201  unsigned errorTotal = 0;
202 
203  errorTotal += testClass.constructorTest();
204  errorTotal += testClass.validateTest();
205  errorTotal += testClass.getUserTimeTest();
206  errorTotal += testClass.getISCSFTest();
207  errorTotal += testClass.getISCDFTest();
208 
209  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
210  << std::endl;
211 
212  return errorTotal;
213 }
main
int main()
Definition: GalFNavISC_T.cpp:198
gnsstk::NavMessageType::ISC
@ ISC
Inter-signal corrections.
gnsstk::NavMessageID
Class used to identify/categorize navigation message data.
Definition: NavMessageID.hpp:52
gnsstk::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
GalFNavISC_T::GalFNavISC_T
GalFNavISC_T()
Definition: GalFNavISC_T.cpp:72
L1
gnsstk::Matrix< double > L1
Definition: Matrix_LUDecomp_T.cpp:46
GalFNavISC_T::oid4
gnsstk::ObsID oid4
Definition: GalFNavISC_T.cpp:67
GalFNavISC_T::getISCSFTest
unsigned getISCSFTest()
Single frequency ISC test.
Definition: GalFNavISC_T.cpp:140
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
gnsstk::CarrierBand
CarrierBand
Definition: CarrierBand.hpp:54
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
gnsstk::NavSatelliteID
Definition: NavSatelliteID.hpp:57
gnsstk::GalFNavISC::getISC
bool getISC(const ObsID &oid, double &corrOut) const override
Definition: GalFNavISC.cpp:77
GalFNavISC_T::validateTest
unsigned validateTest()
Check validate()
Definition: GalFNavISC_T.cpp:111
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
GalFNavISC_T::oid3
gnsstk::ObsID oid3
Definition: GalFNavISC_T.cpp:67
gnsstk::GALWeekSecond
Definition: GALWeekSecond.hpp:56
gnsstk::NavData::signal
NavMessageID signal
Source signal identification for this navigation message data.
Definition: NavData.hpp:175
gnsstk::GalFNavISC::validate
bool validate() const override
Definition: GalFNavISC.cpp:70
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::InterSigCorr::isc
double isc
Definition: InterSigCorr.hpp:171
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
gnsstk::TrackingCode::E5aI
@ E5aI
Galileo E5a I code.
TestUtil.hpp
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::ObsID
Definition: ObsID.hpp:82
GalFNavISC_T::getISCDFTest
unsigned getISCDFTest()
Dual frequency ISC test.
Definition: GalFNavISC_T.cpp:183
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::CommonTime
Definition: CommonTime.hpp:84
GalFNavISC_T::oid6
gnsstk::ObsID oid6
Definition: GalFNavISC_T.cpp:67
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
GalFNavISC_T::oid1
gnsstk::ObsID oid1
Definition: GalFNavISC_T.cpp:67
GalFNavISC_T::getUserTimeTest
unsigned getUserTimeTest()
Check getUserTime()
Definition: GalFNavISC_T.cpp:123
GalFNavISC_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: GalFNavISC_T.cpp:99
gnsstk::TrackingCode
TrackingCode
Definition: TrackingCode.hpp:64
GalFNavISC_T::oid7
gnsstk::ObsID oid7
Definition: GalFNavISC_T.cpp:67
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
GalFNavISC.hpp
GalFNavISC_T::oid5
gnsstk::ObsID oid5
Definition: GalFNavISC_T.cpp:67
GalFNavISC_T::oid2
gnsstk::ObsID oid2
Definition: GalFNavISC_T.cpp:67
GALWeekSecond.hpp
gnsstk::SatelliteSystem::Galileo
@ Galileo
gnsstk::GalFNavISC
Definition: GalFNavISC.hpp:51
gnsstk::NavType::GalFNAV
@ GalFNAV
gnsstk::CarrierBand::L5
@ L5
GPS L5, Galileo E5a, SBAS L5, QZSS L5, BeiDou B2a, NavIC L5.
gnsstk::ObservationType
ObservationType
The type of observation, mostly used by ObsID.
Definition: ObservationType.hpp:55
GalFNavISC_T
Definition: GalFNavISC_T.cpp:52


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