BDSD2NavISC.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 <cmath>
40 #include "BDSD2NavISC.hpp"
41 #include "FreqConv.hpp"
42 
43 using namespace std;
44 
45 namespace gnsstk
46 {
47  BDSD2NavISC ::
48  BDSD2NavISC()
49  : pre(0),
50  rev(0),
51  fraID(0),
52  sow(0),
53  tgd1(std::numeric_limits<double>::quiet_NaN()),
54  tgd2(std::numeric_limits<double>::quiet_NaN())
55  {
56  weekFmt = "%4D(%4e)";
57  msgLenSec = 6.0;
58  }
59 
60 
61  void BDSD2NavISC ::
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 << "Tgd1:" << setw(15) << tgd1 << endl
69  << setw(20) << left << "Tgd2:" << setw(15) << tgd2 << endl;
70  s.flags(oldFlags);
71  }
72 
73 
74  bool BDSD2NavISC ::
75  validate() const
76  {
77  return (!(std::isnan(tgd1) || std::isnan(tgd2)) &&
78  ((pre == 0) || (pre == 0x712)) &&
79  (fraID == 1));
80  }
81 
82 
83  bool BDSD2NavISC ::
84  getISC(const ObsID& oid, double& corrOut)
85  const
86  {
87  if ((oid.band == CarrierBand::B1) && (oid.code == TrackingCode::B1I))
88  {
89  if (std::isnan(tgd1))
90  return false;
91  corrOut = -tgd1;
92  return true;
93  }
94  else if ((oid.band == CarrierBand::B2) && (oid.code == TrackingCode::B2I))
95  {
96  if (std::isnan(tgd2))
97  return false;
98  corrOut = -tgd2;
99  return true;
100  }
101  return false;
102  }
103 
104 
105  bool BDSD2NavISC ::
106  getISC(const ObsID& oid1, const ObsID& oid2, double& corrOut)
107  const
108  {
109  // This is the only code combination documented in ICD-B3I,
110  // other code ICDs may include more.
111  if ((oid1.band == CarrierBand::B1) && (oid1.code == TrackingCode::B1I) &&
112  (oid2.band == CarrierBand::B3) && (oid2.code == TrackingCode::B3I))
113  {
114  double gamma13 = getGamma(oid1.band,oid2.band);
115  corrOut = (gamma13 * tgd1) / (1-gamma13);
116  return true;
117  }
118  return false;
119  }
120 }
gnsstk::NavData::msgLenSec
double msgLenSec
Definition: NavData.hpp:199
gnsstk::getGamma
double getGamma(CarrierBand band1, CarrierBand band2)
Definition: FreqConv.cpp:67
gnsstk::BDSD2NavISC::dumpCorrections
void dumpCorrections(std::ostream &s) const override
Definition: BDSD2NavISC.cpp:62
example5.oid
oid
Definition: example5.py:29
gnsstk::ObsID::band
CarrierBand band
Definition: ObsID.hpp:200
FreqConv.hpp
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::BDSD2NavISC::tgd1
double tgd1
Group delay differential on B1I.
Definition: BDSD2NavISC.hpp:99
gnsstk::NavData::weekFmt
std::string weekFmt
Definition: NavData.hpp:193
gnsstk::BDSD2NavISC::pre
uint32_t pre
The preamble from word 1 of the subframe.
Definition: BDSD2NavISC.hpp:95
gnsstk::BDSD2NavISC::validate
bool validate() const override
Definition: BDSD2NavISC.cpp:75
gnsstk::CarrierBand::B3
@ B3
BeiDou B3.
gnsstk::CarrierBand::B1
@ B1
BeiDou B1.
gnsstk::ObsID
Definition: ObsID.hpp:82
gnsstk::TrackingCode::B1I
@ B1I
BeiDou B1 I code.
gnsstk::ObsID::code
TrackingCode code
Definition: ObsID.hpp:201
gnsstk::BDSD2NavISC::getISC
bool getISC(const ObsID &oid, double &corrOut) const override
Definition: BDSD2NavISC.cpp:84
gnsstk::CarrierBand::B2
@ B2
BeiDou B2b.
std
Definition: Angle.hpp:142
gnsstk::TrackingCode::B3I
@ B3I
BeiDou B3 I code.
gnsstk::BDSD2NavISC::fraID
uint8_t fraID
The subframe ID (FraID) from word 1 of the subframe.
Definition: BDSD2NavISC.hpp:97
BDSD2NavISC.hpp
gnsstk::BDSD2NavISC::tgd2
double tgd2
Group delay differential on B2I.
Definition: BDSD2NavISC.hpp:100
gnsstk::TrackingCode::B2I
@ B2I
BeiDou B2 I code.


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