48static const double PI = 3.1415926535897932;
49static const double D2R = 3.1415926535897932 / 180.0;
50static const double R2D = 180.0 / 3.1415926535897932;
51static const double CLIGHT = 299792458.0;
54#define P2_11 4.882812500000000E-04
55#define P2_31 4.656612873077393E-10
56#define P2_39 1.818989403545856E-12
57#define MAXSBSAGEF 30.0
58#define MAXSBSAGEL 1800.0
64#define WEEKOFFSET 1024
67static const int16_t
x1[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0,
68 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75, 85},
69 x2[] = {-55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0,
70 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55},
71 x3[] = {-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0,
72 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75},
73 x4[] = {-85, -75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5,
74 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75},
75 x5[] = {-180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130, -125, -120, -115, -110,
76 -105, -100, -95, -90, -85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35,
77 -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40,
78 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115,
79 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175},
80 x6[] = {-180, -170, -160, -150, -140, -130, -120, -110, -100, -90, -80, -70,
81 -60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50,
82 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170},
83 x7[] = {-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150},
84 x8[] = {-170, -140, -110, -80, -50, -20, 10, 40, 70, 100, 130, 160};
94 {-145,
x2, 179, 201}},
100 {-115,
x2, 129, 151},
101 {-110,
x3, 152, 178},
102 {-105,
x2, 179, 201}},
110 {-65,
x2, 179, 201}},
118 {-25,
x2, 179, 201}},
150 {135,
x2, 179, 201}},
158 {175,
x2, 178, 200}}};
161 {{60,
x5, 1, 72}, {65,
x6, 73, 108}, {70,
x6, 109, 144}, {75,
x6, 145, 180}, {85,
x7, 181, 192}},
162 {{-60,
x5, 1, 72}, {-65,
x6, 73, 108}, {-70,
x6, 109, 144}, {-75,
x6, 145, 180}, {-85,
x8, 181, 192}}};
165 for (pos--; pos > 0; pos--, p++) {
166 if (!(p = strchr(p,
','))) {
174 const double var[14] = {0.052, 0.0924, 0.1444, 0.283, 0.4678, 0.8315, 1.2992,
175 1.8709, 2.5465, 3.326, 5.1968, 20.7870, 230.9661, 2078.695};
176 return 0 < udre && udre <= 14 ? var[udre - 1] : 0.0;
180 const double var[15] = {0.0084, 0.0333, 0.0749, 0.1331, 0.2079, 0.2994, 0.4075, 0.5322,
181 0.6735, 0.8315, 1.1974, 1.8709, 3.326, 20.787, 187.0826};
182 return 0 < give && give <= 15 ? var[give - 1] : 0.0;
186 const double degf[16] = {0.00000, 0.00005, 0.00009, 0.00012, 0.00015, 0.00020, 0.00030, 0.00045,
187 0.00060, 0.00090, 0.00150, 0.00210, 0.00270, 0.00330, 0.00460, 0.00580};
188 return 0 < ai && ai <= 15 ? degf[ai] : 0.0058;
194 trace(NULL, 4,
"decode_sbstype1:\n");
196 for (i = 1, n = 0; i <= 210 && n <
MAXSAT; i++) {
200 }
else if (i <= 61) {
202 }
else if (i <= 119) {
204 }
else if (i <= 138) {
206 }
else if (i <= 182) {
208 }
else if (i <= 192) {
210 }
else if (i <= 202) {
215 sbssat->
sat[n++].
sat = sat;
221 trace(NULL, 5,
"decode_sbstype1: nprn=%d iodp=%d\n", n, sbssat->
iodp);
226 int i, j, iodf, type, udre;
230 trace(NULL, 4,
"decode_sbstype2:\n");
239 for (i = 0; i < 13; i++) {
240 if ((j = 13 * ((type == 0 ? 2 : type) - 2) + i) >= sbssat->
nsat) {
250 if (t0.
time == 0 || dt <= 0.0 || 18.0 < dt || sbssat->
sat[j].
fcorr.
ai == 0) {
259 trace(NULL, 5,
"decode_sbstype2: type=%d iodf=%d\n", type, iodf);
264 int i, iodf[4], udre;
266 trace(NULL, 4,
"decode_sbstype6:\n");
268 for (i = 0; i < 4; i++) {
271 for (i = 0; i < sbssat->
nsat && i <
MAXSAT; i++) {
278 trace(NULL, 5,
"decode_sbstype6: iodf=%d %d %d %d\n", iodf[0], iodf[1], iodf[2], iodf[3]);
285 trace(NULL, 4,
"decode_sbstype7\n");
293 for (i = 0; i < sbssat->
nsat && i <
MAXSAT; i++) {
303 trace(NULL, 4,
"decode_sbstype9:\n");
306 trace(NULL, 2,
"invalid prn in sbas type 9: prn=%3d\n", msg->
prn);
309 t = (int)
getbitu(msg->
msg, 22, 13) * 16 - (int)msg->
tow % 86400;
312 }
else if (t > 43200) {
319 seph.
svh = seph.
sva == 15 ? 1 : 0;
341 trace(NULL, 5,
"decode_sbstype9: prn=%d\n", msg->
prn);
347 int i, j, n, m, band =
getbitu(msg->
msg, 18, 4);
349 trace(NULL, 4,
"decode_sbstype18:\n");
351 if (0 <= band && band <= 8) {
354 }
else if (9 <= band && band <= 10) {
363 for (i = 1, n = 0; i <= 201; i++) {
367 for (j = 0; j < m; j++) {
368 if (i < p[j].bits || p[j].bite < i) {
371 sbsion[band].
igp[n].
lat = band <= 8 ? p[j].
y[i - p[j].
bits] : p[j].
x;
372 sbsion[band].
igp[n++].
lon = band <= 8 ? p[j].
x : p[j].
y[i - p[j].
bits];
376 sbsion[band].
nigp = n;
378 trace(NULL, 5,
"decode_sbstype18: band=%d nigp=%d\n", band, n);
385 trace(NULL, 4,
"decode_longcorr0:\n");
387 if (n == 0 || n >
MAXSAT) {
393 for (i = 0; i < 3; i++) {
401 trace(NULL, 5,
"decode_longcorr0:sat=%2d\n", sbssat->
sat[n - 1].
sat);
408 trace(NULL, 4,
"decode_longcorr1:\n");
410 if (n == 0 || n >
MAXSAT) {
416 for (i = 0; i < 3; i++) {
422 t = (int)
getbitu(msg->
msg, p + 90, 13) * 16 - (int)msg->
tow % 86400;
425 }
else if (t > 43200) {
430 trace(NULL, 5,
"decode_longcorr1: sat=%2d\n", sbssat->
sat[n - 1].
sat);
435 trace(NULL, 4,
"decode_longcorrh:\n");
448 int i, j, iodf, blk, udre;
450 trace(NULL, 4,
"decode_sbstype24:\n");
459 for (i = 0; i < 6; i++) {
460 if ((j = 13 * blk + i) >= sbssat->
nsat) {
474 trace(NULL, 4,
"decode_sbstype25:\n");
480 int i, j, block, delay, give, band =
getbitu(msg->
msg, 14, 4);
482 trace(NULL, 4,
"decode_sbstype26:\n");
490 for (i = 0; i < 15; i++) {
491 if ((j = block * 15 + i) >= sbsion[band].nigp) {
498 sbsion[band].
igp[j].
delay = delay == 0x1FF ? 0.0f : delay * 0.125f;
499 sbsion[band].
igp[j].
give = give + 1;
501 if (sbsion[band].igp[j].give >= 16) {
505 trace(NULL, 5,
"decode_sbstype26: band=%d block=%d\n", band, block);
518 int type =
getbitu(msg->
msg, 8, 6), stat = -1;
520 trace(NULL, 3,
"sbsupdatecorr: type=%d\n", type);
522 if (msg->
week == 0) {
565 return stat ? type : -1;
570 int i, week, prn, ch, msg;
572 double tow, ep[6] = {0};
577 trace(NULL, 3,
"readmsgs: file=%s sel=%d\n", file, sel);
579 if (!(fp = fopen(file,
"r"))) {
580 trace(NULL, 2,
"sbas message file open error: %s\n", file);
583 while (fgets(buff,
sizeof(buff), fp)) {
584 if (sscanf(buff,
"%d %lf %d", &week, &tow, &prn) == 3 && (p = strstr(buff,
": "))) {
586 }
else if (sscanf(buff,
"%d %lf %lf %lf %lf %lf %lf %d", &prn, ep, ep + 1, ep + 2, ep + 3, ep + 4, ep + 5,
589 ep[0] += ep[0] < 70.0 ? 2000.0 : 1900.0;
591 p = buff + (msg >= 10 ? 25 : 24);
592 }
else if (!strncmp(buff,
"#RAWWAASFRAMEA", 14)) {
596 if (sscanf(p,
"%d,%lf", &week, &tow) < 2) {
599 if (!(p = strchr(++p,
';'))) {
602 if (sscanf(++p,
"%d,%d", &ch, &prn) < 2) {
608 }
else if (!strncmp(buff,
"$FRMA", 5)) {
612 if (sscanf(p,
"%d,%lf,%d", &week, &tow, &prn) < 3) {
625 if (sel != 0 && sel != prn) {
631 if (!
screent(time, ts, te, 0.0)) {
635 if (sbs->
n >= sbs->
nmax) {
638 trace(NULL, 1,
"readsbsmsg malloc error: nmax=%d\n", sbs->
nmax);
641 sbs->
n = sbs->
nmax = 0;
644 sbs->
msgs = sbs_msgs;
647 sbs->
msgs[sbs->
n].
tow = (int)(tow + 0.5);
649 for (i = 0; i < 29; i++) {
652 for (i = 0; *(p - 1) && *p && i < 29; p += 2, i++) {
653 if (sscanf(p,
"%2X", &b) == 1) {
654 sbs->
msgs[sbs->
n].
msg[i] = (uint8_t)b;
657 sbs->
msgs[sbs->
n++].
msg[28] &= 0xC0;
662static int cmpmsgs(
const void* p1,
const void* p2) {
664 return q1->
week != q2->week ? q1->
week - q2->week
665 : (q1->
tow < q2->tow ? -1 : (q1->
tow > q2->tow ? 1 : q1->
prn - q2->prn));
686 trace(NULL, 3,
"sbsreadmsgt: file=%s sel=%d\n", file, sel);
689 if (!(efiles[i] = (
char*)
malloc(1024))) {
690 for (i--; i >= 0; i--) {
699 for (i = 0; i < n; i++) {
700 if (!(ext = strrchr(efiles[i],
'.'))) {
703 if (strcmp(ext,
".sbs") && strcmp(ext,
".SBS") && strcmp(ext,
".ems") && strcmp(ext,
".EMS")) {
707 readmsgs(efiles[i], sel, ts, te, sbs);
722 trace(NULL, 3,
"sbsreadmsg: file=%s sel=%d\n", file, sel);
733 int i, prn = sbsmsg->
prn, type = sbsmsg->
msg[1] >> 2;
735 trace(NULL, 4,
"sbsoutmsg:\n");
737 fprintf(fp,
"%4d %6d %3d %2d : ", sbsmsg->
week, sbsmsg->
tow, prn, type);
738 for (i = 0; i < 29; i++) {
739 fprintf(fp,
"%02X", sbsmsg->
msg[i]);
746 int i, latp[2], lonp[4];
747 double lat = pos[0] *
R2D, lon = pos[1] *
R2D;
750 trace(NULL, 4,
"searchigp: pos=%.3f %.3f\n", pos[0] *
R2D, pos[1] *
R2D);
755 if (-55.0 <= lat && lat < 55.0) {
756 latp[0] = (int)floor(lat / 5.0) * 5;
757 latp[1] = latp[0] + 5;
758 lonp[0] = lonp[1] = (int)floor(lon / 5.0) * 5;
759 lonp[2] = lonp[3] = lonp[0] + 5;
760 *x = (lon - lonp[0]) / 5.0;
761 *y = (lat - latp[0]) / 5.0;
763 latp[0] = (int)floor((lat - 5.0) / 10.0) * 10 + 5;
764 latp[1] = latp[0] + 10;
765 lonp[0] = lonp[1] = (int)floor(lon / 10.0) * 10;
766 lonp[2] = lonp[3] = lonp[0] + 10;
767 *x = (lon - lonp[0]) / 10.0;
768 *y = (lat - latp[0]) / 10.0;
769 if (75.0 <= lat && lat < 85.0) {
770 lonp[1] = (int)floor(lon / 90.0) * 90;
771 lonp[3] = lonp[1] + 90;
772 }
else if (-85.0 <= lat && lat < -75.0) {
773 lonp[0] = (int)floor((lon - 50.0) / 90.0) * 90 + 40;
774 lonp[2] = lonp[0] + 90;
775 }
else if (lat >= 85.0) {
776 for (i = 0; i < 4; i++) {
777 lonp[i] = (int)floor(lon / 90.0) * 90;
779 }
else if (lat < -85.0) {
780 for (i = 0; i < 4; i++) {
781 lonp[i] = (int)floor((lon - 50.0) / 90.0) * 90 + 40;
785 for (i = 0; i < 4; i++) {
786 if (lonp[i] == 180) {
790 for (i = 0; i <=
MAXBAND; i++) {
791 for (p = ion[i].igp; p < ion[i].
igp + ion[i].
nigp; p++) {
795 if (p->
lat == latp[0] && p->
lon == lonp[0] && p->
give > 0) {
797 }
else if (p->
lat == latp[1] && p->
lon == lonp[1] && p->
give > 0) {
799 }
else if (p->
lat == latp[0] && p->
lon == lonp[2] && p->
give > 0) {
801 }
else if (p->
lat == latp[1] && p->
lon == lonp[3] && p->
give > 0) {
804 if (igp[0] && igp[1] && igp[2] && igp[3]) {
824 const double re = 6378.1363, hion = 350.0;
826 double fp, posp[2], x = 0.0, y = 0.0, t, w[4] = {0};
829 trace(NULL, 4,
"sbsioncorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] *
R2D, pos[1] *
R2D, azel[0] *
R2D,
833 if (pos[2] < -100.0 || azel[1] <= 0) {
838 fp =
ionppp(pos, azel, re, hion, posp);
844 if (igp[0] && igp[1] && igp[2] && igp[3]) {
845 w[0] = (1.0 - x) * (1.0 - y);
846 w[1] = (1.0 - x) * y;
847 w[2] = x * (1.0 - y);
849 }
else if (igp[0] && igp[1] && igp[2]) {
852 if ((w[0] = 1.0 - w[1] - w[2]) < 0.0) {
855 }
else if (igp[0] && igp[2] && igp[3]) {
858 if ((w[2] = 1.0 - w[0] - w[3]) < 0.0) {
861 }
else if (igp[0] && igp[1] && igp[3]) {
864 if ((w[1] = 1.0 - w[0] - w[3]) < 0.0) {
867 }
else if (igp[1] && igp[2] && igp[3]) {
870 if ((w[3] = 1.0 - w[1] - w[2]) < 0.0) {
878 trace(NULL, 2,
"no sbas iono correction: lat=%3.0f lon=%4.0f\n", posp[0] *
R2D, posp[1] *
R2D);
881 for (i = 0; i < 4; i++) {
886 *delay += w[i] * igp[i]->
delay;
887 *var += w[i] *
varicorr(igp[i]->give) * 9E-8 * fabs(t);
892 trace(NULL, 5,
"sbsioncorr: dion=%7.2f sig=%7.2f\n", *delay, sqrt(*var));
896static void getmet(
double lat,
double* met) {
897 static const double metprm[][10] = {
898 {1013.25, 299.65, 26.31, 6.30E-3, 2.77, 0.00, 0.00, 0.00, 0.00E-3, 0.00},
899 {1017.25, 294.15, 21.79, 6.05E-3, 3.15, -3.75, 7.00, 8.85, 0.25E-3, 0.33},
900 {1015.75, 283.15, 11.66, 5.58E-3, 2.57, -2.25, 11.00, 7.24, 0.32E-3, 0.46},
901 {1011.75, 272.15, 6.78, 5.39E-3, 1.81, -1.75, 15.00, 5.36, 0.81E-3, 0.74},
902 {1013.00, 263.65, 4.11, 4.53E-3, 1.55, -0.50, 14.50, 3.39, 0.62E-3, 0.30}};
907 for (i = 0; i < 10; i++) {
908 met[i] = metprm[0][i];
910 }
else if (lat >= 75.0) {
911 for (i = 0; i < 10; i++) {
912 met[i] = metprm[4][i];
915 j = (int)(lat / 15.0);
916 a = (lat - j * 15.0) / 15.0;
917 for (i = 0; i < 10; i++) {
918 met[i] = (1.0 - a) * metprm[j - 1][i] + a * metprm[j][i];
931 const double k1 = 77.604, k2 = 382000.0, rd = 287.054, gm = 9.784, g = 9.80665;
932 static double pos_[3] = {0}, zh = 0.0, zw = 0.0;
934 double c, met[10], sinel = sin(azel[1]), h = pos[2], m;
936 trace(NULL, 4,
"sbstropcorr: pos=%.3f %.3f azel=%.3f %.3f\n", pos[0] *
R2D, pos[1] *
R2D, azel[0] *
R2D,
939 if (pos[2] < -100.0 || 10000.0 < pos[2] || azel[1] <= 0) {
943 if (zh == 0.0 || fabs(pos[0] - pos_[0]) > 1E-7 || fabs(pos[1] - pos_[1]) > 1E-7 || fabs(pos[2] - pos_[2]) > 1.0) {
945 c = cos(2.0 *
PI * (
time2doy(time) - (pos[0] >= 0.0 ? 28.0 : 211.0)) / 365.25);
946 for (i = 0; i < 5; i++) {
947 met[i] -= met[i + 5] * c;
949 zh = 1E-6 * k1 * rd * met[0] / gm;
950 zw = 1E-6 * k2 * rd / (gm * (met[4] + 1.0) - met[3] * rd) * met[2] / met[1];
951 zh *= pow(1.0 - met[3] * h / met[1], g / (rd * met[3]));
952 zw *= pow(1.0 - met[3] * h / met[1], (met[4] + 1.0) * g / (rd * met[3]) - 1.0);
953 for (i = 0; i < 3; i++) {
957 m = 1.001 / sqrt(0.002001 + sinel * sinel);
958 *var = 0.12 * 0.12 * m * m;
959 return (zh + zw) * m;
967 trace(NULL, 3,
"sbslongcorr: sat=%2d\n", sat);
969 for (p = sbssat->
sat; p < sbssat->sat + sbssat->
nsat; p++) {
975 trace(NULL, 2,
"sbas long-term correction expired: %s sat=%2d t=%5.0f\n",
time_str(time, 0), sat, t);
978 for (i = 0; i < 3; i++) {
983 trace(NULL, 5,
"sbslongcorr: sat=%2d drs=%7.2f%7.2f%7.2f ddts=%7.2f\n", sat, drs[0], drs[1], drs[2],
993 trace(NULL, 2,
"no sbas long-term correction: %s sat=%2d\n",
time_str(time, 0), sat);
1001 trace(NULL, 3,
"sbsfastcorr: sat=%2d\n", sat);
1003 for (p = sbssat->
sat; p < sbssat->sat + sbssat->
nsat; p++) {
1004 if (p->
sat != sat) {
1024 trace(NULL, 5,
"sbsfastcorr: sat=%3d prc=%7.2f sig=%7.2f t=%5.0f\n", sat, *prc, sqrt(*var), t);
1027 trace(NULL, 2,
"no sbas fast correction: %s sat=%2d\n",
time_str(time, 0), sat);
1048 double drs[3] = {0}, dclk = 0.0, prc = 0.0;
1051 trace(NULL, 3,
"sbssatcorr : sat=%2d\n", sat);
1061 for (i = 0; i < 3; i++) {
1065 dts[0] += dclk + prc /
CLIGHT;
1067 trace(NULL, 5,
"sbssatcorr: sat=%2d drs=%6.3f %6.3f %6.3f dclk=%.3f %.3f var=%.3f\n", sat, drs[0], drs[1], drs[2],
1068 dclk, prc /
CLIGHT, *var);
1085 trace(NULL, 5,
"sbsdecodemsg: prn=%d\n", prn);
1087 if (time.
time == 0) {
1093 for (i = 0; i < 7; i++) {
1094 for (j = 0; j < 4; j++) {
1095 sbsmsg->
msg[i * 4 + j] = (uint8_t)(words[i] >> ((3 - j) * 8));
1098 sbsmsg->
msg[28] = (uint8_t)(words[7] >> 18) & 0xC0;
1099 for (i = 28; i > 0; i--) {
1100 f[i] = (sbsmsg->
msg[i] >> 6) + (sbsmsg->
msg[i - 1] << 2);
1102 f[0] = sbsmsg->
msg[0] >> 6;
1104 return rtk_crc24q(f, 29) == (words[7] & 0xFFFFFF);
double ionppp(const double *pos, const double *azel, double re, double hion, double *posp)
Compute ionospheric pierce point (IPP) position and slant factor.
MRTKLIB Atmosphere Module — Ionospheric and tropospheric models.
uint32_t rtk_crc24q(const uint8_t *buff, int len)
Compute CRC-24Q parity for SBAS and RTCM3.
uint32_t getbitu(const uint8_t *buff, int pos, int len)
Extract unsigned bits from byte data.
int32_t getbits(const uint8_t *buff, int pos, int len)
Extract signed bits from byte data.
MRTKLIB Bits Module — Binary bit operations and CRC functions.
int satsys(int sat, int *prn)
int satno(int sys, int prn)
Convert satellite system+prn/slot number to satellite number.
int screent(gtime_t time, gtime_t ts, gtime_t te, double tint)
Screen data by time range and interval.
static void searchigp(gtime_t time, const double *pos, const sbsion_t *ion, const sbsigp_t **igp, double *x, double *y)
void sbsoutmsg(FILE *fp, sbsmsg_t *sbsmsg)
Output SBAS message record.
static int decode_longcorr1(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
static int decode_sbstype2(const sbsmsg_t *msg, sbssat_t *sbssat)
static int decode_longcorrh(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
static int decode_sbstype26(const sbsmsg_t *msg, sbsion_t *sbsion)
static int decode_sbstype6(const sbsmsg_t *msg, sbssat_t *sbssat)
int sbsreadmsg(const char *file, int sel, sbs_t *sbs)
Read SBAS message file.
static const int16_t x3[]
static int decode_sbstype9(const sbsmsg_t *msg, nav_t *nav)
static const int16_t x6[]
static double varfcorr(int udre)
int sbsioncorr(gtime_t time, const nav_t *nav, const double *pos, const double *azel, double *delay, double *var)
SBAS ionospheric delay correction.
static double degfcorr(int ai)
static int decode_sbstype1(const sbsmsg_t *msg, sbssat_t *sbssat)
const sbsigpband_t igpband1[9][8]
static const int16_t x7[]
int sbsdecodemsg(gtime_t time, int prn, const uint32_t *words, sbsmsg_t *sbsmsg)
Decode SBAS message frame words.
int sbsreadmsgt(const char *file, int sel, gtime_t ts, gtime_t te, sbs_t *sbs)
Read SBAS message file with time span.
static int sbsfastcorr(gtime_t time, int sat, const sbssat_t *sbssat, double *prc, double *var)
static char * getfield(char *p, int pos)
static int decode_sbstype18(const sbsmsg_t *msg, sbsion_t *sbsion)
static const int16_t x4[]
static void getmet(double lat, double *met)
static int decode_sbstype25(const sbsmsg_t *msg, sbssat_t *sbssat)
double sbstropcorr(gtime_t time, const double *pos, const double *azel, double *var)
SBAS tropospheric delay correction.
int sbsupdatecorr(const sbsmsg_t *msg, nav_t *nav)
Update SBAS corrections in navigation data.
static const int16_t x1[]
static int decode_sbstype24(const sbsmsg_t *msg, sbssat_t *sbssat)
const sbsigpband_t igpband2[2][5]
static const int16_t x5[]
int sbssatcorr(gtime_t time, int sat, const nav_t *nav, double *rs, double *dts, double *var)
SBAS satellite ephemeris and clock correction.
static int cmpmsgs(const void *p1, const void *p2)
static const int16_t x8[]
static int decode_longcorr0(const sbsmsg_t *msg, int p, sbssat_t *sbssat)
static int sbslongcorr(gtime_t time, int sat, const sbssat_t *sbssat, double *drs, double *ddts)
static double varicorr(int give)
static const int16_t x2[]
static void readmsgs(const char *file, int sel, gtime_t ts, gtime_t te, sbs_t *sbs)
static int decode_sbstype7(const sbsmsg_t *msg, sbssat_t *sbssat)
MRTKLIB SBAS Module — SBAS message decoding and corrections.
int expath(const char *path, char *paths[], int nmax)
Expand file path with wild-card (*) in file.
MRTKLIB System Module — OS/filesystem utility functions.
gtime_t epoch2time(const double *ep)
Convert calendar day/time to gtime_t struct.
gtime_t gpst2time(int week, double sec)
Convert GPS week/tow to gtime_t.
double timediff(gtime_t t1, gtime_t t2)
Compute time difference (t1 - t2).
double time2gpst(gtime_t t, int *week)
Convert gtime_t to GPS week/tow.
double time2doy(gtime_t t)
Convert time to day of year.
char * time_str(gtime_t t, int n)
Get time string (not reentrant).
void trace(mrtk_ctx_t *ctx, int level, const char *format,...)
Output trace message.
MRTKLIB Trace Module — debug trace and logging functions.
GNSS time representation.
sbsion_t sbsion[MAXBAND+1]