source: ntrip/trunk/BNC/src/bncantex.h@ 10990

Last change on this file since 10990 was 10955, checked in by stuerze, 3 months ago

Possibility to select how satellite attitude is modelled when converting Antenna Phase Center (APC) corrections to
Center-of-Mass (CoM) positions required for SP3 output

File size: 6.4 KB
RevLine 
[2880]1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters.
3//
4// Copyright (C) 2007
5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
7// Czech Technical University Prague, Department of Geodesy
8// http://www.fsv.cvut.cz
9//
10// Email: euref-ip@bkg.bund.de
11//
12// This program is free software; you can redistribute it and/or
13// modify it under the terms of the GNU General Public License
14// as published by the Free Software Foundation, version 2.
15//
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25#ifndef BNCANTEX_H
26#define BNCANTEX_H
27
28#include <QtCore>
[9587]29#include <QString>
[5750]30#include <string>
[2880]31#include <newmat.h>
[2882]32#include "bncconst.h"
[2880]33#include "bnctime.h"
34
35class bncAntex {
36 public:
[5742]37 bncAntex(const char* fileName);
[2880]38 bncAntex();
39 ~bncAntex();
[7521]40 t_irc readFile(const QString& fileName);
41 void print() const;
42 QString pcoSinexString(const std::string& antName, t_frequency::type frqType);
[10130]43 QString snxCodeSinexString(const std::string& antName);
[9481]44 double satCorr(const QString& prn, t_frequency::type frqType,
45 double eleSat, double azSat, bool& found) const;
[7521]46 double rcvCorr(const std::string& antName, t_frequency::type frqType,
47 double eleSat, double azSat, bool& found) const;
[10955]48
49 // Attitude model selection for satCoMcorrection().
50 enum e_attMode {
51 ATT_COMPUTED = 0, // full model: GLONASS yaw-fixed + GPS noon/midnight turn
52 ATT_NOMINAL = 1, // simple nominal Sun-pointing only (no maneuver model)
53 ATT_EXTERNAL = 2, // use caller-supplied externalYaw angle [rad]
54 };
55
[7521]56 t_irc satCoMcorrection(const QString& prn, double Mjd,
[10946]57 const ColumnVector& xSat, const ColumnVector& vSat,
[10955]58 ColumnVector& dx,
59 e_attMode mode = ATT_COMPUTED,
60 double externalYaw = 0.0);
[2880]61
[10955]62 // Drain and return diagnostic logs accumulated by the yaw models.
[10948]63 // Empty most of the time; only non-empty right after a transition.
64 QString takeGlonassYawLog() {
65 QString s = _glonassYawLog;
66 _glonassYawLog.clear();
67 return s;
68 }
[10955]69 QString takeGpsYawLog() {
70 QString s = _gpsYawLog;
71 _gpsYawLog.clear();
72 return s;
73 }
74 QString takeOnYawLog() {
75 QString s = _onYawLog;
76 _onYawLog.clear();
77 return s;
78 }
[10948]79
[2880]80 private:
[10955]81 // Per-satellite GLONASS yaw state: freezes the yaw angle while the
82 // satellite cannot follow the nominal Sun-pointing law (Dilssner 2011).
[10946]83 class t_glonassYaw {
84 public:
85 t_glonassYaw() {
[10951]86 yaw = 0.0;
87 lastCallMjd = 0.0;
88 valid = false;
89 fixed = false;
[10946]90 }
91 double yaw;
[10951]92 double lastCallMjd; // Mjd of the most recent call (any branch) for this PRN
[10946]93 bool valid;
[10948]94 bool fixed; // true while the yaw-fixed override is currently active
[10946]95 };
96
[10955]97 // Per-satellite GPS yaw state: rate-limits the yaw during noon/midnight
98 // turns when the required yaw rate exceeds the block's mechanical maximum
99 // (Kouba 2009/2015, Bar-Sever 1996).
100 class t_gpsYaw {
101 public:
102 t_gpsYaw() {
103 yaw = 0.0;
104 lastCallMjd = 0.0;
105 valid = false;
106 inTurn = false;
107 }
108 double yaw;
109 double lastCallMjd;
110 bool valid;
111 bool inTurn; // true while in a constrained noon/midnight turn
112 };
113
114 // Per-satellite Galileo/BDS yaw state: tracks rate-limited rotation between
115 // yaw-steering (psiNom) and orbit-normal mode (psi=0) when |beta| crosses
116 // the constellation-specific threshold (Kouba 2017, Dai et al. 2015).
117 class t_onYaw {
118 public:
119 t_onYaw() {
120 yaw = 0.0;
121 lastCallMjd = 0.0;
122 valid = false;
123 inON = false;
124 }
125 double yaw;
126 double lastCallMjd;
127 bool valid;
128 bool inON; // true while satellite is in (or transitioning to) orbit-normal mode
129 };
130
[10948]131 QString _glonassYawLog;
[10955]132 QString _gpsYawLog;
133 QString _onYawLog;
[10948]134
[10947]135 double glonassYawAngle(const QString& prn, double Mjd, const ColumnVector& xSat,
[10946]136 const ColumnVector& vSat, const ColumnVector& xSun);
137
[10955]138 double gpsYawAngle(const QString& prn, const QString& blockType, double Mjd,
139 const ColumnVector& xSat, const ColumnVector& vSat,
140 const ColumnVector& xSun);
141
142 double onModeYawAngle(const QString& prn, double betaThr, double psiDotMax,
143 double Mjd, const ColumnVector& xSat,
144 const ColumnVector& vSat, const ColumnVector& xSun);
145
146 double galileoYawAngle(const QString& prn, const QString& blockType, double Mjd,
147 const ColumnVector& xSat, const ColumnVector& vSat,
148 const ColumnVector& xSun);
149
150 double bdsYawAngle(const QString& prn, const QString& blockType, double Mjd,
151 const ColumnVector& xSat, const ColumnVector& vSat,
152 const ColumnVector& xSun);
153
[10946]154 QMap<QString, t_glonassYaw> _glonassYaw;
[10955]155 QMap<QString, t_gpsYaw> _gpsYaw;
156 QMap<QString, t_onYaw> _onYaw;
[10946]157
[2880]158 class t_frqMap {
159 public:
[7625]160 t_frqMap() {
161 for (unsigned ii = 0; ii < 3; ii++) {
162 neu[ii] = 0.0;
163 }
164 }
[2884]165 double neu[3];
[2880]166 ColumnVector pattern;
167 };
168
169 class t_antMap {
170 public:
[7625]171 t_antMap() {
[10130]172 zen1 = 0.0;
173 zen2 = 0.0;
174 dZen = 0.0;
175 snxCode = "";
[7625]176 }
[2882]177 ~t_antMap() {
[6405]178 QMapIterator<t_frequency::type, t_frqMap*> it(frqMap);
179 while (it.hasNext()) {
180 it.next();
181 delete it.value();
182 }
[2882]183 }
[6405]184 QString antName;
[10955]185 QString blockType; // e.g. "IIF", "IIR-M", "IIA", "IIIA" (GPS only)
[6405]186 double zen1;
187 double zen2;
188 double dZen;
[10130]189 QString snxCode;
[6405]190 QMap<t_frequency::type, t_frqMap*> frqMap;
191 bncTime validFrom;
192 bncTime validTo;
[2880]193 };
194
[2882]195 QMap<QString, t_antMap*> _maps;
[2880]196};
197
198#endif
Note: See TracBrowser for help on using the repository browser.