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


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