GPSCNavEph.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 "GPSCNavEph.hpp"
40 #include "GPSWeekSecond.hpp"
41 #include "TimeString.hpp"
42 
43 using namespace std;
44 
45 namespace gnsstk
46 {
47  GPSCNavEph ::
48  GPSCNavEph()
49  : pre11(0),
50  preClk(0),
51  healthL1(true),
52  healthL2(true),
53  healthL5(true),
54  uraED(-16),
55  uraNED0(-16),
56  uraNED1(0),
57  uraNED2(0),
58  alert11(false),
59  alertClk(false),
60  integStat(false),
61  phasingL2C(false),
62  deltaA(0.0),
63  dOMEGAdot(0.0),
67  {
69  }
70 
71 
72  bool GPSCNavEph ::
73  validate() const
74  {
75  return GPSCNavData::validate() && ((pre11 == 0) || (pre11 == 0x8b)) &&
76  ((preClk == 0) || (preClk == 0x8b));
77  }
78 
79 
81  getUserTime() const
82  {
85  return mr + 12.0;
86  return mr + 6.0;
87  }
88 
89 
90  void GPSCNavEph ::
92  {
93  CommonTime xmit1st = std::min({xmitTime, xmit11, xmitClk});
94  GPSWeekSecond xws(xmit1st), toeWS(Toe);
95  int xmitWeek = xws.week;
96  long xmitSOW = (long) xws.sow;
100  bool isNominalToe = (long)toeWS.sow % 7200 == 90*60;
101  endFit = Toe + 90*60;
102 
103  // If the toe is NOT offset, then the begin valid time can be set
104  // to the beginning of the two hour interval.
105  if (signal.system==SatelliteSystem::GPS && isNominalToe)
106  {
107  xmitSOW = xmitSOW - (xmitSOW % 7200);
108  }
109 
110  // If there IS an offset, all we can assume is that we (hopefully)
111  // captured the earliest transmission and set the begin valid time
112  // to that value.
113  //
114  // @note Prior to GPS III, the offset was typically applied
115  // to BOTH the first and second data sets following a
116  // cutover. So this means the SECOND data set will NOT be
117  // coerced to the top of the even hour start time if it
118  // wasn't collected at the top of the hour.
119  beginFit = GPSWeekSecond(xmitWeek, xmitSOW, xws.getTimeSystem());
120  // If an upload cutover, need some adjustment.
121  if (!isNominalToe)
122  {
123  endFit += 300;
124  }
125  }
126 
127 
128  void GPSCNavEph ::
129  dumpSVStatus(std::ostream& s) const
130  {
131  const ios::fmtflags oldFlags = s.flags();
132  s.setf(ios::fixed, ios::floatfield);
133  s.setf(ios::right, ios::adjustfield);
134  s.setf(ios::uppercase);
135  s.precision(0);
136  s.fill(' ');
137  s << " ACCURACY PARAMETERS"
138  << endl
139  << endl
140  << "ED accuracy index : " << setfill(' ')
141  << dec << setw(4) << (int) uraED << endl
142  << "NED accuracy indices 0, 1, 2 : " << setfill(' ')
143  << dec << setw(4) << (int) uraNED0 << ", "
144  << dec << setw(4) << (unsigned) uraNED1 << ", "
145  << dec << setw(4) << (unsigned) uraNED2 << endl
146  << "Integrity Status Flag : "
147  << (integStat ? "1 (Enhanced)" : "0 (Legacy)")
148  << endl << endl << endl
149  << " " << getDumpTimeHdr(DumpDetail::Full) << endl
150  << "Predict : " << getDumpTime(DumpDetail::Full, top) << endl
151  << endl
152  << " SV STATUS"
153  << endl
154  << endl
155  << "Health bits L1, L2, L5 : " << setfill('0') << setw(1)
156  << healthL1 << ", " << healthL2 << ", " << healthL5
157  << endl
158  << "L2C Phasing : " << setfill(' ')
159  << phasingL2C << " (0=quadrature, 1=in-phase)"
160  << endl << endl << endl
161  << " TRANSMIT TIMES" << endl << endl
162  << " " << getDumpTimeHdr(DumpDetail::Full) << endl
163  << "Message 10: " << getDumpTime(DumpDetail::Full, xmitTime) << endl
164  << "Message 11: " << getDumpTime(DumpDetail::Full, xmit11) << endl
165  << "Clock: " << getDumpTime(DumpDetail::Full, xmitClk) << endl;
166  s.flags(oldFlags);
167  }
168 }
gnsstk::NavSignalID::nav
NavType nav
Navigation message structure of this signal.
Definition: NavSignalID.hpp:96
gnsstk::GPSCNavEph::uraNED2
uint8_t uraNED2
non-elevation dependent URA from clock message.
Definition: GPSCNavEph.hpp:95
gnsstk::GPSCNavEph::healthL2
bool healthL2
L2 signal health from message type 10.
Definition: GPSCNavEph.hpp:90
gnsstk::BEGINNING_OF_TIME
const Epoch BEGINNING_OF_TIME(CommonTime::BEGINNING_OF_TIME)
Earliest representable Epoch.
gnsstk::GPSCNavEph::dumpSVStatus
void dumpSVStatus(std::ostream &s) const override
Definition: GPSCNavEph.cpp:129
gnsstk::GPSCNavEph::xmit11
CommonTime xmit11
Transmit time for message 11.
Definition: GPSCNavEph.hpp:103
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
gnsstk::max
T max(const SparseMatrix< T > &SM)
Maximum element - return 0 if empty.
Definition: SparseMatrix.hpp:881
gnsstk::NavData::getDumpTime
std::string getDumpTime(DumpDetail dl, const CommonTime &t) const
Definition: NavData.cpp:145
gnsstk::NavFit::endFit
CommonTime endFit
Time at end of fit interval.
Definition: NavFit.hpp:55
gnsstk::GPSCNavEph::uraED
int8_t uraED
5-bit URA index from message type 10.
Definition: GPSCNavEph.hpp:92
gnsstk::NavData::getDumpTimeHdr
std::string getDumpTimeHdr(DumpDetail dl) const
Definition: NavData.cpp:127
gnsstk::OrbitDataKepler::Toe
CommonTime Toe
Orbit epoch.
Definition: OrbitDataKepler.hpp:171
gnsstk::NavData::signal
NavMessageID signal
Source signal identification for this navigation message data.
Definition: NavData.hpp:175
gnsstk::GPSCNavEph::xmitClk
CommonTime xmitClk
Transmit time for the clock message.
Definition: GPSCNavEph.hpp:104
gnsstk::GPSCNavEph::healthL1
bool healthL1
L1 signal health from message type 10.
Definition: GPSCNavEph.hpp:89
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GPSWeekSecond
Definition: GPSWeekSecond.hpp:56
gnsstk::OrbitDataKepler::xmitTime
CommonTime xmitTime
Time of transmission of the start of the data.
Definition: OrbitDataKepler.hpp:170
gnsstk::SatelliteSystem::GPS
@ GPS
gnsstk::NavSignalID::system
SatelliteSystem system
GNSS for this signal.
Definition: NavSignalID.hpp:94
gnsstk::GPSCNavEph::fixFit
void fixFit()
Definition: GPSCNavEph.cpp:91
gnsstk::GPSCNavEph::preClk
uint32_t preClk
Definition: GPSCNavEph.hpp:87
gnsstk::NavType::GPSCNAVL2
@ GPSCNAVL2
gnsstk::GPSCNavEph::healthL5
bool healthL5
L5 signal health from message type 10.
Definition: GPSCNavEph.hpp:91
gnsstk::GPSCNavEph::phasingL2C
bool phasingL2C
L2C phasing.
Definition: GPSCNavEph.hpp:99
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::min
T min(const SparseMatrix< T > &SM)
Maximum element - return 0 if empty.
Definition: SparseMatrix.hpp:858
gnsstk::GPSCNavEph::pre11
uint32_t pre11
The preamble from the start of message type 11.
Definition: GPSCNavEph.hpp:86
gnsstk::GPSCNavEph::integStat
bool integStat
Integrity status flag.
Definition: GPSCNavEph.hpp:98
gnsstk::NavFit::beginFit
CommonTime beginFit
Time at beginning of fit interval.
Definition: NavFit.hpp:54
gnsstk::DumpDetail::Full
@ Full
Include all detailed information.
GPSCNavEph.hpp
GPSWeekSecond.hpp
std
Definition: Angle.hpp:142
gnsstk::GPSCNavEph::getUserTime
CommonTime getUserTime() const override
Definition: GPSCNavEph.cpp:81
gnsstk::GPSCNavEph::validate
bool validate() const override
Definition: GPSCNavEph.cpp:73
gnsstk::GPSCNavEph::uraNED1
uint8_t uraNED1
non-elevation dependent URA from clock message.
Definition: GPSCNavEph.hpp:94
gnsstk::NavMessageType::Ephemeris
@ Ephemeris
Precision orbits for the transmitting SV.
gnsstk::GPSCNavEph::uraNED0
int8_t uraNED0
non-elevation dependent URA from clock message.
Definition: GPSCNavEph.hpp:93
TimeString.hpp
gnsstk::GPSCNavData::validate
bool validate() const override
Definition: GPSCNavData.cpp:67
gnsstk::GPSCNavEph::top
CommonTime top
Time of prediction.
Definition: GPSCNavEph.hpp:102


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