GLOFNavAlm.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 //
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 #ifndef GNSSTK_GLOFNAVALM_HPP
40 #define GNSSTK_GLOFNAVALM_HPP
41 
42 #include "GLOFNavData.hpp"
43 #include "PZ90Ellipsoid.hpp"
44 #include "gnsstk_export.h"
45 
46 namespace gnsstk
47 {
49 
50 
53  class GLOFNavAlm : public GLOFNavData
54  {
55  public:
57  GNSSTK_EXPORT static const PZ90Ellipsoid ell;
59  GNSSTK_EXPORT static const double mu;
61  GNSSTK_EXPORT static const double ae;
65  GNSSTK_EXPORT static constexpr double omega3 = 0.7292115e-4;
67  GNSSTK_EXPORT static const double icp;
69  GNSSTK_EXPORT static const double Tcp;
71  GNSSTK_EXPORT static const double C20;
73  GNSSTK_EXPORT static const double J;
75  GNSSTK_EXPORT static const double C20Term;
76 
78  GLOFNavAlm();
80  NavDataPtr clone() const override
81  { return std::make_shared<GLOFNavAlm>(*this); }
82 
87  bool validate() const override;
88 
105  bool getXvt(const CommonTime& when, Xvt& xvt,
106  const ObsID& = ObsID()) override;
107 
115  CommonTime getUserTime() const override;
116 
120  void fixFit();
121 
126  void dump(std::ostream& s, DumpDetail dl) const override;
127 
130  void dumpTerse(std::ostream& s) const;
131 
133  void setSemiMajorAxisIncl();
134 
137  {
138  public:
140  NumberCruncher();
141 
147  void setEccArgOfPerigee(double ecc, double omega);
155  void setSemiMajorAxisIncl(double deltaT, double deltai, double omega,
156  double ecc);
170  void setLambdaBar(double M, double omega, double tau, double n);
182  void setDeltas(double M, double omega, double a, double dt);
194  static double getomegai(double hi, double li, double epsi);
201  static double integrateEin(double Mi, double epsi);
202 
203  bool getXvt(const CommonTime& when, Xvt& xvt, const GLOFNavAlm& alm);
204  private:
207  class Deltas
208  {
209  public:
211  Deltas();
222  void setDeltas(const NumberCruncher& nc, double a, double tau,
223  double n);
224  Deltas operator-(const Deltas& right) const;
225  double deltaa;
226  double deltah;
227  double deltal;
228  double deltaOMEGA;
229  double deltai;
231  };
232  // These are all terms defined in the ICD, however I can't
233  // say I know exactly what they represent, as the ICD
234  // frequently doesn't, hence the absence of documentation.
235  // A lot of these are values that are computed once and
236  // reused several time, an optimization favoring
237  // performance over memory use.
238  double lambdaBar;
239  double tau;
240  double nu;
241  double Tdeltap;
242  double n;
243  double a;
244  double i;
245  double coslambdaBar;
246  double sinlambdaBar;
247  double cos2lambdaBar;
248  double sin2lambdaBar;
249  double cos3lambdaBar;
250  double sin3lambdaBar;
251  double cos4lambdaBar;
252  double sin4lambdaBar;
253  double earthvs;
254  double sini;
255  double sini2;
256  double cosi;
257  double cosi2;
258  double JTerm;
259  double JsinTerm;
260  double Jsini2Term;
261  double Jcosi2Term;
262  double h;
263  double l;
264  double ecc2;
265  double ecc2obv;
267  friend class Deltas;
268  };
269 
270  // M_n^a is stored in GLOFNavData::satType
271  // slot (n^A) is stored in the signal structure and GLOFNavData::slot
272  // Note that in naming variables below, I've explicitly added
273  // "nA" to match the ICD notation to the extent we can and to
274  // hopefully reduce confusion due to overloaded variables.
276  bool healthBits;
277  // This is tau sub n sup A, not to be confused with tau used
278  // to compute the orbit.
279  double taunA;
280  double lambdanA;
281  double deltainA;
282  double eccnA;
283  double omeganA;
284  double tLambdanA;
285  double deltaTnA;
286  double deltaTdotnA;
287  int freqnA;
288  // These data members are computed by setSemiMajorAxisIncl,
289  // which should be done immediately following filling in the
290  // data above and calling fixFit() when decoding a GLONASS
291  // almanac.
293  };
294 
296 
297 }
298 
299 #endif // GNSSTK_GLOFNAVALM_HPP
gnsstk::NavDataPtr
std::shared_ptr< NavData > NavDataPtr
Factories instantiate these in response to find() requests.
Definition: NavData.hpp:62
gnsstk::GLOFNavAlm::NumberCruncher::tau
double tau
Definition: GLOFNavAlm.hpp:239
gnsstk::GLOFNavAlm::math
NumberCruncher math
Retain as much computed data as possible.
Definition: GLOFNavAlm.hpp:292
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::deltalambdaBar
double deltalambdaBar
Definition: GLOFNavAlm.hpp:230
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::deltai
double deltai
Definition: GLOFNavAlm.hpp:229
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::deltah
double deltah
Definition: GLOFNavAlm.hpp:226
gnsstk::GLOFNavAlm::deltaTnA
double deltaTnA
Correction to mean value of Draconian period (Delta T_n^A).
Definition: GLOFNavAlm.hpp:285
gnsstk::GLOFNavAlm::NumberCruncher::ecc2
double ecc2
ecc**2
Definition: GLOFNavAlm.hpp:264
gnsstk::GLOFNavAlm::NumberCruncher::sin3lambdaBar
double sin3lambdaBar
sin(3*lambdaBar)
Definition: GLOFNavAlm.hpp:250
gnsstk::GLOFNavAlm::NumberCruncher::setLambdaBar
void setLambdaBar(double M, double omega, double tau, double n)
Definition: GLOFNavAlm.cpp:361
gnsstk::GLOFNavAlm::NumberCruncher::nu
double nu
Definition: GLOFNavAlm.hpp:240
gnsstk::GLOFNavAlm::Tcp
static const GNSSTK_EXPORT double Tcp
Tcp</cp> as defined in GLONASS ICD appendix 3.2.1.
Definition: GLOFNavAlm.hpp:69
gnsstk::GLOFNavAlm::NumberCruncher::ecc2obv
double ecc2obv
1-ecc**2
Definition: GLOFNavAlm.hpp:265
gnsstk::GLOFNavAlm::NumberCruncher::JTerm
double JTerm
J * earthvs.
Definition: GLOFNavAlm.hpp:258
gnsstk::GLOFNavAlm::NumberCruncher::NumberCruncher
NumberCruncher()
Initialize stuff to NaN.
Definition: GLOFNavAlm.cpp:237
gnsstk::GLOFNavAlm::clone
NavDataPtr clone() const override
Create a deep copy of this object.
Definition: GLOFNavAlm.hpp:80
gnsstk::GLOFNavAlm::NumberCruncher::cos4lambdaBar
double cos4lambdaBar
cos(4*lambdaBar)
Definition: GLOFNavAlm.hpp:251
gnsstk::GLOFNavAlm::NumberCruncher::n
double n
2pi/Tdeltap.
Definition: GLOFNavAlm.hpp:242
gnsstk::GLOFNavAlm::NumberCruncher::getomegai
static double getomegai(double hi, double li, double epsi)
Definition: GLOFNavAlm.cpp:410
gnsstk::GLOFNavAlm::lambdanA
double lambdanA
Longitude of ascending node (lambda_n^A).
Definition: GLOFNavAlm.hpp:280
gnsstk::GLOFNavAlm::NumberCruncher::sinlambdaBar
double sinlambdaBar
sin(lambdaBar)
Definition: GLOFNavAlm.hpp:246
gnsstk::GLOFNavAlm::Toa
CommonTime Toa
Reference time for almanac.
Definition: GLOFNavAlm.hpp:275
gnsstk::GLOFNavAlm::eccnA
double eccnA
Eccentricity (epsilon_n^A).
Definition: GLOFNavAlm.hpp:282
gnsstk::GLOFNavAlm::NumberCruncher::l
double l
Definition: GLOFNavAlm.hpp:263
gnsstk::GLOFNavAlm::NumberCruncher::h
double h
Definition: GLOFNavAlm.hpp:262
gnsstk::GLOFNavAlm::NumberCruncher::Deltas
Definition: GLOFNavAlm.hpp:207
gnsstk::GLOFNavAlm::NumberCruncher::setSemiMajorAxisIncl
void setSemiMajorAxisIncl(double deltaT, double deltai, double omega, double ecc)
Definition: GLOFNavAlm.cpp:288
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::GLOFNavAlm::NumberCruncher::sini
double sini
sin(i)
Definition: GLOFNavAlm.hpp:254
gnsstk::GLOFNavAlm::NumberCruncher::setDeltas
void setDeltas(double M, double omega, double a, double dt)
Definition: GLOFNavAlm.cpp:383
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::deltal
double deltal
Definition: GLOFNavAlm.hpp:227
gnsstk::GLOFNavAlm::getUserTime
CommonTime getUserTime() const override
Definition: GLOFNavAlm.cpp:95
gnsstk::GLOFNavAlm::omeganA
double omeganA
Argument of perigee (omega_n^A).
Definition: GLOFNavAlm.hpp:283
PZ90Ellipsoid.hpp
gnsstk::GLOFNavAlm
Definition: GLOFNavAlm.hpp:53
gnsstk::GLOFNavAlm::omega3
static constexpr GNSSTK_EXPORT double omega3
Definition: GLOFNavAlm.hpp:65
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::operator-
Deltas operator-(const Deltas &right) const
Definition: GLOFNavAlm.cpp:602
gnsstk::GLOFNavAlm::NumberCruncher::deltas
Deltas deltas
Final delta results, not m=1 or m=2.
Definition: GLOFNavAlm.hpp:266
gnsstk::GLOFNavAlm::deltaTdotnA
double deltaTdotnA
Time derivative of deltaT (Delta T'_n^A).
Definition: GLOFNavAlm.hpp:286
gnsstk::GLOFNavAlm::C20
static const GNSSTK_EXPORT double C20
Second zonal harmonic of spherical harmonic expansion.
Definition: GLOFNavAlm.hpp:71
gnsstk::GLOFNavAlm::NumberCruncher::integrateEin
static double integrateEin(double Mi, double epsi)
Definition: GLOFNavAlm.cpp:439
gnsstk::GLOFNavAlm::NumberCruncher::sin2lambdaBar
double sin2lambdaBar
sin(2*lambdaBar)
Definition: GLOFNavAlm.hpp:248
gnsstk::GLOFNavAlm::NumberCruncher::cos3lambdaBar
double cos3lambdaBar
cos(3*lambdaBar)
Definition: GLOFNavAlm.hpp:249
gnsstk::GLOFNavAlm::NumberCruncher::earthvs
double earthvs
(A_earth/A_SV)**2.
Definition: GLOFNavAlm.hpp:253
gnsstk::GLOFNavAlm::validate
bool validate() const override
Definition: GLOFNavAlm.cpp:78
gnsstk::ObsID
Definition: ObsID.hpp:82
gnsstk::GLOFNavAlm::NumberCruncher::getXvt
bool getXvt(const CommonTime &when, Xvt &xvt, const GLOFNavAlm &alm)
Definition: GLOFNavAlm.cpp:453
gnsstk::GLOFNavAlm::taunA
double taunA
Time offset to GLONASS time (tau_n^A).
Definition: GLOFNavAlm.hpp:279
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::GLOFNavAlm::NumberCruncher::setEccArgOfPerigee
void setEccArgOfPerigee(double ecc, double omega)
Definition: GLOFNavAlm.cpp:271
gnsstk::GLOFNavAlm::icp
static const GNSSTK_EXPORT double icp
icp</cp> as defined in GLONASS ICD appendix 3.2.1
Definition: GLOFNavAlm.hpp:67
gnsstk::GLOFNavAlm::healthBits
bool healthBits
Health flag (C_n, 1 = operable).
Definition: GLOFNavAlm.hpp:276
GLOFNavData.hpp
gnsstk::Xvt
Definition: Xvt.hpp:60
gnsstk::GLOFNavAlm::ell
static const GNSSTK_EXPORT PZ90Ellipsoid ell
Ellipsoid parameters used by GLONASS.
Definition: GLOFNavAlm.hpp:57
gnsstk::GLOFNavAlm::NumberCruncher::lambdaBar
double lambdaBar
Definition: GLOFNavAlm.hpp:238
gnsstk::GLOFNavAlm::setSemiMajorAxisIncl
void setSemiMajorAxisIncl()
Compute and set the semi-major axis (A) and inclination (i).
Definition: GLOFNavAlm.cpp:229
gnsstk::GLOFNavAlm::NumberCruncher::Jcosi2Term
double Jcosi2Term
JTerm * sini2.
Definition: GLOFNavAlm.hpp:261
gnsstk::GLOFNavAlm::fixFit
void fixFit()
Definition: GLOFNavAlm.cpp:103
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::deltaa
double deltaa
Definition: GLOFNavAlm.hpp:225
gnsstk::GLOFNavAlm::dump
void dump(std::ostream &s, DumpDetail dl) const override
Definition: GLOFNavAlm.cpp:119
gnsstk::GLOFNavAlm::NumberCruncher::Tdeltap
double Tdeltap
deltaT + half day for some reason.
Definition: GLOFNavAlm.hpp:241
gnsstk::GLOFNavAlm::NumberCruncher::cosi2
double cosi2
cos(i)**2
Definition: GLOFNavAlm.hpp:257
gnsstk::DumpDetail
DumpDetail
Specify level of detail for dump output.
Definition: DumpDetail.hpp:51
gnsstk::GLOFNavAlm::dumpTerse
void dumpTerse(std::ostream &s) const
Definition: GLOFNavAlm.cpp:206
gnsstk::PZ90Ellipsoid
Definition: PZ90Ellipsoid.hpp:54
gnsstk::GLOFNavAlm::NumberCruncher::a
double a
Semi-major axis (m)
Definition: GLOFNavAlm.hpp:243
gnsstk::GLOFNavAlm::J
static const GNSSTK_EXPORT double J
Some constant or other related to C20.
Definition: GLOFNavAlm.hpp:73
gnsstk::GLOFNavAlm::NumberCruncher::coslambdaBar
double coslambdaBar
cos(lambdaBar)
Definition: GLOFNavAlm.hpp:245
gnsstk::GLOFNavAlm::freqnA
int freqnA
Frequency offset (H_n^A).
Definition: GLOFNavAlm.hpp:287
gnsstk::GLOFNavData
Definition: GLOFNavData.hpp:55
gnsstk::GLOFNavAlm::NumberCruncher::Jsini2Term
double Jsini2Term
JTerm * sini2.
Definition: GLOFNavAlm.hpp:260
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::setDeltas
void setDeltas(const NumberCruncher &nc, double a, double tau, double n)
Definition: GLOFNavAlm.cpp:620
gnsstk::GLOFNavAlm::mu
static const GNSSTK_EXPORT double mu
Gravitational constant.
Definition: GLOFNavAlm.hpp:59
gnsstk::GLOFNavAlm::C20Term
static const GNSSTK_EXPORT double C20Term
Term used in computing orbit.
Definition: GLOFNavAlm.hpp:75
gnsstk::GLOFNavAlm::GLOFNavAlm
GLOFNavAlm()
Sets the nav message type, and all other data members to 0.
Definition: GLOFNavAlm.cpp:60
gnsstk::GLOFNavAlm::NumberCruncher
Class to assist in doing all the math to get the XVT.
Definition: GLOFNavAlm.hpp:136
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::deltaOMEGA
double deltaOMEGA
Definition: GLOFNavAlm.hpp:228
gnsstk::GLOFNavAlm::NumberCruncher::sini2
double sini2
sin(i)**2
Definition: GLOFNavAlm.hpp:255
gnsstk::GLOFNavAlm::tLambdanA
double tLambdanA
Time of ascending node crossing (t_lambda_n^A).
Definition: GLOFNavAlm.hpp:284
gnsstk::GLOFNavAlm::deltainA
double deltainA
Correction to mean inclination (Delta i_n^A).
Definition: GLOFNavAlm.hpp:281
gnsstk::GLOFNavAlm::NumberCruncher::cosi
double cosi
cos(i)
Definition: GLOFNavAlm.hpp:256
gnsstk::GLOFNavAlm::NumberCruncher::cos2lambdaBar
double cos2lambdaBar
cos(2*lambdaBar)
Definition: GLOFNavAlm.hpp:247
gnsstk::GLOFNavAlm::NumberCruncher::i
double i
Inclination (rad)
Definition: GLOFNavAlm.hpp:244
gnsstk::GLOFNavAlm::getXvt
bool getXvt(const CommonTime &when, Xvt &xvt, const ObsID &=ObsID()) override
Definition: GLOFNavAlm.cpp:86
gnsstk::GLOFNavAlm::ae
static const GNSSTK_EXPORT double ae
Equatorial radius of Earth in km.
Definition: GLOFNavAlm.hpp:61
gnsstk::GLOFNavAlm::NumberCruncher::sin4lambdaBar
double sin4lambdaBar
sin(4*lambdaBar)
Definition: GLOFNavAlm.hpp:252
gnsstk::GLOFNavAlm::NumberCruncher::JsinTerm
double JsinTerm
JTerm * (1-TH*sini2)
Definition: GLOFNavAlm.hpp:259
gnsstk::GLOFNavAlm::NumberCruncher::Deltas::Deltas
Deltas()
Initialize everything to NaN.
Definition: GLOFNavAlm.cpp:590


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