INSTINCT Code Coverage Report


Directory: src/
File: Navigation/Atmosphere/Troposphere/MappingFunctions/ViennaMappingFunction.cpp
Date: 2025-02-07 16:54:41
Exec Total Coverage
Lines: 0 32 0.0%
Functions: 0 2 0.0%
Branches: 0 6 0.0%

Line Branch Exec Source
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 #include "ViennaMappingFunction.hpp"
10 #include <cmath>
11 #include <tuple>
12
13 namespace NAV
14 {
15 double vmf1h(const double& ah, const double& dmjd,
16 const double& dlat, const double& ht, const double& zd)
17 {
18 double doy = dmjd - 44239.0 + 1 - 28;
19
20 double bh = 0.0029;
21 double c0h = 0.062;
22
23 auto [phh, c11h, c10h] = dlat < 0.0
24 ? std::make_tuple(M_PI, 0.007, 0.002) // southern hemisphere
25 : std::make_tuple(0.0, 0.005, 0.001); // northern hemisphere
26
27 double ch = c0h + ((std::cos(doy / 365.25 * 2.0 * M_PI + phh) + 1.0) * c11h / 2.0 + c10h) * (1.0 - std::cos(dlat));
28
29 double sine = std::sin(M_PI / 2.0 - zd);
30 double beta = bh / (sine + ch);
31 double gamma = ah / (sine + beta);
32 double topcon = 1.0 + ah / (1.0 + bh / (1.0 + ch));
33 double vmf1h = topcon / (sine + gamma);
34
35 // height correction [Niell, 1996]
36 double a_ht = 2.53e-5;
37 double b_ht = 5.49e-3;
38 double c_ht = 1.14e-3;
39 double hs_km = ht / 1000.0;
40 beta = b_ht / (sine + c_ht);
41 gamma = a_ht / (sine + beta);
42 topcon = 1.0 + a_ht / (1.0 + b_ht / (1.0 + c_ht));
43 double ht_corr_coef = 1.0 / sine - topcon / (sine + gamma);
44 double ht_corr = ht_corr_coef * hs_km;
45 vmf1h += ht_corr;
46
47 return vmf1h;
48 }
49 double vmf1w(const double& aw, const double& zd)
50 {
51 double sine = std::sin(M_PI / 2.0 - zd);
52 double bw = 0.00146;
53 double cw = 0.04391;
54 double beta = bw / (sine + cw);
55 double gamma = aw / (sine + beta);
56 double topcon = 1.0 + aw / (1.0 + bw / (1.0 + cw));
57
58 return topcon / (sine + gamma);
59 }
60
61 } // namespace NAV
62