BDSD1NavIono_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 "BDSD1NavIono.hpp"
40 #include "TestUtil.hpp"
41 #include "BDSWeekSecond.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:
56  unsigned constructorTest();
57  unsigned getUserTimeTest();
58  unsigned getIonoCorrTest();
59 };
60 
61 
62 unsigned BDSD1NavIono_T ::
64 {
65  TUDEF("BDSD1NavIono", "BDSD1NavIono");
68  uut.signal.messageType);
69  TUASSERTE(uint32_t, 0, uut.pre);
70  TUASSERTE(uint32_t, 0, uut.rev);
71  TUASSERTE(unsigned, 0, uut.fraID);
72  TUASSERTE(uint32_t, 0, uut.sow);
73  TURETURN();
74 }
75 
76 
77 unsigned BDSD1NavIono_T ::
79 {
80  TUDEF("BDSD1NavIono", "getUserTime");
82  uut.timeStamp = gnsstk::BDSWeekSecond(2100,135.0);
84  // iono = 1 subframes * 6 seconds
85  exp = exp + 6.0;
87  TURETURN();
88 }
89 
90 
91 unsigned BDSD1NavIono_T ::
93 {
94  TUDEF("BDSD1NavIono", "getIonoCorr");
96  gnsstk::CommonTime when = gnsstk::BDSWeekSecond(2100,135.0);
97  gnsstk::Position rx, sv;
98  rx.setECEF(-1575232.0141,-4707872.2332, 3993198.4383);
99  sv.setECEF(18217581.007, -14220522.580, 12707796.859);
100  uut.alpha[0] = 1.11758709E-08;
101  uut.alpha[1] = -2.37159346E-09;
102  uut.alpha[2] = -6.03921316E-09;
103  uut.alpha[3] = 3.84468251E-09;
104  uut.beta[0] = 1.16736000E+05;
105  uut.beta[1] = -7.30126485E+04;
106  uut.beta[2] = -1.32803702E+04;
107  uut.beta[3] = 3.38181850E+04;
108  // probably wouldn't use L1 or L2 for BDS D1 but this is a sanity check
109  TUASSERTFE(13.174577965354167475,
110  uut.getIonoCorr(when, rx, sv, gnsstk::CarrierBand::L2));
111  TUASSERTFE(7.9994064218713107906,
112  uut.getIonoCorr(when, rx, sv, gnsstk::CarrierBand::L1));
113  TUASSERTFE(8.1468578153895165883,
114  uut.getIonoCorr(when, rx, sv, gnsstk::CarrierBand::B1));
115  TUASSERTFE(13.624958539291872839,
116  uut.getIonoCorr(when, rx, sv, gnsstk::CarrierBand::B2));
117  TUASSERTFE(12.338314431653227388,
118  uut.getIonoCorr(when, rx, sv, gnsstk::CarrierBand::B3));
119  TURETURN();
120 }
121 
122 
123 int main()
124 {
125  BDSD1NavIono_T testClass;
126  unsigned errorTotal = 0;
127 
128  errorTotal += testClass.constructorTest();
129  errorTotal += testClass.getUserTimeTest();
130  errorTotal += testClass.getIonoCorrTest();
131 
132  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
133  << std::endl;
134 
135  return errorTotal;
136 }
gnsstk::NavData::getUserTime
virtual CommonTime getUserTime() const
Definition: NavData.hpp:110
gnsstk::BDSD1NavIono
Definition: BDSD1NavIono.hpp:51
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
BDSD1NavIono.hpp
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
BDSD1NavIono_T
Definition: BDSD1NavIono_T.cpp:52
gnsstk::KlobucharIonoNavData::getIonoCorr
double getIonoCorr(const CommonTime &when, const Position &rxgeo, const Position &svgeo, CarrierBand band) const override
Definition: KlobucharIonoNavData.cpp:114
BDSD1NavIono_T::getUserTimeTest
unsigned getUserTimeTest()
Definition: BDSD1NavIono_T.cpp:78
gnsstk::NavData::signal
NavMessageID signal
Source signal identification for this navigation message data.
Definition: NavData.hpp:175
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::CarrierBand::L2
@ L2
GPS L2, QZSS L2.
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
gnsstk::Position::setECEF
Position & setECEF(const double X, const double Y, const double Z) noexcept
Definition: Position.cpp:601
BDSD1NavIono_T::getIonoCorrTest
unsigned getIonoCorrTest()
Definition: BDSD1NavIono_T.cpp:92
TestUtil.hpp
gnsstk::CarrierBand::B3
@ B3
BeiDou B3.
gnsstk::CarrierBand::B1
@ B1
BeiDou B1.
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::NavMessageType::Iono
@ Iono
Ionospheric correction data.
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::CarrierBand::L1
@ L1
GPS L1, Galileo E1, SBAS L1, QZSS L1, BeiDou L1.
gnsstk::BDSD1NavIono::fraID
uint8_t fraID
The subframe ID (FraID) from word 1 of the subframe.
Definition: BDSD1NavIono.hpp:68
gnsstk::KlobucharIonoNavData::beta
double beta[4]
beta terms of Klobuchar model, using semi-circles.
Definition: KlobucharIonoNavData.hpp:85
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
gnsstk::CarrierBand::B2
@ B2
BeiDou B2b.
gnsstk::BDSD1NavIono::pre
uint32_t pre
The preamble from word 1 of the subframe.
Definition: BDSD1NavIono.hpp:66
BDSD1NavIono_T::constructorTest
unsigned constructorTest()
Make sure constructor initializes data members correctly.
Definition: BDSD1NavIono_T.cpp:63
main
int main()
Definition: BDSD1NavIono_T.cpp:123
gnsstk::NavMessageType
NavMessageType
Identify different types of navigation message data.
Definition: NavMessageType.hpp:59
gnsstk::KlobucharIonoNavData::alpha
double alpha[4]
alpha terms of Klobuchar model, using semi-circles.
Definition: KlobucharIonoNavData.hpp:84
gnsstk::BDSD1NavIono::sow
uint32_t sow
Seconds of week from word 1-2 of the subframe.
Definition: BDSD1NavIono.hpp:69
BDSWeekSecond.hpp
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
gnsstk::Position
Definition: Position.hpp:136
gnsstk::BDSD1NavIono::rev
uint32_t rev
The rev field from word 1 of the subframe.
Definition: BDSD1NavIono.hpp:67
gnsstk::BDSWeekSecond
Definition: BDSWeekSecond.hpp:56


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