MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_sbas.h
Go to the documentation of this file.
1/*------------------------------------------------------------------------------
2 * mrtk_sbas.h : SBAS message decoding and correction 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_sbas.h
18 * @brief MRTKLIB SBAS Module — SBAS message decoding and corrections.
19 *
20 * This header declares all public SBAS functions extracted from sbas.c.
21 *
22 * @note All functions in this module are pure cut-and-paste extractions
23 * from sbas.c with zero algorithmic changes.
24 */
25#ifndef MRTK_SBAS_H
26#define MRTK_SBAS_H
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#include <stdint.h>
33#include <stdio.h>
34
35#include "mrtklib/mrtk_nav.h"
36#include "mrtklib/mrtk_time.h"
37
38/*============================================================================
39 * SBAS Global Variables
40 *===========================================================================*/
41
42extern const sbsigpband_t igpband1[9][8]; /* SBAS IGP band 0-8 */
43extern const sbsigpband_t igpband2[2][5]; /* SBAS IGP band 9-10 */
44
45/*============================================================================
46 * SBAS Functions
47 *===========================================================================*/
48
49/**
50 * @brief Read SBAS message file.
51 * @param[in] file SBAS message file path
52 * @param[in] sel SBAS satellite selection (0:all)
53 * @param[in,out] sbs SBAS messages
54 * @return Status (1:ok, 0:error)
55 */
56int sbsreadmsg(const char* file, int sel, sbs_t* sbs);
57
58/**
59 * @brief Read SBAS message file with time span.
60 * @param[in] file SBAS message file path
61 * @param[in] sel SBAS satellite selection (0:all)
62 * @param[in] ts Time start (ts.time==0: no limit)
63 * @param[in] te Time end (te.time==0: no limit)
64 * @param[in,out] sbs SBAS messages
65 * @return Status (1:ok, 0:error)
66 */
67int sbsreadmsgt(const char* file, int sel, gtime_t ts, gtime_t te, sbs_t* sbs);
68
69/**
70 * @brief Output SBAS message record.
71 * @param[in] fp Output file pointer
72 * @param[in] sbsmsg SBAS message
73 */
74void sbsoutmsg(FILE* fp, sbsmsg_t* sbsmsg);
75
76/**
77 * @brief Decode SBAS message frame words.
78 * @param[in] time Reception time
79 * @param[in] prn SBAS satellite PRN number
80 * @param[in] words SBAS message frame words (9 words)
81 * @param[out] sbsmsg SBAS message
82 * @return Status (1:ok, 0:error)
83 */
84int sbsdecodemsg(gtime_t time, int prn, const uint32_t* words, sbsmsg_t* sbsmsg);
85
86/**
87 * @brief Update SBAS corrections in navigation data.
88 * @param[in] msg SBAS message
89 * @param[in,out] nav Navigation data
90 * @return Message type (0:error)
91 */
92int sbsupdatecorr(const sbsmsg_t* msg, nav_t* nav);
93
94/**
95 * @brief SBAS satellite ephemeris and clock correction.
96 * @param[in] time Reception time
97 * @param[in] sat Satellite number
98 * @param[in] nav Navigation data
99 * @param[in,out] rs Satellite position/velocity (corrected)
100 * @param[out] dts Satellite clock correction
101 * @param[out] var Variance of correction
102 * @return Status (1:ok, 0:error)
103 */
104int sbssatcorr(gtime_t time, int sat, const nav_t* nav, double* rs, double* dts, double* var);
105
106/**
107 * @brief SBAS ionospheric delay correction.
108 * @param[in] time Reception time
109 * @param[in] nav Navigation data
110 * @param[in] pos Receiver position {lat, lon, h} (rad, m)
111 * @param[in] azel Azimuth/elevation angle {az, el} (rad)
112 * @param[out] delay Ionospheric delay (L1) (m)
113 * @param[out] var Variance of ionospheric delay (m^2)
114 * @return Status (1:ok, 0:error)
115 */
116int sbsioncorr(gtime_t time, const nav_t* nav, const double* pos, const double* azel, double* delay, double* var);
117
118/**
119 * @brief SBAS tropospheric delay correction.
120 * @param[in] time Reception time
121 * @param[in] pos Receiver position {lat, lon, h} (rad, m)
122 * @param[in] azel Azimuth/elevation angle {az, el} (rad)
123 * @param[out] var Variance of tropospheric delay (m^2)
124 * @return Tropospheric delay (m)
125 */
126double sbstropcorr(gtime_t time, const double* pos, const double* azel, double* var);
127
128#ifdef __cplusplus
129}
130#endif
131
132#endif /* MRTK_SBAS_H */
struct nav_s nav_t
Definition mrtk_eph.h:40
MRTKLIB Navigation Module — Navigation data types and satellite/nav utility functions.
const sbsigpband_t igpband1[9][8]
Definition mrtk_sbas.c:86
const sbsigpband_t igpband2[2][5]
Definition mrtk_sbas.c:159
void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg)
Output SBAS message record.
Definition mrtk_sbas.c:732
int sbsreadmsg(const char *file, int sel, sbs_t *sbs)
Read SBAS message file.
Definition mrtk_sbas.c:719
int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos, const double *azel, double *delay, double *var)
SBAS ionospheric delay correction.
Definition mrtk_sbas.c:823
int sbsdecodemsg(gtime_t time, int prn, const uint32_t *words, sbsmsg_t *sbsmsg)
Decode SBAS message frame words.
Definition mrtk_sbas.c:1080
int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, sbs_t *sbs)
Read SBAS message file with time span.
Definition mrtk_sbas.c:682
double sbstropcorr(gtime_t time, const double *pos, const double *azel, double *var)
SBAS tropospheric delay correction.
Definition mrtk_sbas.c:930
int sbsupdatecorr(const sbsmsg_t *msg, nav_t *nav)
Update SBAS corrections in navigation data.
Definition mrtk_sbas.c:517
int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs, double *dts, double *var)
SBAS satellite ephemeris and clock correction.
Definition mrtk_sbas.c:1047
MRTKLIB Time Module — GNSS time types and conversion functions.
GNSS time representation.
Definition mrtk_time.h:49