GPSCNav2Eph.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 "GPSCNav2Eph.hpp"
40 #include "GPSWeekSecond.hpp"
41 #include "TimeString.hpp"
42 
43 using namespace std;
44 
45 namespace gnsstk
46 {
47  const double GPSCNav2Eph::refAGPS = 26559710;
48  const double GPSCNav2Eph::refOMEGAdotGPS = -2.6e-9 * PI;
49  const double GPSCNav2Eph::refAQZSS = 42164200;
50  const double GPSCNav2Eph::refOMEGAdotQZSS = -2.6e-9 * PI;
51 
52  GPSCNav2Eph ::
53  GPSCNav2Eph()
54  : healthL1C(true),
55  uraED(-16),
56  uraNED0(-16),
57  uraNED1(0),
58  uraNED2(0),
59  integStat(false),
60  deltaA(0.0),
61  dOMEGAdot(0.0),
63  tgd(0.0),
64  iscL1CP(0.0),
65  iscL1CD(0.0)
66  {
68  msgLenSec = 12.0;
69  }
70 
71 
72  bool GPSCNav2Eph ::
73  validate() const
74  {
76  return true;
77  }
78 
79 
80  void GPSCNav2Eph ::
82  {
83  GPSWeekSecond xws(xmitTime), toeWS(Toe);
84  int xmitWeek = xws.week;
85  long xmitSOW = (long) xws.sow;
89  bool isNominalToe = (long)toeWS.sow % 7200 == 90*60;
90  endFit = Toe + 90*60;
91 
92  // If the toe is NOT offset, then the begin valid time can be set
93  // to the beginning of the two hour interval.
94  if (signal.system==SatelliteSystem::GPS && isNominalToe)
95  {
96  xmitSOW = xmitSOW - (xmitSOW % 7200);
97  }
98 
99  // If there IS an offset, all we can assume is that we (hopefully)
100  // captured the earliest transmission and set the begin valid time
101  // to that value.
102  //
103  // @note Prior to GPS III, the offset was typically applied
104  // to BOTH the first and second data sets following a
105  // cutover. So this means the SECOND data set will NOT be
106  // coerced to the top of the even hour start time if it
107  // wasn't collected at the top of the hour.
108  beginFit = GPSWeekSecond(xmitWeek, xmitSOW, xws.getTimeSystem());
109  // If an upload cutover, need some adjustment.
110  if (!isNominalToe)
111  {
112  endFit += 300;
113  }
114  }
115 
116 
117  void GPSCNav2Eph ::
118  dumpSVStatus(std::ostream& s) const
119  {
120  const ios::fmtflags oldFlags = s.flags();
121  s.setf(ios::fixed, ios::floatfield);
122  s.setf(ios::right, ios::adjustfield);
123  s.setf(ios::uppercase);
124  s.precision(0);
125  s.fill(' ');
126  s << " ACCURACY PARAMETERS"
127  << endl
128  << endl
129  << "ED accuracy index : " << setfill(' ')
130  << dec << setw(4) << (int) uraED << endl
131  << "NED accuracy indices 0, 1, 2 : " << setfill(' ')
132  << dec << setw(4) << (int) uraNED0 << ", "
133  << dec << setw(4) << (unsigned) uraNED1 << ", "
134  << dec << setw(4) << (unsigned) uraNED2 << endl
135  << "Integrity Status Flag : "
136  << (integStat ? "1 (Enhanced)" : "0 (Legacy)")
137  << endl << endl << endl
138  << " " << getDumpTimeHdr(DumpDetail::Full) << endl
139  << "Predict : " << getDumpTime(DumpDetail::Full, top) << endl
140  << endl
141  << " SV STATUS"
142  << endl
143  << endl
144  << "Health L1C : " << setfill('0') << setw(1)
145  << healthL1C << endl
146  << "Tgd :"
147  << setw(16) << setprecision(8) << scientific << setfill(' ') << tgd
148  << " sec" << endl
149  << "ISC L1CP :"
150  << setw(16) << setprecision(8) << scientific << setfill(' ') << iscL1CP
151  << " sec" << endl
152  << "ISC L1CD :"
153  << setw(16) << setprecision(8) << scientific << setfill(' ') << iscL1CD
154  << " sec" << endl
155  << "delta A :"
156  << setw(16) << setprecision(8) << scientific << setfill(' ') << deltaA
157  << " m" << endl
158  << "delta OMEGA dot :"
159  << setw(16) << setprecision(8) << scientific << setfill(' ')
160  << dOMEGAdot << " rad" << endl
161  << endl
162  << " TRANSMIT TIMES" << endl << endl
163  << " " << getDumpTimeHdr(DumpDetail::Full) << endl
164  << "Subframe 2: " << getDumpTime(DumpDetail::Full, xmitTime) << endl;
165  s.flags(oldFlags);
166  }
167 }
GPSCNav2Eph.hpp
gnsstk::NavData::msgLenSec
double msgLenSec
Definition: NavData.hpp:199
gnsstk::BEGINNING_OF_TIME
const Epoch BEGINNING_OF_TIME(CommonTime::BEGINNING_OF_TIME)
Earliest representable Epoch.
gnsstk::NavMessageID::messageType
NavMessageType messageType
Definition: NavMessageID.hpp:97
gnsstk::GPSCNav2Eph::uraNED0
int8_t uraNED0
non-elevation dependent URA from clock message.
Definition: GPSCNav2Eph.hpp:88
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::NavData::getDumpTimeHdr
std::string getDumpTimeHdr(DumpDetail dl) const
Definition: NavData.cpp:127
gnsstk::PI
const double PI
GPS value of PI; also specified by GAL.
Definition: GNSSconstants.hpp:62
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::GPSCNav2Eph::dumpSVStatus
void dumpSVStatus(std::ostream &s) const override
Definition: GPSCNav2Eph.cpp:118
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GPSCNav2Eph::validate
bool validate() const override
Definition: GPSCNav2Eph.cpp:73
gnsstk::GPSCNav2Eph::top
CommonTime top
Time of prediction.
Definition: GPSCNav2Eph.hpp:94
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::GPSCNav2Eph::uraNED2
uint8_t uraNED2
non-elevation dependent URA from clock message.
Definition: GPSCNav2Eph.hpp:90
gnsstk::GPSCNav2Eph::healthL1C
bool healthL1C
L1C signal health.
Definition: GPSCNav2Eph.hpp:86
gnsstk::GPSCNav2Eph::dOMEGAdot
double dOMEGAdot
Rate of right ascension relative to -2.6e-9*pi.
Definition: GPSCNav2Eph.hpp:93
gnsstk::GPSCNav2Eph::uraED
int8_t uraED
5-bit URA index from message type 10.
Definition: GPSCNav2Eph.hpp:87
gnsstk::GPSCNav2Eph::iscL1CP
double iscL1CP
Inter-signal correction for L1CP.
Definition: GPSCNav2Eph.hpp:96
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::WeekSecond::sow
double sow
Definition: WeekSecond.hpp:155
gnsstk::GPSCNav2Eph::uraNED1
uint8_t uraNED1
non-elevation dependent URA from clock message.
Definition: GPSCNav2Eph.hpp:89
gnsstk::NavFit::beginFit
CommonTime beginFit
Time at beginning of fit interval.
Definition: NavFit.hpp:54
gnsstk::GPSCNav2Eph::tgd
double tgd
Ionospheric group delay in seconds. NaN=invalid.
Definition: GPSCNav2Eph.hpp:95
gnsstk::DumpDetail::Full
@ Full
Include all detailed information.
GPSWeekSecond.hpp
gnsstk::GPSCNav2Eph::iscL1CD
double iscL1CD
Inter-signal correction for L1CD.
Definition: GPSCNav2Eph.hpp:97
std
Definition: Angle.hpp:142
gnsstk::NavMessageType::Ephemeris
@ Ephemeris
Precision orbits for the transmitting SV.
gnsstk::GPSCNav2Eph::integStat
bool integStat
Integrity status flag.
Definition: GPSCNav2Eph.hpp:91
gnsstk::GPSCNav2Eph::fixFit
void fixFit()
Definition: GPSCNav2Eph.cpp:81
TimeString.hpp
gnsstk::GPSCNav2Eph::deltaA
double deltaA
Semi-major axis relative to reference (Aref).
Definition: GPSCNav2Eph.hpp:92


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