GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
gps_ephemeris.h
Go to the documentation of this file.
1 /*!
2  * \file gps_ephemeris.h
3  * \brief Interface of a GPS EPHEMERIS storage
4  * \author Javier Arribas, 2013. jarribas(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9  * This file is part of GNSS-SDR.
10  *
11  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 
18 #ifndef GNSS_SDR_GPS_EPHEMERIS_H
19 #define GNSS_SDR_GPS_EPHEMERIS_H
20 
21 
22 #include "gnss_ephemeris.h"
23 #include <boost/serialization/nvp.hpp>
24 #include <cstdint>
25 #include <map>
26 #include <string>
27 
28 /** \addtogroup Core
29  * \{ */
30 /** \addtogroup System_Parameters
31  * \{ */
32 
33 
34 /*!
35  * \brief This class is a storage and orbital model functions for the GPS SV
36  * ephemeris data as described in IS-GPS-200M
37  *
38  * See https://www.gps.gov/technical/icwg/IS-GPS-200M.pdf Appendix II
39  */
41 {
42 public:
43  /*!
44  * Default constructor
45  */
46  Gps_Ephemeris();
47 
48  int32_t code_on_L2{}; //!< If 1, P code ON in L2; if 2, C/A code ON in L2;
49  bool L2_P_data_flag{}; //!< When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel
50  int32_t SV_accuracy{}; //!< User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning service user (Ref 20.3.3.3.1.3 IS-GPS-200M)
51  int32_t SV_health{}; //!< Satellite heath status
52  double TGD{}; //!< Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(Y)" s users [s]
53  int32_t IODC{}; //!< Issue of Data, Clock
54  int32_t IODE_SF2{}; //!< Issue of Data, Ephemeris (IODE), subframe 2
55  int32_t IODE_SF3{}; //!< Issue of Data, Ephemeris (IODE), subframe 3
56  int32_t AODO{}; //!< Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subframe 4 (reference paragraph 20.3.3.5.1.9) [s]
57 
58  bool fit_interval_flag{}; //!< indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in determining the ephemeris parameters, as follows: 0 = 4 hours, 1 = greater than 4 hours.
59  double spare1{};
60  double spare2{};
61 
62  // Flags
63 
64  /*! \brief If true, enhanced level of integrity assurance.
65  *
66  * If false, indicates that the conveying signal is provided with the legacy level of integrity assurance.
67  * That is, the probability that the instantaneous URE of the conveying signal exceeds 4.42 times the upper bound
68  * value of the current broadcast URA index, for more than 5.2 seconds, without an accompanying alert, is less
69  * than 1E-5 per hour. If true, indicates that the conveying signal is provided with an enhanced level of
70  * integrity assurance. That is, the probability that the instantaneous URE of the conveying signal exceeds 5.73
71  * times the upper bound value of the current broadcast URA index, for more than 5.2 seconds, without an
72  * accompanying alert, is less than 1E-8 per hour.
73  */
75  bool alert_flag{}; //!< If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our own risk.
76  bool antispoofing_flag{}; //!< If true, the AntiSpoofing mode is ON in that SV
77 
78  std::map<int, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus
79 
80  template <class Archive>
81 
82  /*!
83  * \brief Serialize is a boost standard method to be called by the boost XML
84  * serialization. Here is used to save the ephemeris data on disk file.
85  */
86  inline void serialize(Archive& archive, const uint32_t version)
87  {
88  using boost::serialization::make_nvp;
89  if (version)
90  {
91  };
92 
93  archive& BOOST_SERIALIZATION_NVP(PRN);
94  archive& BOOST_SERIALIZATION_NVP(M_0);
95  archive& BOOST_SERIALIZATION_NVP(delta_n);
96  archive& BOOST_SERIALIZATION_NVP(ecc);
97  archive& BOOST_SERIALIZATION_NVP(sqrtA);
98  archive& BOOST_SERIALIZATION_NVP(OMEGA_0);
99  archive& BOOST_SERIALIZATION_NVP(i_0);
100  archive& BOOST_SERIALIZATION_NVP(omega);
101  archive& BOOST_SERIALIZATION_NVP(OMEGAdot);
102  archive& BOOST_SERIALIZATION_NVP(idot);
103  archive& BOOST_SERIALIZATION_NVP(Cuc);
104  archive& BOOST_SERIALIZATION_NVP(Cus);
105  archive& BOOST_SERIALIZATION_NVP(Crc);
106  archive& BOOST_SERIALIZATION_NVP(Crs);
107  archive& BOOST_SERIALIZATION_NVP(Cic);
108  archive& BOOST_SERIALIZATION_NVP(Cis);
109  archive& BOOST_SERIALIZATION_NVP(toe);
110  archive& BOOST_SERIALIZATION_NVP(toc);
111  archive& BOOST_SERIALIZATION_NVP(af0);
112  archive& BOOST_SERIALIZATION_NVP(af1);
113  archive& BOOST_SERIALIZATION_NVP(af2);
114  archive& BOOST_SERIALIZATION_NVP(WN);
115  archive& BOOST_SERIALIZATION_NVP(tow);
116  archive& BOOST_SERIALIZATION_NVP(satClkDrift);
117  archive& BOOST_SERIALIZATION_NVP(dtr);
118 
119  archive& BOOST_SERIALIZATION_NVP(IODE_SF2);
120  archive& BOOST_SERIALIZATION_NVP(IODE_SF3);
121  archive& BOOST_SERIALIZATION_NVP(code_on_L2);
122  archive& BOOST_SERIALIZATION_NVP(L2_P_data_flag);
123  archive& BOOST_SERIALIZATION_NVP(SV_accuracy);
124  archive& BOOST_SERIALIZATION_NVP(SV_health);
125  archive& BOOST_SERIALIZATION_NVP(TGD);
126  archive& BOOST_SERIALIZATION_NVP(IODC);
127  archive& BOOST_SERIALIZATION_NVP(AODO);
128  archive& BOOST_SERIALIZATION_NVP(fit_interval_flag);
129  archive& BOOST_SERIALIZATION_NVP(spare1);
130  archive& BOOST_SERIALIZATION_NVP(spare2);
131  archive& BOOST_SERIALIZATION_NVP(integrity_status_flag);
132  archive& BOOST_SERIALIZATION_NVP(alert_flag);
133  archive& BOOST_SERIALIZATION_NVP(antispoofing_flag);
134  }
135 };
136 
137 
138 /** \} */
139 /** \} */
140 #endif // GNSS_SDR_GPS_EPHEMERIS_H
void serialize(Archive &archive, const uint32_t version)
Serialize is a boost standard method to be called by the boost XML serialization. Here is used to sav...
Definition: gps_ephemeris.h:86
bool alert_flag
If true, indicates that the SV URA may be worse than indicated in d_SV_accuracy, use that SV at our o...
Definition: gps_ephemeris.h:75
This class is a storage and orbital model functions for the GPS SV ephemeris data as described in IS-...
Definition: gps_ephemeris.h:40
int32_t code_on_L2
If 1, P code ON in L2; if 2, C/A code ON in L2;.
Definition: gps_ephemeris.h:48
bool integrity_status_flag
If true, enhanced level of integrity assurance.
Definition: gps_ephemeris.h:74
int32_t AODO
Age of Data Offset (AODO) term for the navigation message correction table (NMCT) contained in subfra...
Definition: gps_ephemeris.h:56
int32_t SV_accuracy
User Range Accuracy (URA) index of the SV (reference paragraph 6.2.1) for the standard positioning se...
Definition: gps_ephemeris.h:50
double i_0
Inclination angle at reference time [rad].
double OMEGA_0
Longitude of ascending node of orbital plane at weekly epoch [rad].
int32_t IODE_SF3
Issue of Data, Ephemeris (IODE), subframe 3.
Definition: gps_ephemeris.h:55
double TGD
Estimated Group Delay Differential: L1-L2 correction term only for the benefit of "L1 P(Y)" or "L2 P(...
Definition: gps_ephemeris.h:52
int32_t toc
Clock correction data reference Time of Week [sec].
int32_t IODC
Issue of Data, Clock.
Definition: gps_ephemeris.h:53
std::map< int, std::string > satelliteBlock
Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus.
Definition: gps_ephemeris.h:78
double Crc
Amplitude of the cosine harmonic correction term to the orbit radius [meters].
bool L2_P_data_flag
When true, indicates that the NAV data stream was commanded OFF on the P-code of the L2 channel...
Definition: gps_ephemeris.h:49
double af2
SV clock drift rate correction coefficient [s/s^2].
bool antispoofing_flag
If true, the AntiSpoofing mode is ON in that SV.
Definition: gps_ephemeris.h:76
uint32_t PRN
SV ID.
double Cis
Amplitude of the sine harmonic correction term to the angle of inclination [rad]. ...
double af0
SV clock bias correction coefficient [s].
bool fit_interval_flag
indicates the curve-fit interval used by the CS (Block II/IIA/IIR/IIR-M/IIF) and SS (Block IIIA) in d...
Definition: gps_ephemeris.h:58
Base class for GNSS Ephemeris.
double ecc
Eccentricity.
double M_0
Mean anomaly at reference time [rad].
int32_t WN
Week number.
int32_t toe
Ephemeris reference time [s].
int32_t tow
Time of Week.
double Cus
Amplitude of the sine harmonic correction term to the argument of latitude [rad]. ...
int32_t SV_health
Satellite heath status.
Definition: gps_ephemeris.h:51
double OMEGAdot
Rate of right ascension [rad/sec].
double delta_n
Mean motion difference from computed value [rad/sec].
double idot
Rate of inclination angle [rad/sec].
Base class for GNSS ephemeris storage.
double Cic
Amplitude of the cosine harmonic correction term to the angle of inclination [rad].
int32_t IODE_SF2
Issue of Data, Ephemeris (IODE), subframe 2.
Definition: gps_ephemeris.h:54
double Cuc
Amplitude of the cosine harmonic correction term to the argument of latitude [rad].
double omega
Argument of perigee [rad].
double af1
SV clock drift correction coefficient [s/s].
double Crs
Amplitude of the sine harmonic correction term to the orbit radius [meters].
double satClkDrift
SV clock drift.
double dtr
Relativistic clock correction term.
double sqrtA
Square root of the semi-major axis [meters^1/2].