GNSSconstants.hpp
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 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #ifndef GNSSTK_GNSS_CONSTANTS_HPP
45 #define GNSSTK_GNSS_CONSTANTS_HPP
46 
47 #include "Exception.hpp"
48 #include "SatID.hpp"
49 #include "DeprecatedConsts.hpp"
50 
51 namespace gnsstk
52 {
59 
60  // ---------------- independent of GNSS ----------------------
62  const double PI = 3.141592653589793238462643383280;
64  const double DEG2RAD = PI / 180.0;
66  const double RAD2DEG = 180.0 / PI;
68  const double TWO_PI = 6.283185307179586476925286766559;
70  const double SQRT_PI = 1.772453850905516027298167483341;
72  const double REL_CONST = -4.442807633e-10;
74  const double C_MPS = 2.99792458e8;
76  static const double DEG_TO_RAD = 1.7453292519943e-2;
78  static const double RAD_TO_DEG = 57.295779513082;
80  static const double DEG_PER_MAS = 2.77777777777e-7;
82  static const double RAD_PER_MAS = 4.84813681e-9;
84  static const double PPB = 1.e-9;
85 
86  // ---------------- GPS --------------------------------------
88  const double OSC_FREQ_GPS = 10.23e6;
92  const double CA_CHIP_FREQ_GPS = OSC_FREQ_GPS / 10.0;
94  const double RSVCLK_GPS = 10.22999999543e6;
96  const double L1_MULT_GPS = 154.0;
98  const double L2_MULT_GPS = 120.0;
100  const double L5_MULT_GPS = 115.0;
104  const double GAMMA_GPS = 1.646944444; // legacy notation and hard-coded value; wherefore the extra "44"??
106  const double A_REF_GPS = 26559710.0;
108  const double OMEGADOT_REF_GPS = -2.6e-9 * PI;
109 
110  inline
111  short getLegacyFitInterval(const short iodc, const short fiti)
112  {
113  /* check the IODC */
114  if (iodc < 0 || iodc > 1023)
115  {
116  /* error in iodc, return minimum fit */
117  return 4;
118  }
119 
120  if ( ( ( (fiti == 0) && (iodc & 0xFF) < 240 )
121  || (iodc & 0xFF) > 255 ) )
122  {
123  /* fit interval of 4 hours */
124  return 4;
125  }
126  else if (fiti == 1)
127  {
128  if( ((iodc & 0xFF) < 240 || (iodc & 0xFF) > 255))
129  {
130  /* fit interval of 6 hours */
131  return 6;
132  }
133  else if(iodc >=240 && iodc <=247)
134  {
135  /* fit interval of 8 hours */
136  return 8;
137  }
138  else if( ( (iodc >= 248) && (iodc <= 255) ) || iodc == 496 )
139  {
140  /* fit interval of 14 hours */
141  return 14;
142  }
143  else if((iodc >= 497 && iodc <=503) || (iodc >= 1021 && iodc <= 1023))
144  {
145  /* fit interval of 26 hours */
146  return 26;
147  }
148  else if(iodc >= 504 && iodc <=510)
149  {
150  /* fit interval of 50 hours */
151  return 50;
152  }
153  else if( iodc == 511 || ( (iodc >= 752) && (iodc <= 756) ) )
154  {
155  /* fit interval of 74 hours */
156  return 74;
157  }
158  else if(iodc == 757)
159  {
160  /* fit interval of 98 hours */
161  return 98;
162  }
163  else
164  {
165  InvalidRequest exc("Invalid IODC Value For sv Block");
166  GNSSTK_THROW(exc);
167  }
168  }
169  else
170  {
171  /* error in ephemeris/iodc, return minimum fit */
172  return 4;
173  }
174 
175  return 0; // never reached
176  }
177 
178  // ---------------- GLONASS ----------------------------------
180  const double OSC_FREQ_GLO = 5.11e6;
184  const double CA_CHIP_FREQ_GLO = OSC_FREQ_GLO / 10.0;
185 
187  const double PSC_FREQ_GLO = 5.00e6;
189  const double RSVCLK_GLO = 4.99999999782e6;
190 
192  const double L1_MULT_GLO = 320.4;
194  const double L2_MULT_GLO = 249.2;
195 
200  const double SV_ACCURACY_GLO_INDEX[] = { 1.0, 2.0, 2.5, 4.0, 5.0,
201  7.0, 10.0, 12.0, 14.0, 16.0,
202  32.0, 64.0, 128.0, 256.0, 512.0,
203  9.999999999999e99 };
204 
205  // ---------------- BeiDou ----------------------------------
207  const long MAX_PRN_COM = 63;
209  const long MIN_GEO_BDS_II = 1;
211  const long MAX_GEO_BDS_II = 5;
213  const long MIN_MEO_BDS = 6;
215  const long MAX_MEO_BDS = 58;
217  const long MIN_GEO_BDS_III = 59;
219  const long MAX_GEO_BDS_III = 63;
220 
222  inline bool isBeiDouGEO(const SatID& sat)
223  {
224  return ((sat.system == SatelliteSystem::BeiDou) &&
225  (((sat.id >= MIN_GEO_BDS_II) && (sat.id <= MAX_GEO_BDS_II)) ||
226  ((sat.id >= MIN_GEO_BDS_III) && (sat.id <= MAX_GEO_BDS_III))));
227  }
228 
229  // ---------------- QZSS ----------------------------------
230  // PRN range defined in QZSS IS Table 3.2.2-2
231  // PRN 198-202 reserved for maint./test, not to be used
232  // by users.
233  // These need to be defined in order to differentiate
234  // QZSS from GPS in cases where QZSS is broadcasting
235  // GPS-similar signals and navigation messages.
236  // Note that 203-206 are "alternate" PRNs for satellites, see
237  // Table 3.2.1-1
238  // Defined as int to be compatible with gnsstk::SatID.id member.
240  const int MIN_PRN_QZS = 193;
242  const int MAX_PRN_QZS = 206;
244  const int MAX_PRN_QZS_LNAV = 202;
245 
247 
248 } // namespace
249 
250 // this is at the end because it needs some of the constants defined above
251 #include "FreqConsts.hpp"
252 
253 #endif //GNSSTK_GNSS_CONSTANTS_HPP
gnsstk::MIN_PRN_QZS
const int MIN_PRN_QZS
First assigned PRN in QZSS.
Definition: GNSSconstants.hpp:240
FreqConsts.hpp
gnsstk::SatID::id
int id
Satellite identifier, e.g. PRN.
Definition: SatID.hpp:154
gnsstk::MIN_MEO_BDS
const long MIN_MEO_BDS
The first ranging code number for BeiDou MEO/IGSO satellites.
Definition: GNSSconstants.hpp:213
gnsstk::DEG2RAD
const double DEG2RAD
Multiply degrees by DEG2RAD to get radians.
Definition: GNSSconstants.hpp:64
gnsstk::PSC_FREQ_GLO
const double PSC_FREQ_GLO
GLO Fundamental oscillator freq in Hz.
Definition: GNSSconstants.hpp:187
gnsstk::CA_CHIP_FREQ_GPS
const double CA_CHIP_FREQ_GPS
Hz, GPS chip rate of the C/A code.
Definition: GNSSconstants.hpp:92
gnsstk::SV_ACCURACY_GLO_INDEX_MAX
const int SV_ACCURACY_GLO_INDEX_MAX
Constant for the max array index in SV accuracy table.
Definition: GNSSconstants.hpp:197
gnsstk::MAX_PRN_COM
const long MAX_PRN_COM
The maximum number of active satellites in the Compass constellation.
Definition: GNSSconstants.hpp:207
gnsstk::SatID
Definition: SatID.hpp:89
SatID.hpp
gnsstk::L5_MULT_GPS
const double L5_MULT_GPS
GPS L5 frequency in units of oscillator frequency.
Definition: GNSSconstants.hpp:100
gnsstk::TWO_PI
const double TWO_PI
GPS value of PI*2.
Definition: GNSSconstants.hpp:68
gnsstk::PPB
static const double PPB
parts per billion
Definition: GNSSconstants.hpp:84
gnsstk::PI
const double PI
GPS value of PI; also specified by GAL.
Definition: GNSSconstants.hpp:62
gnsstk::GAMMA_GPS_15
const double GAMMA_GPS_15
Definition: GNSSconstants.hpp:103
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::isBeiDouGEO
bool isBeiDouGEO(const SatID &sat)
Return true if the given SatID is BeiDou GEO (expecting D2 nav).
Definition: GNSSconstants.hpp:222
gnsstk::L1_MULT_GLO
const double L1_MULT_GLO
GLO L1 multiplier.
Definition: GNSSconstants.hpp:192
gnsstk::GAMMA_GPS_12
const double GAMMA_GPS_12
GPS Gamma constants.
Definition: GNSSconstants.hpp:102
gnsstk::SV_ACCURACY_GLO_INDEX
const double SV_ACCURACY_GLO_INDEX[]
Definition: GNSSconstants.hpp:200
gnsstk::RAD2DEG
const double RAD2DEG
Multiply radians by RAD2DEG to get degrees.
Definition: GNSSconstants.hpp:66
gnsstk::OMEGADOT_REF_GPS
const double OMEGADOT_REF_GPS
Omega reference value from Table 30-I converted to radians.
Definition: GNSSconstants.hpp:108
gnsstk::RSVCLK_GLO
const double RSVCLK_GLO
GLO Base freq w/o relativisitic effects in Hz.
Definition: GNSSconstants.hpp:189
gnsstk::REL_CONST
const double REL_CONST
relativity constant (sec/sqrt(m))
Definition: GNSSconstants.hpp:72
gnsstk::RAD_TO_DEG
static const double RAD_TO_DEG
Conversion Factor from radians to degrees (units: degrees)
Definition: GNSSconstants.hpp:78
gnsstk::RSVCLK_GPS
const double RSVCLK_GPS
Hz, GPS Base freq w/o relativisitic effects.
Definition: GNSSconstants.hpp:94
gnsstk::C_MPS
const double C_MPS
m/s, speed of light; this value defined by GPS but applies to GAL and GLO.
Definition: GNSSconstants.hpp:74
gnsstk::L1_MULT_GPS
const double L1_MULT_GPS
GPS L1 frequency in units of oscillator frequency.
Definition: GNSSconstants.hpp:96
gnsstk::PY_CHIP_FREQ_GPS
const double PY_CHIP_FREQ_GPS
Hz, GPS chip rate of the P & Y codes.
Definition: GNSSconstants.hpp:90
gnsstk::OSC_FREQ_GPS
const double OSC_FREQ_GPS
Hz, GPS Oscillator or chip frequency.
Definition: GNSSconstants.hpp:88
gnsstk::getLegacyFitInterval
short getLegacyFitInterval(const short iodc, const short fiti)
Definition: GNSSconstants.hpp:111
gnsstk::MIN_GEO_BDS_II
const long MIN_GEO_BDS_II
The first ranging code number for BeiDou GEO phase II satellites.
Definition: GNSSconstants.hpp:209
gnsstk::RAD_PER_MAS
static const double RAD_PER_MAS
radians per milliarcsecond
Definition: GNSSconstants.hpp:82
gnsstk::MAX_GEO_BDS_II
const long MAX_GEO_BDS_II
The last ranging code number for BeiDou GEO phase II satellites.
Definition: GNSSconstants.hpp:211
DeprecatedConsts.hpp
gnsstk::SatID::system
SatelliteSystem system
System for this satellite.
Definition: SatID.hpp:156
gnsstk::OSC_FREQ_GLO
const double OSC_FREQ_GLO
GLO Fundamental chip rate in Hz.
Definition: GNSSconstants.hpp:180
gnsstk::GAMMA_GPS
const double GAMMA_GPS
Definition: GNSSconstants.hpp:104
Exception.hpp
gnsstk::DEG_PER_MAS
static const double DEG_PER_MAS
degrees per milliarcsecond (1e-3/3600.)
Definition: GNSSconstants.hpp:80
gnsstk::MIN_GEO_BDS_III
const long MIN_GEO_BDS_III
The first ranging code number for BeiDou GEO phase III satellites.
Definition: GNSSconstants.hpp:217
gnsstk::SQRT_PI
const double SQRT_PI
GPS value of PI**0.5.
Definition: GNSSconstants.hpp:70
gnsstk::MAX_GEO_BDS_III
const long MAX_GEO_BDS_III
The last ranging code number for BeiDou GEO phase III satellites.
Definition: GNSSconstants.hpp:219
gnsstk::L2_MULT_GLO
const double L2_MULT_GLO
GLO L2 multiplier.
Definition: GNSSconstants.hpp:194
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::MAX_PRN_QZS_LNAV
const int MAX_PRN_QZS_LNAV
Last assigned PRN in QZSS (LNAV only)
Definition: GNSSconstants.hpp:244
gnsstk::SatelliteSystem::BeiDou
@ BeiDou
aka Compass
gnsstk::A_REF_GPS
const double A_REF_GPS
Reference Semi-major axis. From IS-GPS-800 Table 3.5-2 in meters.
Definition: GNSSconstants.hpp:106
gnsstk::MAX_MEO_BDS
const long MAX_MEO_BDS
The last ranging code number for BeiDou MEO/IGSO satellites.
Definition: GNSSconstants.hpp:215
gnsstk::PY_CHIP_FREQ_GLO
const double PY_CHIP_FREQ_GLO
GLO Chip rate of the P & Y codes in Hz.
Definition: GNSSconstants.hpp:182
gnsstk::CA_CHIP_FREQ_GLO
const double CA_CHIP_FREQ_GLO
GLO Chip rate of the C/A code in Hz.
Definition: GNSSconstants.hpp:184
gnsstk::MAX_PRN_QZS
const int MAX_PRN_QZS
Last assigned PRN in QZSS (all signals)
Definition: GNSSconstants.hpp:242
gnsstk::DEG_TO_RAD
static const double DEG_TO_RAD
Conversion Factor from degrees to radians (units: degrees^-1)
Definition: GNSSconstants.hpp:76
gnsstk::L2_MULT_GPS
const double L2_MULT_GPS
GPS L2 frequency in units of oscillator frequency.
Definition: GNSSconstants.hpp:98


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