0.2.0
Loading...
Searching...
No Matches
IonosphericCorrections.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
13
14#pragma once
15
16#include <vector>
17#include <optional>
18#include <functional>
19
21
22namespace NAV
23{
24
26class GnssNavInfo;
27
30{
31 public:
34 {
37 };
38
41 {
44 std::array<double, 4> data{};
45 };
46
49
52 explicit IonosphericCorrections(const std::vector<const GnssNavInfo*>& gnssNavInfos);
53
56 IonosphericCorrections(std::vector<Corrections> corrections); // NOLINT(hicpp-explicit-conversions, google-explicit-constructor)
57
62 [[nodiscard]] const std::array<double, 4>* get(SatelliteSystem satSys, AlphaBeta alphaBeta) const
63 {
64 auto iter = std::find_if(m_ionosphericCorrections.begin(), m_ionosphericCorrections.end(), [satSys, alphaBeta](const Corrections& c) {
65 return c.satSys == satSys && c.alphaBeta == alphaBeta;
66 });
67 if (iter != m_ionosphericCorrections.end())
68 {
69 return &iter->data;
70 }
71 return nullptr;
72 }
73
77 [[nodiscard]] bool contains(SatelliteSystem satSys, AlphaBeta alphaBeta) const
78 {
79 auto iter = std::find_if(m_ionosphericCorrections.begin(), m_ionosphericCorrections.end(), [satSys, alphaBeta](const Corrections& c) {
80 return c.satSys == satSys && c.alphaBeta == alphaBeta;
81 });
82 return iter != m_ionosphericCorrections.end();
83 }
84
86 [[nodiscard]] const std::vector<Corrections>& data() const
87 {
88 return m_ionosphericCorrections;
89 }
90
95 void insert(SatelliteSystem satSys, AlphaBeta alphaBeta, const std::array<double, 4>& values)
96 {
97 auto iter = std::find_if(m_ionosphericCorrections.begin(), m_ionosphericCorrections.end(), [satSys, alphaBeta](const Corrections& c) {
98 return c.satSys == satSys && c.alphaBeta == alphaBeta;
99 });
100 if (iter == m_ionosphericCorrections.end())
101 {
102 m_ionosphericCorrections.push_back({ satSys, alphaBeta, values });
103 }
104 else
105 {
106 iter->data = values;
107 }
108 }
109
111 void clear()
112 {
113 m_ionosphericCorrections.clear();
114 }
115
116 private:
118 std::vector<Corrections> m_ionosphericCorrections;
119};
120
121} // namespace NAV
GNSS Satellite System.
@ SatSys_None
No Satellite system.
Definition SatelliteSystem.hpp:31
Ionospheric Corrections.
Definition IonosphericCorrections.hpp:30
IonosphericCorrections(const std::vector< const GnssNavInfo * > &gnssNavInfos)
Constructor which collects the ionospheric parameters from the Navigation infos.
bool contains(SatelliteSystem satSys, AlphaBeta alphaBeta) const
Checks whether the data is in the internal storage.
Definition IonosphericCorrections.hpp:77
AlphaBeta
Alpha or beta values.
Definition IonosphericCorrections.hpp:34
@ Beta
Coefficients of a cubic equation representing the period of the model.
Definition IonosphericCorrections.hpp:36
@ Alpha
Coefficients of a cubic equation representing the amplitude of the vertical delay.
Definition IonosphericCorrections.hpp:35
const std::vector< Corrections > & data() const
Returns the internal data storage.
Definition IonosphericCorrections.hpp:86
const std::array< double, 4 > * get(SatelliteSystem satSys, AlphaBeta alphaBeta) const
Get the Ionospheric Correction values.
Definition IonosphericCorrections.hpp:62
IonosphericCorrections()=default
Default constructor.
void clear()
Empties the data.
Definition IonosphericCorrections.hpp:111
void insert(SatelliteSystem satSys, AlphaBeta alphaBeta, const std::array< double, 4 > &values)
Inserts new data into the m_ionosphericCorrections variable.
Definition IonosphericCorrections.hpp:95
IonosphericCorrections(std::vector< Corrections > corrections)
Constructor from raw corrections.
Ionospheric Corrections Data Storage.
Definition IonosphericCorrections.hpp:41
std::array< double, 4 > data
Data storage (3 values for GAL, otherwise 4) [s, s/semi-circle, s/semi-circle^2, s/semi-circle^3].
Definition IonosphericCorrections.hpp:44
AlphaBeta alphaBeta
Alpha or beta value.
Definition IonosphericCorrections.hpp:43
SatelliteSystem satSys
Satellite System (e.g. GPS, GAL, GLO, ...)
Definition IonosphericCorrections.hpp:42
Satellite System type.
Definition SatelliteSystem.hpp:43