BCIonoCorrector_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 // 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 
39 #include "TestUtil.hpp"
40 #include "BCIonoCorrector.hpp"
41 #include "NavLibrary.hpp"
43 #include "CivilTime.hpp"
44 
45 namespace gnsstk
46 {
47  std::ostream& operator<<(std::ostream& s, CorrectorType t)
48  {
49  s << StringUtils::asString(t);
50  return s;
51  }
52 }
53 
55 {
56 public:
58  unsigned constructorTest();
59  unsigned getCorrTestPosition();
60  unsigned getCorrTestXvt();
61  std::string dataPath;
62 };
63 
64 
67 {
68  dataPath = gnsstk::getPathData() + gnsstk::getFileSep();
69 }
70 
71 
72 unsigned BCIonoCorrector_T ::
74 {
75  TUDEF("BCIonoCorrector", "BCIonoCorrector");
80  TURETURN();
81 }
82 
83 
84 unsigned BCIonoCorrector_T ::
86 {
87  TUDEF("BCIonoCorrector", "getCorr(Position)");
88  gnsstk::NavLibrary navLib;
89  gnsstk::BCIonoCorrector uut(navLib);
91  gnsstk::Position stnPos(-740290.01, -5457071.705, 3207245.599);
92  gnsstk::Position svPos(-16208820.579, -207275.833, 21038422.516);
93  gnsstk::CommonTime when(gnsstk::CivilTime(2006,10,1,4,30,0,
99  ndf = std::make_shared<gnsstk::MultiFormatNavDataFactory>();
101  dynamic_cast<gnsstk::MultiFormatNavDataFactory*>(ndf.get());
102  TUASSERTE(bool, true, mfndf->addDataSource(dataPath + "mixed.06n"));
103  TUCATCH(navLib.addFactory(ndf));
104  double corr = 0.0;
105  TUASSERTE(bool, true, uut.getCorr(stnPos, svPos, sat, oid, when, nav, corr));
106  TUASSERTFE(3.623343027333741, corr);
107  TURETURN();
108 }
109 
110 
111 unsigned BCIonoCorrector_T ::
113 {
114  TUDEF("BCIonoCorrector", "getCorr(Xvt)");
115  gnsstk::NavLibrary navLib;
116  gnsstk::BCIonoCorrector uut(navLib);
118  gnsstk::Position stnPos(-740290.01, -5457071.705, 3207245.599);
119  gnsstk::Xvt svPos;
120  svPos.x = gnsstk::Triple(-16208820.579, -207275.833, 21038422.516);
121  // The rest are just bunk with the intent that if the algorithm
122  // is changed to include the data somehow, the assertion fails.
123  svPos.v = gnsstk::Triple(123,456,789);
124  svPos.clkbias = 234;
125  svPos.clkdrift = 345;
126  svPos.relcorr = 456;
127  gnsstk::CommonTime when(gnsstk::CivilTime(2006,10,1,4,30,0,
133  ndf = std::make_shared<gnsstk::MultiFormatNavDataFactory>();
135  dynamic_cast<gnsstk::MultiFormatNavDataFactory*>(ndf.get());
136  TUASSERTE(bool, true, mfndf->addDataSource(dataPath + "mixed.06n"));
137  TUCATCH(navLib.addFactory(ndf));
138  double corr = 0.0;
139  TUASSERTE(bool, true, uut.getCorr(stnPos, svPos, sat, oid, when, nav, corr));
140  TUASSERTFE(3.623343027333741, corr);
141  TURETURN();
142 }
143 
144 
145 int main()
146 {
147  unsigned errorTotal = 0;
148  BCIonoCorrector_T testClass;
149 
150  errorTotal += testClass.constructorTest();
151  errorTotal += testClass.getCorrTestPosition();
152  errorTotal += testClass.getCorrTestXvt();
153 
154  std::cout << "Total Failures for " << __FILE__ << ": " << errorTotal
155  << std::endl;
156 
157  return errorTotal;
158 }
main
int main()
Definition: BCIonoCorrector_T.cpp:145
BCIonoCorrector_T::constructorTest
unsigned constructorTest()
Definition: BCIonoCorrector_T.cpp:73
gnsstk::BCIonoCorrector
Definition: BCIonoCorrector.hpp:56
TUCATCH
#define TUCATCH(STATEMENT)
Definition: TestUtil.hpp:193
gnsstk::CorrectorType
CorrectorType
Identify different sources of pseudorange bias.
Definition: CorrectorType.hpp:52
gnsstk::ObservationType::Phase
@ Phase
accumulated phase, in cycles
gnsstk::BCIonoCorrector::getCorr
bool getCorr(const Position &rxPos, const Position &svPos, const SatID &sat, const ObsID &obs, const CommonTime &when, NavType nav, double &corrOut) override
Definition: BCIonoCorrector.cpp:53
TUASSERTE
#define TUASSERTE(TYPE, EXP, GOT)
Definition: TestUtil.hpp:81
BCIonoCorrector_T::getCorrTestPosition
unsigned getCorrTestPosition()
Definition: BCIonoCorrector_T.cpp:85
example5.oid
oid
Definition: example5.py:29
gnsstk::SatID
Definition: SatID.hpp:89
gnsstk::TimeSystem::Any
@ Any
wildcard; allows comparison with any other type
BCIonoCorrector_T
Definition: BCIonoCorrector_T.cpp:54
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::BCIonoCorrector::navLib
NavLibrary & navLib
Reference to the nav library from which we will get iono data.
Definition: BCIonoCorrector.hpp:74
gnsstk::Xvt::v
Triple v
satellite velocity in ECEF Cartesian, meters/second
Definition: Xvt.hpp:152
gnsstk::Triple
Definition: Triple.hpp:68
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::NavType::GPSLNAV
@ GPSLNAV
gnsstk::Xvt::relcorr
double relcorr
relativity correction (standard 2R.V/c^2 term), seconds
Definition: Xvt.hpp:155
gnsstk::NavDataFactoryPtr
std::shared_ptr< NavDataFactory > NavDataFactoryPtr
Managed pointer to NavDataFactory.
Definition: NavDataFactory.hpp:398
gnsstk::SatelliteSystem::GPS
@ GPS
gnsstk::TrackingCode::CA
@ CA
Legacy GPS civil code.
gnsstk::Xvt::x
Triple x
Sat position ECEF Cartesian (X,Y,Z) meters.
Definition: Xvt.hpp:151
TestUtil.hpp
NavLibrary.hpp
TURETURN
#define TURETURN()
Definition: TestUtil.hpp:232
gnsstk::NavLibrary
Definition: NavLibrary.hpp:944
MultiFormatNavDataFactory.hpp
gnsstk::ObsID
Definition: ObsID.hpp:82
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
BCIonoCorrector_T::getCorrTestXvt
unsigned getCorrTestXvt()
Definition: BCIonoCorrector_T.cpp:112
gnsstk::MultiFormatNavDataFactory
Definition: MultiFormatNavDataFactory.hpp:74
gnsstk::CommonTime
Definition: CommonTime.hpp:84
nl
int nl
Definition: IERS1996NutationData.hpp:44
gnsstk::Xvt::clkdrift
double clkdrift
satellite clock drift in seconds/second
Definition: Xvt.hpp:154
gnsstk::CarrierBand::L1
@ L1
GPS L1, Galileo E1, SBAS L1, QZSS L1, BeiDou L1.
BCIonoCorrector_T::dataPath
std::string dataPath
Definition: BCIonoCorrector_T.cpp:61
gnsstk::Xvt
Definition: Xvt.hpp:60
CivilTime.hpp
BCIonoCorrector.hpp
TUDEF
#define TUDEF(CLASS, METHOD)
Definition: TestUtil.hpp:56
gnsstk::CivilTime
Definition: CivilTime.hpp:55
BCIonoCorrector_T::BCIonoCorrector_T
BCIonoCorrector_T()
Definition: BCIonoCorrector_T.cpp:66
gnsstk::NavLibrary::addFactory
void addFactory(NavDataFactoryPtr &fact)
Definition: NavLibrary.cpp:470
TUASSERTFE
#define TUASSERTFE(EXP, GOT)
Definition: TestUtil.hpp:103
gnsstk::Position
Definition: Position.hpp:136
gnsstk::Xvt::clkbias
double clkbias
Sat clock correction in seconds.
Definition: Xvt.hpp:153
gnsstk::NavType
NavType
Supported navigation types.
Definition: NavType.hpp:58
gnsstk::CorrectorType::Iono
@ Iono
Ionospheric corrector.
gnsstk::GroupPathCorrector::corrType
CorrectorType corrType
Set by child classes, indicates what type of bias is computed.
Definition: GroupPathCorrector.hpp:87
gnsstk::MultiFormatNavDataFactory::addDataSource
bool addDataSource(const std::string &source) override
Definition: MultiFormatNavDataFactory.cpp:441


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