MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_atmos.h
Go to the documentation of this file.
1/*------------------------------------------------------------------------------
2 * mrtk_atmos.h : atmosphere model functions
3 *
4 * Copyright (C) 2026 H.SHIONO (MRTKLIB Project)
5 * Copyright (C) 2023-2025 Cabinet Office, Japan
6 * Copyright (C) 2024-2025 Lighthouse Technology & Consulting Co. Ltd.
7 * Copyright (C) 2023-2025 Japan Aerospace Exploration Agency
8 * Copyright (C) 2023-2025 TOSHIBA ELECTRONIC TECHNOLOGIES CORPORATION
9 * Copyright (C) 2015- Mitsubishi Electric Corp.
10 * Copyright (C) 2014 Geospatial Information Authority of Japan
11 * Copyright (C) 2014 T.SUZUKI
12 * Copyright (C) 2007-2023 T.TAKASU
13 *
14 * SPDX-License-Identifier: BSD-2-Clause
15 *----------------------------------------------------------------------------*/
16/**
17 * @file mrtk_atmos.h
18 * @brief MRTKLIB Atmosphere Module — Ionospheric and tropospheric models.
19 *
20 * This header provides broadcast ionosphere (Klobuchar) model, ionospheric
21 * mapping function, ionospheric pierce point computation, tropospheric
22 * (Saastamoinen) model, and tropospheric mapping function (NMF/GMF).
23 *
24 * @note All functions in this module are pure cut-and-paste extractions
25 * from rtkcmn.c with zero algorithmic changes.
26 */
27#ifndef MRTK_ATMOS_H
28#define MRTK_ATMOS_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "mrtklib/mrtk_coords.h"
36#include "mrtklib/mrtk_nav.h"
37#include "mrtklib/mrtk_opt.h"
38#include "mrtklib/mrtk_time.h"
39
40/*============================================================================
41 * Ionosphere Models
42 *===========================================================================*/
43
44/**
45 * @brief Compute ionospheric delay by broadcast ionosphere model (Klobuchar).
46 * @param[in] t Time (GPST)
47 * @param[in] ion Iono model parameters {a0,a1,a2,a3,b0,b1,b2,b3}
48 * @param[in] pos Receiver position {lat,lon,h} (rad,m)
49 * @param[in] azel Azimuth/elevation angle {az,el} (rad)
50 * @return Ionospheric delay (L1) (m)
51 */
52double ionmodel(gtime_t t, const double* ion, const double* pos, const double* azel);
53
54/**
55 * @brief Compute ionospheric delay mapping function by single layer model.
56 * @param[in] pos Receiver position {lat,lon,h} (rad,m)
57 * @param[in] azel Azimuth/elevation angle {az,el} (rad)
58 * @return Ionospheric mapping function
59 */
60double ionmapf(const double* pos, const double* azel);
61
62/**
63 * @brief Compute ionospheric pierce point (IPP) position and slant factor.
64 * @param[in] pos Receiver position {lat,lon,h} (rad,m)
65 * @param[in] azel Azimuth/elevation angle {az,el} (rad)
66 * @param[in] re Earth radius (km)
67 * @param[in] hion Altitude of ionosphere (km)
68 * @param[out] posp Pierce point position {lat,lon,h} (rad,m)
69 * @return Slant factor
70 * @note Only valid on the earth surface.
71 */
72double ionppp(const double* pos, const double* azel, double re, double hion, double* posp);
73
74/*============================================================================
75 * Troposphere Models
76 *===========================================================================*/
77
78/**
79 * @brief Compute tropospheric delay by standard atmosphere and Saastamoinen.
80 * @param[in] time Time
81 * @param[in] pos Receiver position {lat,lon,h} (rad,m)
82 * @param[in] azel Azimuth/elevation angle {az,el} (rad)
83 * @param[in] humi Relative humidity
84 * @return Tropospheric delay (m)
85 */
86double tropmodel(gtime_t time, const double* pos, const double* azel, double humi);
87
88/**
89 * @brief Compute tropospheric mapping function by NMF.
90 * @param[in] time Time
91 * @param[in] pos Receiver position {lat,lon,h} (rad,m)
92 * @param[in] azel Azimuth/elevation angle {az,el} (rad)
93 * @param[in,out] mapfw Wet mapping function (NULL: not output)
94 * @return Dry mapping function
95 * @note See ref [5] (NMF) and [9] (GMF).
96 */
97double tropmapf(gtime_t time, const double* pos, const double* azel, double* mapfw);
98
99/*============================================================================
100 * Ionosphere / Troposphere Correction (multi-model dispatch)
101 *===========================================================================*/
102
103/**
104 * @brief Compute ionospheric correction.
105 * @param[in] time Time
106 * @param[in] nav Navigation data
107 * @param[in] sat Satellite number
108 * @param[in] pos Receiver position {lat,lon,h} (rad|m)
109 * @param[in] azel Azimuth/elevation angle {az,el} (rad)
110 * @param[in] ionoopt Ionospheric correction option (IONOOPT_???)
111 * @param[out] ion Ionospheric delay (L1) (m)
112 * @param[out] var Ionospheric delay (L1) variance (m^2)
113 * @return Status (1:ok, 0:error)
114 */
115int ionocorr(gtime_t time, const nav_t* nav, int sat, const double* pos, const double* azel, int ionoopt, double* ion,
116 double* var);
117
118/**
119 * @brief Compute tropospheric correction.
120 * @param[in] time Time
121 * @param[in] nav Navigation data
122 * @param[in] pos Receiver position {lat,lon,h} (rad|m)
123 * @param[in] azel Azimuth/elevation angle {az,el} (rad)
124 * @param[in] tropopt Tropospheric correction option (TROPOPT_???)
125 * @param[out] trp Tropospheric delay (m)
126 * @param[out] var Tropospheric delay variance (m^2)
127 * @return Status (1:ok, 0:error)
128 */
129int tropcorr(gtime_t time, const nav_t* nav, const double* pos, const double* azel, int tropopt, double* trp,
130 double* var);
131
132#ifdef __cplusplus
133}
134#endif
135
136#endif /* MRTK_ATMOS_H */
double tropmodel(gtime_t time, const double *pos, const double *azel, double humi)
Compute tropospheric delay by standard atmosphere and Saastamoinen.
Definition mrtk_atmos.c:162
double tropmapf(gtime_t time, const double *pos, const double *azel, double *mapfw)
Compute tropospheric mapping function by NMF.
int ionocorr(gtime_t time, const nav_t *nav, int sat, const double *pos, const double *azel, int ionoopt, double *ion, double *var)
Compute ionospheric correction.
Definition mrtk_atmos.c:310
double ionmodel(gtime_t t, const double *ion, const double *pos, const double *azel)
Compute ionospheric delay by broadcast ionosphere model (Klobuchar).
Definition mrtk_atmos.c:63
double ionppp(const double *pos, const double *azel, double re, double hion, double *posp)
Compute ionospheric pierce point (IPP) position and slant factor.
Definition mrtk_atmos.c:131
double ionmapf(const double *pos, const double *azel)
Compute ionospheric delay mapping function by single layer model.
Definition mrtk_atmos.c:114
int tropcorr(gtime_t time, const nav_t *nav, const double *pos, const double *azel, int tropopt, double *trp, double *var)
Compute tropospheric correction.
Definition mrtk_atmos.c:350
MRTKLIB Coordinates Module — Coordinate transformations and geometry.
struct nav_s nav_t
Definition mrtk_eph.h:40
MRTKLIB Foundation — Common types, standard includes, and system constants (MAXSAT,...
MRTKLIB Navigation Module — Navigation data types and satellite/nav utility functions.
MRTKLIB Options Module — Processing and solution option types.
MRTKLIB Time Module — GNSS time types and conversion functions.
GNSS time representation.
Definition mrtk_time.h:49