GPSCNav2ISC.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 "GPSCNav2ISC.hpp"
40 #include "TimeString.hpp"
41 #include "YDSTime.hpp"
42 #include "FreqConv.hpp"
43 
44 namespace gnsstk
45 {
48  : haveSF2(false),
49  haveSF3(false),
50  iscL1CP(std::numeric_limits<double>::quiet_NaN()),
51  iscL1CD(std::numeric_limits<double>::quiet_NaN()),
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 GPSCNav2ISC ::
62  dumpCorrections(std::ostream& s) const
63  {
64  using namespace std;
65  const ios::fmtflags oldFlags = s.flags();
66  s << " CORRECTION"
67  << endl << endl
68  << scientific << setprecision(8) << setfill(' ')
69  << setw(20) << left << "Tgd:" << setw(15) << isc << endl
70  << setw(20) << left << "ISC_L1CP:" << setw(15) << iscL1CP << endl
71  << setw(20) << left << "ISC_L1CD:" << setw(15) << iscL1CD << endl
72  << setw(20) << left << "ISC_L1CA:" << setw(15) << iscL1CA << endl
73  << setw(20) << left << "ISC_L2C:" << setw(15) << iscL2C << endl
74  << setw(20) << left << "ISC_L5I5:" << setw(15) << iscL5I5 << endl
75  << setw(20) << left << "ISC_L5Q5:" << setw(15) << iscL5Q5 << endl;
76  s.flags(oldFlags);
77  }
78 
79 
81  getUserTime() const
82  {
83  // subframe 2 = 12 seconds
84  // subframe 3 = 5.48 seconds
85  return std::max(xmit2+12, xmit3+5.48);
86  }
87 
88 
89  bool GPSCNav2ISC ::
90  validate() const
91  {
93  return true;
94  }
95 
96 
97  bool GPSCNav2ISC ::
98  getISC(const ObsID& oid, double& corr) const
99  {
100  // reminder: InterSigCorr::isc is used to store Tgd
101  switch (oid.band)
102  {
103  case CarrierBand::L1:
104  switch (oid.code)
105  {
106  case TrackingCode::CA:
107  corr = iscL1CA - isc;
108  return true;
109  case TrackingCode::L1CP:
110  corr = iscL1CP - isc;
111  return true;
112  case TrackingCode::L1CD:
113  corr = iscL1CD - isc;
114  return true;
115  }
116  break;
117  case CarrierBand::L2:
118  switch (oid.code)
119  {
120  case TrackingCode::L2CM:
121  case TrackingCode::L2CL:
122  case TrackingCode::L2CML:
123  corr = iscL2C - isc;
124  return true;
125  }
126  break;
127  case CarrierBand::L5:
128  // note this is only described in IS-GPS-705
129  switch (oid.code)
130  {
131  case TrackingCode::L5I:
132  corr = iscL5I5 - isc;
133  return true;
134  case TrackingCode::L5Q:
135  corr = iscL5Q5 - isc;
136  return true;
137  }
138  break;
139  }
140  return false;
141  }
142 
143 
144  bool GPSCNav2ISC ::
145  getISC(const ObsID& oid1, const ObsID& oid2, double& corr)
146  const
147  {
148  // reminder: InterSigCorr::isc is used to store Tgd
149  if ((oid1.band == CarrierBand::L1) &&
150  (oid1.code == TrackingCode::CA) &&
151  (oid2.band == CarrierBand::L5))
152  {
153  // per IS-GPS-705 20.3.3.3.1.2.2
154  double gamma15 = getGamma(oid1.band,oid2.band);
155  if (oid2.code == TrackingCode::L5I)
156  {
157  corr = ((iscL5I5 - (gamma15 * iscL1CA)) / (1-gamma15)) - isc;
158  return true;
159  }
160  else if (oid2.code == TrackingCode::L5Q)
161  {
162  corr = ((iscL5Q5 - (gamma15 * iscL1CA)) / (1-gamma15)) - isc;
163  return true;
164  }
165  }
166  else if ((oid2.band == CarrierBand::L2) &&
167  ((oid2.code == TrackingCode::L2CM) ||
168  (oid2.code == TrackingCode::L2CL) ||
169  (oid2.code == TrackingCode::L2CML)))
170  {
171  double gamma12 = getGamma(oid1.band,oid2.band);
172  if ((oid1.band == CarrierBand::L1) &&
173  (oid1.code == TrackingCode::CA))
174  {
175  // per IS-GPS-200 30.3.3.3.1.1.2
176  corr = ((iscL2C - (gamma12 * iscL1CA)) / (1-gamma12)) - isc;
177  return true;
178  }
179  else if ((oid1.band == CarrierBand::L1) &&
180  (oid1.code == TrackingCode::L1CP))
181  {
182  // per IS-GPS-800 3.5.3.9.2
183  corr = ((iscL2C - (gamma12 * iscL1CP)) / (1-gamma12)) - isc;
184  return true;
185  }
186  else if ((oid1.band == CarrierBand::L1) &&
187  (oid1.code == TrackingCode::L1CD))
188  {
189  // per IS-GPS-800 3.5.3.9.2
190  corr = ((iscL2C - (gamma12 * iscL1CD)) / (1-gamma12)) - isc;
191  return true;
192  }
193  }
194  return false;
195  }
196 }
gnsstk::GPSCNav2ISC::validate
bool validate() const override
Definition: GPSCNav2ISC.cpp:90
YDSTime.hpp
GPSCNav2ISC.hpp
gnsstk::getGamma
double getGamma(CarrierBand band1, CarrierBand band2)
Definition: FreqConv.cpp:67
gnsstk::TrackingCode::L1CD
@ L1CD
Modernized GPS L1C civil code tracking (data)
gnsstk::TrackingCode::L5Q
@ L5Q
Modernized GPS L5 civil quadrature.
gnsstk::GPSCNav2ISC::iscL2C
double iscL2C
Intersignal corrections for L2C.
Definition: GPSCNav2ISC.hpp:111
gnsstk::TrackingCode::L1CP
@ L1CP
Modernized GPS L1C civil code tracking (pilot)
gnsstk::TrackingCode::L2CL
@ L2CL
Modernized GPS L2 civil L code.
gnsstk::GPSCNav2ISC::iscL5Q5
double iscL5Q5
Intersignal corrections for L5 quadrature.
Definition: GPSCNav2ISC.hpp:113
gnsstk::max
T max(const SparseMatrix< T > &SM)
Maximum element - return 0 if empty.
Definition: SparseMatrix.hpp:881
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
FreqConv.hpp
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::InterSigCorr::isc
double isc
Definition: InterSigCorr.hpp:171
gnsstk::CarrierBand::L2
@ L2
GPS L2, QZSS L2.
gnsstk::GPSCNav2ISC::GPSCNav2ISC
GPSCNav2ISC()
Sets the internal data members.
Definition: GPSCNav2ISC.cpp:47
gnsstk::TrackingCode::CA
@ CA
Legacy GPS civil code.
gnsstk::GPSCNav2ISC::getISC
bool getISC(const ObsID &oid, double &corr) const override
Definition: GPSCNav2ISC.cpp:98
gnsstk::ObsID
Definition: ObsID.hpp:82
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::GPSCNav2ISC::xmit3
CommonTime xmit3
Transmit time of subframe 3.
Definition: GPSCNav2ISC.hpp:107
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::GPSCNav2ISC::iscL1CA
double iscL1CA
Intersignal corrections for L1 C/A.
Definition: GPSCNav2ISC.hpp:110
gnsstk::TrackingCode::L2CM
@ L2CM
Modernized GPS L2 civil M code.
std
Definition: Angle.hpp:142
gnsstk::GPSCNav2ISC::iscL1CP
double iscL1CP
Intersignal corrections for L1 CP.
Definition: GPSCNav2ISC.hpp:108
gnsstk::GPSCNav2ISC::dumpCorrections
void dumpCorrections(std::ostream &s) const override
Definition: GPSCNav2ISC.cpp:62
gnsstk::GPSCNav2ISC::iscL1CD
double iscL1CD
Intersignal corrections for L1 CD.
Definition: GPSCNav2ISC.hpp:109
gnsstk::GPSCNav2ISC::getUserTime
CommonTime getUserTime() const override
Definition: GPSCNav2ISC.cpp:81
gnsstk::GPSCNav2ISC::iscL5I5
double iscL5I5
Intersignal corrections for L5 in-phase.
Definition: GPSCNav2ISC.hpp:112
TimeString.hpp
gnsstk::GPSCNav2ISC::xmit2
CommonTime xmit2
Transmit time of subframe 2.
Definition: GPSCNav2ISC.hpp:106
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