0.2.0
Loading...
Searching...
No Matches
RINEXUtilities.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
14
15#pragma once
16
17#include <map>
18#include <unordered_set>
19
24#include "util/Eigen.hpp"
25#include "util//Json.hpp"
26
27namespace NAV
28{
29namespace vendor::RINEX
30{
31
33enum class ObsType
34{
35 Error,
36 C,
37 L,
38 D,
39 S,
40 I,
41 X,
42};
43
46{
55 ObsType type{ ObsType::Error };
56
59};
60
63{
64 double version = 3.04;
65 std::string runBy;
66 std::vector<std::string> comments;
67 std::string markerName;
68 std::string markerNumber;
69
91 std::string markerTypeUser;
92 std::string observer;
93 std::string agency;
94 std::string receiverNumber;
95 std::string receiverType;
96 std::string receiverVersion;
97 std::string antennaNumber;
98 std::string antennaType;
100 Eigen::Vector3d approxPositionXYZ = Eigen::Vector3d::Zero();
101 std::array<double, 3> antennaDeltaHeightEastNorth{};
102
103 // ------------------------------- Dynamic data to clear and not to save ---------------------------------
104
106 std::map<SatelliteSystem, std::vector<ObservationDescription>> systemObsTypes;
107 double interval = 1e9;
110 std::unordered_set<SatId> satellites;
112
114 void reset();
115
120 bool addObsType(const Code& code, ObsType type);
121
123 [[nodiscard]] std::string generateHeader() const;
125 [[nodiscard]] std::string headerLineRinexVersionType() const;
127 [[nodiscard]] std::string headerLinePgmRunByDate() const;
129 [[nodiscard]] std::string headerLineComments() const;
131 [[nodiscard]] std::string headerLineMarkerName() const;
133 [[nodiscard]] std::string headerLineMarkerNumber() const;
135 [[nodiscard]] std::string headerLineMarkerType() const;
137 [[nodiscard]] std::string headerLineObserverAgency() const;
139 [[nodiscard]] std::string headerLineRecNumTypeVers() const;
141 [[nodiscard]] std::string headerLineAntNumType() const;
143 [[nodiscard]] std::string headerLineApproxPositionXYZ() const;
145 [[nodiscard]] std::string headerLineAntennaDeltaHEN() const;
147 [[nodiscard]] std::string headerLineSysNumObsType() const;
149 [[nodiscard]] static std::string headerLineSignalStrengthUnit();
151 [[nodiscard]] std::string headerLineInterval() const;
153 [[nodiscard]] std::string headerLineTimeOfFirstObs() const;
155 [[nodiscard]] std::string headerLineTimeOfLastObs() const;
157 [[nodiscard]] static std::string headerLineSysPhaseShift();
159 [[nodiscard]] static std::string headerLineGlonassCodPhsBis();
161 [[nodiscard]] std::string headerLineLeapSeconds() const;
163 [[nodiscard]] std::string headerLineNumSatellites() const;
165 [[nodiscard]] static std::string headerLineEndOfHeader();
166
169 [[nodiscard]] std::string epochRecordLine(const InsTime& epochTime) const;
170};
171
175void to_json(json& j, const ObsHeader& obj);
179void from_json(const json& j, ObsHeader& obj);
180
184
188
191std::string timeSystemString(TimeSystem timeSys);
192
196
200[[nodiscard]] Frequency getFrequencyFromBand(SatelliteSystem satSys, int band);
201
202} // namespace vendor::RINEX
203
212
213} // namespace NAV
Code definitions.
Vector space operations.
nlohmann::json json
json namespace
Definition FlowManager.hpp:21
GNSS Observation messages.
Defines how to save certain datatypes to json.
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.
const char * tooltip(vendor::RINEX::ObsHeader::MarkerTypes markerType)
Converts the enum to a string tooltip.
std::string timeSystemString(TimeSystem timeSys)
Converts the satellite system(s) to 3 characters representation of the time system.
char obsTypeToChar(ObsType type)
Converts an ObsType to char.
ObsType
Observation types of the 'SYS / # / OBS TYPES' header.
Definition RINEXUtilities.hpp:34
@ X
Receiver channel numbers.
@ C
Code / Pseudorange.
@ S
Raw signal strength(carrier to noise ratio)
@ I
Ionosphere phase delay.
TimeSystem timeSystem(SatelliteSystem satSys)
Converts the satellite system(s) to the time system.
Frequency getFrequencyFromBand(SatelliteSystem satSys, int band)
Get the Frequency from the provided satellite system and band in the 'SYS / # / OBS TYPES' header.
ObsType obsTypeFromChar(char c)
Converts a character to an ObsType.
Structs identifying a unique satellite.
@ SatSys_None
No Satellite system.
Definition SatelliteSystem.hpp:31
Time System defintions.
@ TimeSys_None
No Time system.
Definition TimeSystem.hpp:27
Enumerate for GNSS Codes.
Definition Code.hpp:88
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
The class is responsible for all time-related tasks.
Definition InsTime.hpp:667
Time System defintions.
Definition TimeSystem.hpp:39
Satellite System type.
Definition SatelliteSystem.hpp:43
Rinex Observation File Header information.
Definition RINEXUtilities.hpp:63
std::string headerLineApproxPositionXYZ() const
Generates the Header line 'APPROX POSITION XYZ'.
Eigen::Vector3d approxPositionXYZ
Geocentric approximate marker position (Units: Meters, System: ITRS recommended) Optional for moving ...
Definition RINEXUtilities.hpp:100
MarkerTypes markerType
Type of the marker.
Definition RINEXUtilities.hpp:90
std::map< SatelliteSystem, std::vector< ObservationDescription > > systemObsTypes
Observation types for each satellite system.
Definition RINEXUtilities.hpp:106
InsTime timeFirstObs
Time of first observation record.
Definition RINEXUtilities.hpp:108
std::string headerLineComments() const
Generates the Header line 'COMMENT'.
static std::string headerLineEndOfHeader()
Generates the Header line 'END OF HEADER'.
std::string headerLineRinexVersionType() const
Generates the Header line 'RINEX VERSION / TYPE'.
std::string headerLineTimeOfFirstObs() const
Generates the Header line 'TIME OF FIRST OBS'.
std::string markerTypeUser
User-defined Marker Type [A20].
Definition RINEXUtilities.hpp:91
std::string headerLineMarkerNumber() const
Generates the Header line 'MARKER NUMBER'.
double version
Format version.
Definition RINEXUtilities.hpp:64
std::string headerLineNumSatellites() const
Generates the Header line '# OF SATELLITES'.
std::string observer
Name of observer [A20].
Definition RINEXUtilities.hpp:92
std::string runBy
Name of agency creating current file [A20].
Definition RINEXUtilities.hpp:65
SatelliteSystem satSys
Satellite System.
Definition RINEXUtilities.hpp:105
std::vector< std::string > comments
Comment line(s) [A60] (Optional)
Definition RINEXUtilities.hpp:66
std::string headerLineMarkerType() const
Generates the Header line 'MARKER TYPE'.
std::string markerNumber
Number of antenna marker [A20] (Optional)
Definition RINEXUtilities.hpp:68
std::string headerLineLeapSeconds() const
Generates the Header line 'LEAP SECONDS'.
std::string epochRecordLine(const InsTime &epochTime) const
Generates the epoch line.
std::string agency
Name of agency [A40].
Definition RINEXUtilities.hpp:93
std::string headerLineTimeOfLastObs() const
Generates the Header line 'TIME OF LAST OBS'.
std::string markerName
Name of antenna marker [A60].
Definition RINEXUtilities.hpp:67
std::string antennaNumber
Antenna number [A20].
Definition RINEXUtilities.hpp:97
static std::string headerLineGlonassCodPhsBis()
Generates the Header line 'GLONASS COD/PHS/BIS'.
std::string headerLineAntNumType() const
Generates the Header line 'ANT # / TYPE'.
MarkerTypes
Available marker types.
Definition RINEXUtilities.hpp:72
@ FIXED_BUOY
"Fixed" on water surface
@ GROUND_CRAFT
Mobile terrestrial vehicle.
@ FLOATING_BUOY
Floating on water surface.
@ NON_PHYSICAL
Generated from network processing.
@ COUNT
Amount of items in the enum.
@ USER_DEFINED
Users may define other project-dependent keywords.
@ GEODETIC
Earth-fixed, high-precision monument.
@ ANIMAL
Animal carrying a receiver.
@ NON_GEODETIC
Earth-fixed, low-precision monument.
@ FLOATING_ICE
Floating ice sheet, etc.
std::string receiverVersion
Receiver version (e.g. Internal Software Version) [A20].
Definition RINEXUtilities.hpp:96
bool approxPositionEnabled
Whether the approx position should be written.
Definition RINEXUtilities.hpp:99
std::string headerLineInterval() const
Generates the Header line 'INTERVAL'.
std::string headerLineSysNumObsType() const
Generates the Header line 'SYS / # / OBS TYPES'.
void reset()
Reset all dynamic data.
std::string headerLineRecNumTypeVers() const
Generates the Header line 'REC # / TYPE / VERS'.
std::array< double, 3 > antennaDeltaHeightEastNorth
Antenna height and horizontal eccentricity of ARP relative to the marker (east/north) in (meters) [F1...
Definition RINEXUtilities.hpp:101
std::unordered_set< SatId > satellites
Satellites observed.
Definition RINEXUtilities.hpp:110
std::string headerLineAntennaDeltaHEN() const
Generates the Header line 'ANTENNA: DELTA H/E/N'.
TimeSystem timeSys
Time system used.
Definition RINEXUtilities.hpp:111
std::string headerLineObserverAgency() const
Generates the Header line 'OBSERVER / AGENCY'.
static std::string headerLineSysPhaseShift()
Generates the Header line 'SYS / PHASE SHIFT'.
static std::string headerLineSignalStrengthUnit()
Generates the Header line 'SIGNAL STRENGTH UNIT'.
double interval
Observation interval in seconds.
Definition RINEXUtilities.hpp:107
std::string generateHeader() const
Generates the RINEX observation header.
std::string headerLinePgmRunByDate() const
Generates the Header line 'PGM / RUN BY / DATE'.
std::string receiverNumber
Receiver number [A20].
Definition RINEXUtilities.hpp:94
std::string receiverType
Receiver type [A20].
Definition RINEXUtilities.hpp:95
InsTime timeLastObs
Time of last observation record.
Definition RINEXUtilities.hpp:109
std::string antennaType
Antenna type [A20].
Definition RINEXUtilities.hpp:98
bool addObsType(const Code &code, ObsType type)
Adds the obs type if not existing already.
std::string headerLineMarkerName() const
Generates the Header line 'MARKER NAME'.
Description of the observations from the 'SYS / # / OBS TYPES' header.
Definition RINEXUtilities.hpp:46
ObsType type
Definition RINEXUtilities.hpp:55
Code code
GNSS Code.
Definition RINEXUtilities.hpp:58