GPSCNavISC.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 "GPSCNavISC.hpp"
40 #include "TimeString.hpp"
41 #include "YDSTime.hpp"
42 #include "FreqConv.hpp"
43 
44 using namespace std;
45 
46 namespace gnsstk
47 {
48  GPSCNavISC ::
49  GPSCNavISC()
50  : pre(0),
51  alert(false),
52  iscL1CA(std::numeric_limits<double>::quiet_NaN()),
53  iscL2C(std::numeric_limits<double>::quiet_NaN()),
54  iscL5I5(std::numeric_limits<double>::quiet_NaN()),
55  iscL5Q5(std::numeric_limits<double>::quiet_NaN())
56  {
57  // ignore refOids/validOids as they're not used
58  }
59 
60 
61  void GPSCNavISC ::
62  dumpCorrections(std::ostream& s) const
63  {
64  const ios::fmtflags oldFlags = s.flags();
65  s << " CORRECTION"
66  << endl << endl
67  << scientific << setprecision(8) << setfill(' ')
68  << setw(20) << left << "Tgd:" << setw(15) << isc << endl
69  << setw(20) << left << "ISC_L1C/A:" << setw(15) << iscL1CA << endl
70  << setw(20) << left << "ISC_L2C:" << setw(15) << iscL2C << endl
71  << setw(20) << left << "ISC_L5I5:" << setw(15) << iscL5I5 << endl
72  << setw(20) << left << "ISC_L5Q5:" << setw(15) << iscL5Q5 << endl;
73  s.flags(oldFlags);
74  }
75 
76 
77  bool GPSCNavISC ::
78  validate() const
79  {
80  return ((pre == 0) || (pre == 0x8b));
81  }
82 
83 
85  getUserTime() const
86  {
88  return timeStamp + 12.0;
89  return timeStamp + 6.0;
90  }
91 
92 
93  bool GPSCNavISC ::
94  getISC(const ObsID& oid, double& corr) const
95  {
96  // reminder: InterSigCorr::isc is used to store Tgd
97  switch (oid.band)
98  {
99  case CarrierBand::L1:
100  if (oid.code == TrackingCode::CA)
101  {
102  corr = iscL1CA - isc;
103  return true;
104  }
105  break;
106  case CarrierBand::L2:
107  switch (oid.code)
108  {
109  case TrackingCode::L2CM:
110  case TrackingCode::L2CL:
111  case TrackingCode::L2CML:
112  corr = iscL2C - isc;
113  return true;
114  }
115  break;
116  case CarrierBand::L5:
117  // note this is only described in IS-GPS-705
118  switch (oid.code)
119  {
120  case TrackingCode::L5I:
121  corr = iscL5I5 - isc;
122  return true;
123  case TrackingCode::L5Q:
124  corr = iscL5Q5 - isc;
125  return true;
126  }
127  break;
128  }
129  return false;
130  }
131 
132 
133  bool GPSCNavISC ::
134  getISC(const ObsID& oid1, const ObsID& oid2, double& corr)
135  const
136  {
137  // reminder: InterSigCorr::isc is used to store Tgd
138  if ((oid1.band == CarrierBand::L1) &&
139  (oid1.code == TrackingCode::CA) &&
140  (oid2.band == CarrierBand::L5))
141  {
142  // per IS-GPS-705 20.3.3.3.1.2.2
143  double gamma15 = getGamma(oid1.band,oid2.band);
144  if (oid2.code == TrackingCode::L5I)
145  {
146  corr = ((iscL5I5 - (gamma15 * iscL1CA)) / (1-gamma15)) - isc;
147  return true;
148  }
149  else if (oid2.code == TrackingCode::L5Q)
150  {
151  corr = ((iscL5Q5 - (gamma15 * iscL1CA)) / (1-gamma15)) - isc;
152  return true;
153  }
154  }
155  else if ((oid1.band == CarrierBand::L1) &&
156  (oid1.code == TrackingCode::CA) &&
157  (oid2.band == CarrierBand::L2) &&
158  ((oid2.code == TrackingCode::L2CM) ||
159  (oid2.code == TrackingCode::L2CL) ||
160  (oid2.code == TrackingCode::L2CML)))
161  {
162  // per IS-GPS-200 30.3.3.3.1.1.2
163  double gamma12 = getGamma(oid1.band,oid2.band);
164  corr = ((iscL2C - (gamma12 * iscL1CA)) / (1-gamma12)) - isc;
165  return true;
166  }
167  return false;
168  }
169 }
gnsstk::NavSignalID::nav
NavType nav
Navigation message structure of this signal.
Definition: NavSignalID.hpp:96
YDSTime.hpp
gnsstk::getGamma
double getGamma(CarrierBand band1, CarrierBand band2)
Definition: FreqConv.cpp:67
gnsstk::TrackingCode::L5Q
@ L5Q
Modernized GPS L5 civil quadrature.
gnsstk::GPSCNavISC::getUserTime
CommonTime getUserTime() const override
Definition: GPSCNavISC.cpp:85
gnsstk::TrackingCode::L2CL
@ L2CL
Modernized GPS L2 civil L code.
gnsstk::GPSCNavISC::pre
uint32_t pre
The preamble from the start of the subframe.
Definition: GPSCNavISC.hpp:103
gnsstk::GPSCNavISC::getISC
bool getISC(const ObsID &oid, double &corr) const override
Definition: GPSCNavISC.cpp:94
example5.oid
oid
Definition: example5.py:29
gnsstk::TrackingCode::L5I
@ L5I
Modernized GPS L5 civil in-phase.
gnsstk::ObsID::band
CarrierBand band
Definition: ObsID.hpp:200
gnsstk::GPSCNavISC::validate
bool validate() const override
Definition: GPSCNavISC.cpp:78
gnsstk::NavData::signal
NavMessageID signal
Source signal identification for this navigation message data.
Definition: NavData.hpp:175
FreqConv.hpp
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::InterSigCorr::isc
double isc
Definition: InterSigCorr.hpp:171
gnsstk::GPSCNavISC::dumpCorrections
void dumpCorrections(std::ostream &s) const override
Definition: GPSCNavISC.cpp:62
gnsstk::CarrierBand::L2
@ L2
GPS L2, QZSS L2.
gnsstk::NavData::timeStamp
CommonTime timeStamp
Definition: NavData.hpp:173
gnsstk::TrackingCode::CA
@ CA
Legacy GPS civil code.
gnsstk::ObsID
Definition: ObsID.hpp:82
gnsstk::NavType::GPSCNAVL2
@ GPSCNAVL2
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::TrackingCode::L2CML
@ L2CML
Modernized GPS L2 civil M+L combined tracking.
gnsstk::ObsID::code
TrackingCode code
Definition: ObsID.hpp:201
gnsstk::CarrierBand::L1
@ L1
GPS L1, Galileo E1, SBAS L1, QZSS L1, BeiDou L1.
gnsstk::GPSCNavISC::iscL5I5
double iscL5I5
Intersignal corrections for L5 in-phase.
Definition: GPSCNavISC.hpp:107
gnsstk::TrackingCode::L2CM
@ L2CM
Modernized GPS L2 civil M code.
std
Definition: Angle.hpp:142
gnsstk::GPSCNavISC::iscL5Q5
double iscL5Q5
Intersignal corrections for L5 quadrature.
Definition: GPSCNavISC.hpp:108
GPSCNavISC.hpp
gnsstk::GPSCNavISC::iscL2C
double iscL2C
Intersignal corrections for L2C.
Definition: GPSCNavISC.hpp:106
gnsstk::GPSCNavISC::iscL1CA
double iscL1CA
Intersignal corrections for L1 C/A.
Definition: GPSCNavISC.hpp:105
TimeString.hpp
gnsstk::CarrierBand::L5
@ L5
GPS L5, Galileo E5a, SBAS L5, QZSS L5, BeiDou B2a, NavIC L5.


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