0.4.1
Loading...
Searching...
No Matches
Ionosphere.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
9/// @file Ionosphere.hpp
10/// @brief Ionosphere Models
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2022-05-26
13
14#pragma once
15
16#include <cstdint>
17#include <vector>
18#include <fmt/format.h>
19#include <Eigen/Core>
22
23namespace NAV
24{
25
26/// Available Ionosphere Models
27enum class IonosphereModel : uint8_t
28{
29 None, ///< Ionosphere model turned off
30 Klobuchar, ///< Klobuchar model (GPS), also called Broadcast sometimes
31 COUNT, ///< Amount of items in the enum
32};
33
34/// @brief Converts the enum to a string
35/// @param[in] ionosphereModel Enum value to convert into text
36/// @return String representation of the enum
37const char* to_string(IonosphereModel ionosphereModel);
38
39/// @brief Shows a ComboBox to select the ionosphere model
40/// @param[in] label Label to show beside the combo box. This has to be a unique id for ImGui.
41/// @param[in] ionosphereModel Reference to the ionosphere model to select
42bool ComboIonosphereModel(const char* label, IonosphereModel& ionosphereModel);
43
44/// @brief Calculates the ionospheric delay
45/// @param[in] tow GPS time of week in [s]
46/// @param[in] freq Frequency of the signal
47/// @param[in] freqNum Frequency number. Only used for GLONASS G1 and G2
48/// @param[in] lla_pos [𝜙, λ, h]^T Geodetic latitude, longitude and height in [rad, rad, m]
49/// @param[in] elevation Angle between the user and satellite [rad]
50/// @param[in] azimuth Angle between the user and satellite, measured clockwise positive from the true North [rad]
51/// @param[in] ionosphereModel Ionosphere model to use
52/// @param[in] corrections Ionospheric correction parameters
53/// @return Ionospheric time delay in [m]
54double calcIonosphericDelay(double tow, Frequency freq, int8_t freqNum,
55 const Eigen::Vector3d& lla_pos,
56 double elevation, double azimuth,
57 IonosphereModel ionosphereModel = IonosphereModel::None,
58 const IonosphericCorrections* corrections = nullptr);
59
60/// @brief Calculates the ionospheric error variance
61/// @param[in] dpsr_I Ionosphere propagation error [m]
62/// @param[in] freq Frequency
63/// @param[in] num Frequency number. Only used for GLONASS G1 and G2
64/// @return Variance of the error [m^2]
65double ionoErrorVar(double dpsr_I, Frequency freq, int8_t num);
66
67} // namespace NAV
68
69#ifndef DOXYGEN_IGNORE
70
71/// @brief Formatter
72template<>
73struct fmt::formatter<NAV::IonosphereModel> : fmt::formatter<std::string>
74{
75 /// @brief Defines how to format structs
76 /// @param[in] data Struct to format
77 /// @param[in, out] ctx Format context
78 /// @return Output iterator
79 template<typename FormatContext>
80 auto format(const NAV::IonosphereModel& data, FormatContext& ctx) const
81 {
82 return fmt::formatter<std::string>::format(NAV::to_string(data), ctx);
83 }
84};
85
86#endif
Frequency definition for different satellite systems.
Ionospheric Correction data.
IonosphereModel
Available Ionosphere Models.
@ COUNT
Amount of items in the enum.
@ None
Ionosphere model turned off.
@ Klobuchar
Klobuchar model (GPS), also called Broadcast sometimes.
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.
double ionoErrorVar(double dpsr_I, Frequency freq, int8_t num)
Calculates the ionospheric error variance.
bool ComboIonosphereModel(const char *label, IonosphereModel &ionosphereModel)
Shows a ComboBox to select the ionosphere model.
double calcIonosphericDelay(double tow, Frequency freq, int8_t freqNum, const Eigen::Vector3d &lla_pos, double elevation, double azimuth, IonosphereModel ionosphereModel, const IonosphericCorrections *corrections)
Calculates the ionospheric delay.