gnss-js 1.48.0 → 1.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ROVSSEGZ.js → chunk-2IM5JYKP.js} +1 -1
- package/dist/{chunk-EQNC24OB.js → chunk-DEVUKH6A.js} +2 -1
- package/dist/{chunk-KRXX4UGR.js → chunk-VYC2FRDV.js} +518 -12
- package/dist/{chunk-ZIGMN3E5.js → chunk-WQX354KD.js} +1 -0
- package/dist/{chunk-MEDAWNWM.js → chunk-XFPDTGSV.js} +1 -1
- package/dist/index.cjs +524 -23
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -7
- package/dist/novatel.js +2 -2
- package/dist/positioning.cjs +538 -15
- package/dist/positioning.d.cts +66 -1
- package/dist/positioning.d.ts +66 -1
- package/dist/positioning.js +6 -1
- package/dist/rinex.js +2 -2
- package/dist/sbf.js +2 -2
- package/dist/ubx.cjs +1 -0
- package/dist/ubx.d.cts +7 -0
- package/dist/ubx.d.ts +7 -0
- package/dist/ubx.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -100,6 +100,7 @@ __export(src_exports, {
|
|
|
100
100
|
SYSTEM_NAMES: () => SYSTEM_NAMES,
|
|
101
101
|
SYSTEM_ORDER: () => SYSTEM_ORDER,
|
|
102
102
|
SYS_SHORT: () => SYS_SHORT,
|
|
103
|
+
SbasProcessor: () => SbasProcessor,
|
|
103
104
|
Scale: () => Scale,
|
|
104
105
|
WGS84_ECCENTRICITY_SQUARED: () => WGS84_ECCENTRICITY_SQUARED,
|
|
105
106
|
WGS84_FLATTENING: () => WGS84_FLATTENING,
|
|
@@ -1161,8 +1162,8 @@ function rhumbLine(lat1, lon1, lat2, lon2) {
|
|
|
1161
1162
|
const distance = Math.sqrt(dLat ** 2 + q ** 2 * dLon ** 2) * meridionalRadius;
|
|
1162
1163
|
return { distance, bearing };
|
|
1163
1164
|
}
|
|
1164
|
-
function euclidean3D(
|
|
1165
|
-
return Math.sqrt((
|
|
1165
|
+
function euclidean3D(x12, y1, z1, x22, y2, z2) {
|
|
1166
|
+
return Math.sqrt((x22 - x12) ** 2 + (y2 - y1) ** 2 + (z2 - z1) ** 2);
|
|
1166
1167
|
}
|
|
1167
1168
|
function greatCircleMidpoint(lat1, lon1, lat2, lon2) {
|
|
1168
1169
|
const dLon = lon2 - lon1;
|
|
@@ -6944,6 +6945,7 @@ function parseUbxRawNav(data, opts = {}) {
|
|
|
6944
6945
|
continue;
|
|
6945
6946
|
}
|
|
6946
6947
|
if (refWeek === 0) continue;
|
|
6948
|
+
opts.onSbasMessage?.(msg, svId, refWeek, refTow);
|
|
6947
6949
|
const eph = decodeSbasGeoNav(msg, svId, refWeek, refTow);
|
|
6948
6950
|
if (eph) {
|
|
6949
6951
|
const key = `${eph.prn}@${eph.tocDate.getTime()}`;
|
|
@@ -6975,20 +6977,20 @@ var SIGNALS = {
|
|
|
6975
6977
|
// GLONASS L1OF, L2OF
|
|
6976
6978
|
};
|
|
6977
6979
|
function prnFor(gnssId, svId) {
|
|
6978
|
-
const
|
|
6980
|
+
const two9 = (n) => String(n).padStart(2, "0");
|
|
6979
6981
|
switch (gnssId) {
|
|
6980
6982
|
case 0:
|
|
6981
|
-
return svId >= 1 && svId <= 32 ? `G${
|
|
6983
|
+
return svId >= 1 && svId <= 32 ? `G${two9(svId)}` : null;
|
|
6982
6984
|
case 1:
|
|
6983
|
-
return svId >= 120 && svId <= 158 ? `S${
|
|
6985
|
+
return svId >= 120 && svId <= 158 ? `S${two9(svId - 100)}` : null;
|
|
6984
6986
|
case 2:
|
|
6985
|
-
return svId >= 1 && svId <= 36 ? `E${
|
|
6987
|
+
return svId >= 1 && svId <= 36 ? `E${two9(svId)}` : null;
|
|
6986
6988
|
case 3:
|
|
6987
|
-
return svId >= 1 && svId <= 63 ? `C${
|
|
6989
|
+
return svId >= 1 && svId <= 63 ? `C${two9(svId)}` : null;
|
|
6988
6990
|
case 5:
|
|
6989
|
-
return svId >= 1 && svId <= 10 ? `J${
|
|
6991
|
+
return svId >= 1 && svId <= 10 ? `J${two9(svId)}` : null;
|
|
6990
6992
|
case 6:
|
|
6991
|
-
return svId >= 1 && svId <= 32 ? `R${
|
|
6993
|
+
return svId >= 1 && svId <= 32 ? `R${two9(svId)}` : null;
|
|
6992
6994
|
default:
|
|
6993
6995
|
return null;
|
|
6994
6996
|
}
|
|
@@ -11415,8 +11417,8 @@ function computeSatPosition(eph, timeMs) {
|
|
|
11415
11417
|
return glonassPosition(eph, (timeMs - leapMs) / 1e3);
|
|
11416
11418
|
}
|
|
11417
11419
|
const GPS_EPOCH2 = START_GPS_TIME.getTime();
|
|
11418
|
-
const
|
|
11419
|
-
let tow =
|
|
11420
|
+
const gpsSeconds2 = (timeMs - GPS_EPOCH2) / 1e3;
|
|
11421
|
+
let tow = gpsSeconds2 % (7 * 86400);
|
|
11420
11422
|
if (eph.system === "C") tow = (tow - 14 + 604800) % 604800;
|
|
11421
11423
|
return keplerPosition(eph, tow);
|
|
11422
11424
|
}
|
|
@@ -11978,8 +11980,8 @@ function klobucharDelay(coeffs, latRad, lonRad, azRad, elRad, gpsTowSec) {
|
|
|
11978
11980
|
const F = 1 + 16 * Math.pow(0.53 - E, 3);
|
|
11979
11981
|
const x = 2 * Math.PI * (t - 50400) / per;
|
|
11980
11982
|
if (Math.abs(x) >= 1.57) return F * 5e-9;
|
|
11981
|
-
const
|
|
11982
|
-
return F * (5e-9 + amp * (1 -
|
|
11983
|
+
const x22 = x * x;
|
|
11984
|
+
return F * (5e-9 + amp * (1 - x22 / 2 + x22 * x22 / 24));
|
|
11983
11985
|
}
|
|
11984
11986
|
|
|
11985
11987
|
// src/positioning/gim.ts
|
|
@@ -13131,6 +13133,492 @@ function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
|
13131
13133
|
return { track, solved, unmatched, fixRate: solved ? fixed / solved : 0 };
|
|
13132
13134
|
}
|
|
13133
13135
|
|
|
13136
|
+
// src/positioning/sbas.ts
|
|
13137
|
+
var P2_11 = 2 ** -11;
|
|
13138
|
+
var P2_31 = 2 ** -31;
|
|
13139
|
+
var P2_39 = 2 ** -39;
|
|
13140
|
+
var D2R = Math.PI / 180;
|
|
13141
|
+
var R2D = 180 / Math.PI;
|
|
13142
|
+
var SEC_PER_WEEK12 = 604800;
|
|
13143
|
+
var MAXSBSAGEF = 30;
|
|
13144
|
+
var MAXSBSAGEL = 1800;
|
|
13145
|
+
var MAXBAND = 10;
|
|
13146
|
+
var two8 = (n) => String(n).padStart(2, "0");
|
|
13147
|
+
var VAR_FCORR = [
|
|
13148
|
+
0.052,
|
|
13149
|
+
0.0924,
|
|
13150
|
+
0.1444,
|
|
13151
|
+
0.283,
|
|
13152
|
+
0.4678,
|
|
13153
|
+
0.8315,
|
|
13154
|
+
1.2992,
|
|
13155
|
+
1.8709,
|
|
13156
|
+
2.5465,
|
|
13157
|
+
3.326,
|
|
13158
|
+
5.1968,
|
|
13159
|
+
20.787,
|
|
13160
|
+
230.9661,
|
|
13161
|
+
2078.695
|
|
13162
|
+
];
|
|
13163
|
+
var varfcorr = (udre) => udre > 0 && udre <= 14 ? VAR_FCORR[udre - 1] : 0;
|
|
13164
|
+
var VAR_ICORR = [
|
|
13165
|
+
84e-4,
|
|
13166
|
+
0.0333,
|
|
13167
|
+
0.0749,
|
|
13168
|
+
0.1331,
|
|
13169
|
+
0.2079,
|
|
13170
|
+
0.2994,
|
|
13171
|
+
0.4075,
|
|
13172
|
+
0.5322,
|
|
13173
|
+
0.6735,
|
|
13174
|
+
0.8315,
|
|
13175
|
+
1.1974,
|
|
13176
|
+
1.8709,
|
|
13177
|
+
3.326,
|
|
13178
|
+
20.787,
|
|
13179
|
+
187.0826
|
|
13180
|
+
];
|
|
13181
|
+
var varicorr = (give) => give > 0 && give <= 15 ? VAR_ICORR[give - 1] : 0;
|
|
13182
|
+
var DEGF = [
|
|
13183
|
+
0,
|
|
13184
|
+
5e-5,
|
|
13185
|
+
9e-5,
|
|
13186
|
+
12e-5,
|
|
13187
|
+
15e-5,
|
|
13188
|
+
2e-4,
|
|
13189
|
+
3e-4,
|
|
13190
|
+
45e-5,
|
|
13191
|
+
6e-4,
|
|
13192
|
+
9e-4,
|
|
13193
|
+
15e-4,
|
|
13194
|
+
21e-4,
|
|
13195
|
+
27e-4,
|
|
13196
|
+
33e-4,
|
|
13197
|
+
46e-4,
|
|
13198
|
+
58e-4
|
|
13199
|
+
];
|
|
13200
|
+
var degfcorr = (ai) => ai > 0 && ai <= 15 ? DEGF[ai] : 58e-4;
|
|
13201
|
+
var x1 = [-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75, 85];
|
|
13202
|
+
var x2 = [-55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55];
|
|
13203
|
+
var x3 = [-75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75];
|
|
13204
|
+
var x4 = [-85, -75, -65, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 65, 75];
|
|
13205
|
+
var x5 = [-180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130, -125, -120, -115, -110, -105, -100, -95, -90, -85, -80, -75, -70, -65, -60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175];
|
|
13206
|
+
var x6 = [-180, -170, -160, -150, -140, -130, -120, -110, -100, -90, -80, -70, -60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170];
|
|
13207
|
+
var x7 = [-180, -150, -120, -90, -60, -30, 0, 30, 60, 90, 120, 150];
|
|
13208
|
+
var x8 = [-170, -140, -110, -80, -50, -20, 10, 40, 70, 100, 130, 160];
|
|
13209
|
+
var igpband1 = [
|
|
13210
|
+
[{ coord: -180, arr: x1, bits: 1, bite: 28 }, { coord: -175, arr: x2, bits: 29, bite: 51 }, { coord: -170, arr: x3, bits: 52, bite: 78 }, { coord: -165, arr: x2, bits: 79, bite: 101 }, { coord: -160, arr: x3, bits: 102, bite: 128 }, { coord: -155, arr: x2, bits: 129, bite: 151 }, { coord: -150, arr: x3, bits: 152, bite: 178 }, { coord: -145, arr: x2, bits: 179, bite: 201 }],
|
|
13211
|
+
[{ coord: -140, arr: x4, bits: 1, bite: 28 }, { coord: -135, arr: x2, bits: 29, bite: 51 }, { coord: -130, arr: x3, bits: 52, bite: 78 }, { coord: -125, arr: x2, bits: 79, bite: 101 }, { coord: -120, arr: x3, bits: 102, bite: 128 }, { coord: -115, arr: x2, bits: 129, bite: 151 }, { coord: -110, arr: x3, bits: 152, bite: 178 }, { coord: -105, arr: x2, bits: 179, bite: 201 }],
|
|
13212
|
+
[{ coord: -100, arr: x3, bits: 1, bite: 27 }, { coord: -95, arr: x2, bits: 28, bite: 50 }, { coord: -90, arr: x1, bits: 51, bite: 78 }, { coord: -85, arr: x2, bits: 79, bite: 101 }, { coord: -80, arr: x3, bits: 102, bite: 128 }, { coord: -75, arr: x2, bits: 129, bite: 151 }, { coord: -70, arr: x3, bits: 152, bite: 178 }, { coord: -65, arr: x2, bits: 179, bite: 201 }],
|
|
13213
|
+
[{ coord: -60, arr: x3, bits: 1, bite: 27 }, { coord: -55, arr: x2, bits: 28, bite: 50 }, { coord: -50, arr: x4, bits: 51, bite: 78 }, { coord: -45, arr: x2, bits: 79, bite: 101 }, { coord: -40, arr: x3, bits: 102, bite: 128 }, { coord: -35, arr: x2, bits: 129, bite: 151 }, { coord: -30, arr: x3, bits: 152, bite: 178 }, { coord: -25, arr: x2, bits: 179, bite: 201 }],
|
|
13214
|
+
[{ coord: -20, arr: x3, bits: 1, bite: 27 }, { coord: -15, arr: x2, bits: 28, bite: 50 }, { coord: -10, arr: x3, bits: 51, bite: 77 }, { coord: -5, arr: x2, bits: 78, bite: 100 }, { coord: 0, arr: x1, bits: 101, bite: 128 }, { coord: 5, arr: x2, bits: 129, bite: 151 }, { coord: 10, arr: x3, bits: 152, bite: 178 }, { coord: 15, arr: x2, bits: 179, bite: 201 }],
|
|
13215
|
+
[{ coord: 20, arr: x3, bits: 1, bite: 27 }, { coord: 25, arr: x2, bits: 28, bite: 50 }, { coord: 30, arr: x3, bits: 51, bite: 77 }, { coord: 35, arr: x2, bits: 78, bite: 100 }, { coord: 40, arr: x4, bits: 101, bite: 128 }, { coord: 45, arr: x2, bits: 129, bite: 151 }, { coord: 50, arr: x3, bits: 152, bite: 178 }, { coord: 55, arr: x2, bits: 179, bite: 201 }],
|
|
13216
|
+
[{ coord: 60, arr: x3, bits: 1, bite: 27 }, { coord: 65, arr: x2, bits: 28, bite: 50 }, { coord: 70, arr: x3, bits: 51, bite: 77 }, { coord: 75, arr: x2, bits: 78, bite: 100 }, { coord: 80, arr: x3, bits: 101, bite: 127 }, { coord: 85, arr: x2, bits: 128, bite: 150 }, { coord: 90, arr: x1, bits: 151, bite: 178 }, { coord: 95, arr: x2, bits: 179, bite: 201 }],
|
|
13217
|
+
[{ coord: 100, arr: x3, bits: 1, bite: 27 }, { coord: 105, arr: x2, bits: 28, bite: 50 }, { coord: 110, arr: x3, bits: 51, bite: 77 }, { coord: 115, arr: x2, bits: 78, bite: 100 }, { coord: 120, arr: x3, bits: 101, bite: 127 }, { coord: 125, arr: x2, bits: 128, bite: 150 }, { coord: 130, arr: x4, bits: 151, bite: 178 }, { coord: 135, arr: x2, bits: 179, bite: 201 }],
|
|
13218
|
+
[{ coord: 140, arr: x3, bits: 1, bite: 27 }, { coord: 145, arr: x2, bits: 28, bite: 50 }, { coord: 150, arr: x3, bits: 51, bite: 77 }, { coord: 155, arr: x2, bits: 78, bite: 100 }, { coord: 160, arr: x3, bits: 101, bite: 127 }, { coord: 165, arr: x2, bits: 128, bite: 150 }, { coord: 170, arr: x3, bits: 151, bite: 177 }, { coord: 175, arr: x2, bits: 178, bite: 200 }]
|
|
13219
|
+
];
|
|
13220
|
+
var igpband2 = [
|
|
13221
|
+
[{ coord: 60, arr: x5, bits: 1, bite: 72 }, { coord: 65, arr: x6, bits: 73, bite: 108 }, { coord: 70, arr: x6, bits: 109, bite: 144 }, { coord: 75, arr: x6, bits: 145, bite: 180 }, { coord: 85, arr: x7, bits: 181, bite: 192 }],
|
|
13222
|
+
[{ coord: -60, arr: x5, bits: 1, bite: 72 }, { coord: -65, arr: x6, bits: 73, bite: 108 }, { coord: -70, arr: x6, bits: 109, bite: 144 }, { coord: -75, arr: x6, bits: 145, bite: 180 }, { coord: -85, arr: x8, bits: 181, bite: 192 }]
|
|
13223
|
+
];
|
|
13224
|
+
var gpsSeconds = (week, tow) => week * SEC_PER_WEEK12 + tow;
|
|
13225
|
+
function maskPrn(i) {
|
|
13226
|
+
if (i >= 1 && i <= 37) return `G${two8(i)}`;
|
|
13227
|
+
if (i >= 38 && i <= 61) return `R${two8(i - 37)}`;
|
|
13228
|
+
if (i >= 120 && i <= 138) return `S${two8(i - 100)}`;
|
|
13229
|
+
if (i >= 193 && i <= 202) return `J${two8(i - 192)}`;
|
|
13230
|
+
return null;
|
|
13231
|
+
}
|
|
13232
|
+
function ionppp(latRad, lonRad, azRad, elRad, re, hion) {
|
|
13233
|
+
const rp = re / (re + hion) * Math.cos(elRad);
|
|
13234
|
+
const ap = Math.PI / 2 - elRad - Math.asin(rp);
|
|
13235
|
+
const sinap = Math.sin(ap);
|
|
13236
|
+
const tanap = Math.tan(ap);
|
|
13237
|
+
const cosaz = Math.cos(azRad);
|
|
13238
|
+
const latP = Math.asin(
|
|
13239
|
+
Math.sin(latRad) * Math.cos(ap) + Math.cos(latRad) * sinap * cosaz
|
|
13240
|
+
);
|
|
13241
|
+
let lonP;
|
|
13242
|
+
if (latRad > 70 * D2R && tanap * cosaz > Math.tan(Math.PI / 2 - latRad) || latRad < -70 * D2R && -tanap * cosaz > Math.tan(Math.PI / 2 + latRad)) {
|
|
13243
|
+
lonP = lonRad + Math.PI - Math.asin(sinap * Math.sin(azRad) / Math.cos(latP));
|
|
13244
|
+
} else {
|
|
13245
|
+
lonP = lonRad + Math.asin(sinap * Math.sin(azRad) / Math.cos(latP));
|
|
13246
|
+
}
|
|
13247
|
+
return { fp: 1 / Math.sqrt(1 - rp * rp), latP, lonP };
|
|
13248
|
+
}
|
|
13249
|
+
var SbasProcessor = class {
|
|
13250
|
+
sats = [];
|
|
13251
|
+
satIdx = /* @__PURE__ */ new Map();
|
|
13252
|
+
iodp = -1;
|
|
13253
|
+
tlat = 0;
|
|
13254
|
+
ion = [];
|
|
13255
|
+
/** GEO PRN(s) whose messages have been ingested. */
|
|
13256
|
+
geoPrns = /* @__PURE__ */ new Set();
|
|
13257
|
+
/**
|
|
13258
|
+
* Ingest one decoded SBAS L1 message (250-bit, MSB-first) received at the
|
|
13259
|
+
* given GPS week / time-of-week. Returns the message type, or -1 if it was
|
|
13260
|
+
* not a recognised/applicable correction message.
|
|
13261
|
+
*/
|
|
13262
|
+
update(msg, week, tow, geoPrn) {
|
|
13263
|
+
if (week === 0) return -1;
|
|
13264
|
+
const type = sbasMessageType(msg);
|
|
13265
|
+
if (geoPrn != null && geoPrn >= 120 && geoPrn <= 158)
|
|
13266
|
+
this.geoPrns.add(`S${two8(geoPrn - 100)}`);
|
|
13267
|
+
switch (type) {
|
|
13268
|
+
case 1:
|
|
13269
|
+
return this.decodeMask(msg) ? type : -1;
|
|
13270
|
+
case 0:
|
|
13271
|
+
case 2:
|
|
13272
|
+
case 3:
|
|
13273
|
+
case 4:
|
|
13274
|
+
case 5:
|
|
13275
|
+
return this.decodeFast(msg, type, week, tow) ? type : -1;
|
|
13276
|
+
case 6:
|
|
13277
|
+
return this.decodeIntegrity(msg) ? type : -1;
|
|
13278
|
+
case 7:
|
|
13279
|
+
return this.decodeDegradation(msg) ? type : -1;
|
|
13280
|
+
case 18:
|
|
13281
|
+
return this.decodeIgpMask(msg) ? type : -1;
|
|
13282
|
+
case 24:
|
|
13283
|
+
return this.decodeMixed(msg, week, tow) ? type : -1;
|
|
13284
|
+
case 25:
|
|
13285
|
+
return this.decodeLongCorrHalf(msg, 14, week, tow) && this.decodeLongCorrHalf(msg, 120, week, tow) ? type : -1;
|
|
13286
|
+
case 26:
|
|
13287
|
+
return this.decodeIgpDelay(msg, week, tow) ? type : -1;
|
|
13288
|
+
case 9:
|
|
13289
|
+
// GEO nav — handled by decodeSbasGeoNav elsewhere
|
|
13290
|
+
case 63:
|
|
13291
|
+
return type;
|
|
13292
|
+
default:
|
|
13293
|
+
return -1;
|
|
13294
|
+
}
|
|
13295
|
+
}
|
|
13296
|
+
decodeMask(msg) {
|
|
13297
|
+
const sats = [];
|
|
13298
|
+
for (let i = 1; i <= 210; i++) {
|
|
13299
|
+
if (getBitU(msg, 13 + i, 1)) sats.push({ prn: maskPrn(i) });
|
|
13300
|
+
}
|
|
13301
|
+
this.iodp = getBitU(msg, 224, 2);
|
|
13302
|
+
this.sats = sats;
|
|
13303
|
+
this.satIdx.clear();
|
|
13304
|
+
sats.forEach((s, k) => {
|
|
13305
|
+
if (s.prn) this.satIdx.set(s.prn, k);
|
|
13306
|
+
});
|
|
13307
|
+
return true;
|
|
13308
|
+
}
|
|
13309
|
+
decodeFast(msg, type, week, tow) {
|
|
13310
|
+
if (this.iodp !== getBitU(msg, 16, 2)) return false;
|
|
13311
|
+
const iodf = getBitU(msg, 14, 2);
|
|
13312
|
+
const t0s = gpsSeconds(week, tow);
|
|
13313
|
+
for (let i = 0; i < 13; i++) {
|
|
13314
|
+
const j = 13 * ((type === 0 ? 2 : type) - 2) + i;
|
|
13315
|
+
if (j >= this.sats.length) break;
|
|
13316
|
+
const udre = getBitU(msg, 174 + 4 * i, 4);
|
|
13317
|
+
const prc = getBitS(msg, 18 + i * 12, 12) * 0.125;
|
|
13318
|
+
const prev = this.sats[j].fcorr;
|
|
13319
|
+
this.sats[j].fcorr = {
|
|
13320
|
+
prc,
|
|
13321
|
+
udre: udre + 1,
|
|
13322
|
+
ai: prev?.ai ?? 0,
|
|
13323
|
+
iodf,
|
|
13324
|
+
t0s
|
|
13325
|
+
};
|
|
13326
|
+
}
|
|
13327
|
+
return true;
|
|
13328
|
+
}
|
|
13329
|
+
decodeIntegrity(msg) {
|
|
13330
|
+
const iodf = [0, 1, 2, 3].map((i) => getBitU(msg, 14 + i * 2, 2));
|
|
13331
|
+
for (let i = 0; i < this.sats.length; i++) {
|
|
13332
|
+
const f = this.sats[i].fcorr;
|
|
13333
|
+
if (!f || f.iodf !== iodf[Math.floor(i / 13)]) continue;
|
|
13334
|
+
f.udre = getBitU(msg, 22 + i * 4, 4) + 1;
|
|
13335
|
+
}
|
|
13336
|
+
return true;
|
|
13337
|
+
}
|
|
13338
|
+
decodeDegradation(msg) {
|
|
13339
|
+
if (this.iodp !== getBitU(msg, 18, 2)) return false;
|
|
13340
|
+
this.tlat = getBitU(msg, 14, 4);
|
|
13341
|
+
for (let i = 0; i < this.sats.length; i++) {
|
|
13342
|
+
const ai = getBitU(msg, 22 + i * 4, 4);
|
|
13343
|
+
if (this.sats[i].fcorr) this.sats[i].fcorr.ai = ai;
|
|
13344
|
+
else this.sats[i].fcorr = { prc: 0, udre: 0, ai, iodf: -1, t0s: 0 };
|
|
13345
|
+
}
|
|
13346
|
+
return true;
|
|
13347
|
+
}
|
|
13348
|
+
decodeMixed(msg, week, tow) {
|
|
13349
|
+
if (this.iodp !== getBitU(msg, 110, 2)) return false;
|
|
13350
|
+
const blk = getBitU(msg, 112, 2);
|
|
13351
|
+
const iodf = getBitU(msg, 114, 2);
|
|
13352
|
+
const t0s = gpsSeconds(week, tow);
|
|
13353
|
+
for (let i = 0; i < 6; i++) {
|
|
13354
|
+
const j = 13 * blk + i;
|
|
13355
|
+
if (j >= this.sats.length) break;
|
|
13356
|
+
const udre = getBitU(msg, 86 + 4 * i, 4);
|
|
13357
|
+
const prc = getBitS(msg, 14 + i * 12, 12) * 0.125;
|
|
13358
|
+
const prev = this.sats[j].fcorr;
|
|
13359
|
+
this.sats[j].fcorr = {
|
|
13360
|
+
prc,
|
|
13361
|
+
udre: udre + 1,
|
|
13362
|
+
ai: prev?.ai ?? 0,
|
|
13363
|
+
iodf,
|
|
13364
|
+
t0s
|
|
13365
|
+
};
|
|
13366
|
+
}
|
|
13367
|
+
return this.decodeLongCorrHalf(msg, 120, week, tow);
|
|
13368
|
+
}
|
|
13369
|
+
decodeLongCorrHalf(msg, p, week, tow) {
|
|
13370
|
+
if (getBitU(msg, p, 1) === 0) {
|
|
13371
|
+
if (this.iodp === getBitU(msg, p + 103, 2)) {
|
|
13372
|
+
const a = this.decodeLong0(msg, p + 1, week, tow);
|
|
13373
|
+
const b = this.decodeLong0(msg, p + 52, week, tow);
|
|
13374
|
+
return a || b;
|
|
13375
|
+
}
|
|
13376
|
+
} else if (this.iodp === getBitU(msg, p + 104, 2)) {
|
|
13377
|
+
return this.decodeLong1(msg, p + 1, week, tow);
|
|
13378
|
+
}
|
|
13379
|
+
return false;
|
|
13380
|
+
}
|
|
13381
|
+
decodeLong0(msg, p, week, tow) {
|
|
13382
|
+
const n = getBitU(msg, p, 6);
|
|
13383
|
+
if (n === 0 || n > this.sats.length) return false;
|
|
13384
|
+
this.sats[n - 1].lcorr = {
|
|
13385
|
+
iode: getBitU(msg, p + 6, 8),
|
|
13386
|
+
dpos: [
|
|
13387
|
+
getBitS(msg, p + 14, 9) * 0.125,
|
|
13388
|
+
getBitS(msg, p + 23, 9) * 0.125,
|
|
13389
|
+
getBitS(msg, p + 32, 9) * 0.125
|
|
13390
|
+
],
|
|
13391
|
+
dvel: [0, 0, 0],
|
|
13392
|
+
daf0: getBitS(msg, p + 41, 10) * P2_31,
|
|
13393
|
+
daf1: 0,
|
|
13394
|
+
t0s: gpsSeconds(week, tow)
|
|
13395
|
+
};
|
|
13396
|
+
return true;
|
|
13397
|
+
}
|
|
13398
|
+
decodeLong1(msg, p, week, tow) {
|
|
13399
|
+
const n = getBitU(msg, p, 6);
|
|
13400
|
+
if (n === 0 || n > this.sats.length) return false;
|
|
13401
|
+
let t = getBitU(msg, p + 90, 13) * 16 - tow % 86400;
|
|
13402
|
+
if (t <= -43200) t += 86400;
|
|
13403
|
+
else if (t > 43200) t -= 86400;
|
|
13404
|
+
this.sats[n - 1].lcorr = {
|
|
13405
|
+
iode: getBitU(msg, p + 6, 8),
|
|
13406
|
+
dpos: [
|
|
13407
|
+
getBitS(msg, p + 14, 11) * 0.125,
|
|
13408
|
+
getBitS(msg, p + 25, 11) * 0.125,
|
|
13409
|
+
getBitS(msg, p + 36, 11) * 0.125
|
|
13410
|
+
],
|
|
13411
|
+
dvel: [
|
|
13412
|
+
getBitS(msg, p + 58, 8) * P2_11,
|
|
13413
|
+
getBitS(msg, p + 66, 8) * P2_11,
|
|
13414
|
+
getBitS(msg, p + 74, 8) * P2_11
|
|
13415
|
+
],
|
|
13416
|
+
daf0: getBitS(msg, p + 47, 11) * P2_31,
|
|
13417
|
+
daf1: getBitS(msg, p + 82, 8) * P2_39,
|
|
13418
|
+
t0s: gpsSeconds(week, tow + t)
|
|
13419
|
+
};
|
|
13420
|
+
return true;
|
|
13421
|
+
}
|
|
13422
|
+
decodeIgpMask(msg) {
|
|
13423
|
+
const band = getBitU(msg, 18, 4);
|
|
13424
|
+
let p;
|
|
13425
|
+
let m;
|
|
13426
|
+
if (band <= 8) {
|
|
13427
|
+
p = igpband1[band];
|
|
13428
|
+
m = 8;
|
|
13429
|
+
} else if (band <= 10) {
|
|
13430
|
+
p = igpband2[band - 9];
|
|
13431
|
+
m = 5;
|
|
13432
|
+
} else return false;
|
|
13433
|
+
const igp = [];
|
|
13434
|
+
for (let i = 1; i <= 201; i++) {
|
|
13435
|
+
if (!getBitU(msg, 23 + i, 1)) continue;
|
|
13436
|
+
for (let j = 0; j < m; j++) {
|
|
13437
|
+
const b = p[j];
|
|
13438
|
+
if (i < b.bits || b.bite < i) continue;
|
|
13439
|
+
const varying = b.arr[i - b.bits];
|
|
13440
|
+
igp.push({
|
|
13441
|
+
lat: band <= 8 ? varying : b.coord,
|
|
13442
|
+
lon: band <= 8 ? b.coord : varying,
|
|
13443
|
+
delay: 0,
|
|
13444
|
+
give: 0,
|
|
13445
|
+
t0s: 0
|
|
13446
|
+
});
|
|
13447
|
+
break;
|
|
13448
|
+
}
|
|
13449
|
+
}
|
|
13450
|
+
this.ion[band] = { iodi: getBitU(msg, 22, 2), igp };
|
|
13451
|
+
return true;
|
|
13452
|
+
}
|
|
13453
|
+
decodeIgpDelay(msg, week, tow) {
|
|
13454
|
+
const band = getBitU(msg, 14, 4);
|
|
13455
|
+
const b = this.ion[band];
|
|
13456
|
+
if (band > MAXBAND || !b || b.iodi !== getBitU(msg, 217, 2)) return false;
|
|
13457
|
+
const block = getBitU(msg, 18, 4);
|
|
13458
|
+
const t0s = gpsSeconds(week, tow);
|
|
13459
|
+
for (let i = 0; i < 15; i++) {
|
|
13460
|
+
const j = block * 15 + i;
|
|
13461
|
+
if (j >= b.igp.length) continue;
|
|
13462
|
+
const give = getBitU(msg, 22 + i * 13 + 9, 4);
|
|
13463
|
+
const delay = getBitU(msg, 22 + i * 13, 9);
|
|
13464
|
+
b.igp[j].delay = delay === 511 ? 0 : delay * 0.125;
|
|
13465
|
+
b.igp[j].give = give + 1 >= 16 ? 0 : give + 1;
|
|
13466
|
+
b.igp[j].t0s = t0s;
|
|
13467
|
+
}
|
|
13468
|
+
return true;
|
|
13469
|
+
}
|
|
13470
|
+
/** PRNs currently in the correction mask (in mask order). */
|
|
13471
|
+
activeSats() {
|
|
13472
|
+
return this.sats.map((s) => s.prn).filter((p) => !!p);
|
|
13473
|
+
}
|
|
13474
|
+
/** Number of ionospheric grid points with a valid delay across all bands. */
|
|
13475
|
+
ionoGridPoints() {
|
|
13476
|
+
let n = 0;
|
|
13477
|
+
for (const b of this.ion) if (b) {
|
|
13478
|
+
for (const g of b.igp) if (g.give > 0) n++;
|
|
13479
|
+
}
|
|
13480
|
+
return n;
|
|
13481
|
+
}
|
|
13482
|
+
/**
|
|
13483
|
+
* Satellite range/clock correction for a PRN at a GPS week/tow, or null if
|
|
13484
|
+
* no valid (unexpired) long-term + fast correction is available. Add `dPos`
|
|
13485
|
+
* to the satellite ECEF position and `dClkS` to its clock bias.
|
|
13486
|
+
*/
|
|
13487
|
+
satCorrection(prn, week, tow) {
|
|
13488
|
+
const idx = this.satIdx.get(prn);
|
|
13489
|
+
if (idx === void 0) return null;
|
|
13490
|
+
const s = this.sats[idx];
|
|
13491
|
+
const now = gpsSeconds(week, tow);
|
|
13492
|
+
const drs = [0, 0, 0];
|
|
13493
|
+
let dclk = 0;
|
|
13494
|
+
let iode = -1;
|
|
13495
|
+
if (s.lcorr && s.lcorr.t0s !== 0) {
|
|
13496
|
+
const t = now - s.lcorr.t0s;
|
|
13497
|
+
if (Math.abs(t) > MAXSBSAGEL) return null;
|
|
13498
|
+
for (let i = 0; i < 3; i++)
|
|
13499
|
+
drs[i] = s.lcorr.dpos[i] + s.lcorr.dvel[i] * t;
|
|
13500
|
+
dclk = s.lcorr.daf0 + s.lcorr.daf1 * t;
|
|
13501
|
+
iode = s.lcorr.iode;
|
|
13502
|
+
} else if (prn[0] !== "S") {
|
|
13503
|
+
return null;
|
|
13504
|
+
}
|
|
13505
|
+
if (!s.fcorr || s.fcorr.t0s === 0) return null;
|
|
13506
|
+
const tf = now - s.fcorr.t0s + this.tlat;
|
|
13507
|
+
if (Math.abs(tf) > MAXSBSAGEF || s.fcorr.udre >= 15) return null;
|
|
13508
|
+
const prc = s.fcorr.prc;
|
|
13509
|
+
const varM2 = varfcorr(s.fcorr.udre) + degfcorr(s.fcorr.ai) * tf * tf / 2;
|
|
13510
|
+
return { dPos: drs, dClkS: dclk + prc / C_LIGHT, prcM: prc, varM2, iode };
|
|
13511
|
+
}
|
|
13512
|
+
/**
|
|
13513
|
+
* Slant L1 ionospheric delay (m) at the pierce point for a receiver geodetic
|
|
13514
|
+
* position (lat/lon rad, height m) and a satellite az/el (rad), interpolated
|
|
13515
|
+
* from the SBAS grid — or null if the pierce point isn't covered. RTKLIB
|
|
13516
|
+
* `sbsioncorr`.
|
|
13517
|
+
*/
|
|
13518
|
+
ionoDelay(week, tow, latRad, lonRad, heightM, azRad, elRad) {
|
|
13519
|
+
if (heightM < -100 || elRad <= 0) return { delayM: 0, varM2: 0 };
|
|
13520
|
+
const { fp, latP, lonP } = ionppp(
|
|
13521
|
+
latRad,
|
|
13522
|
+
lonRad,
|
|
13523
|
+
azRad,
|
|
13524
|
+
elRad,
|
|
13525
|
+
6378.1363,
|
|
13526
|
+
350
|
|
13527
|
+
);
|
|
13528
|
+
const igp = this.searchIgp(latP, lonP);
|
|
13529
|
+
if (!igp) return null;
|
|
13530
|
+
const { pts, x, y } = igp;
|
|
13531
|
+
const w = [0, 0, 0, 0];
|
|
13532
|
+
if (pts[0] && pts[1] && pts[2] && pts[3]) {
|
|
13533
|
+
w[0] = (1 - x) * (1 - y);
|
|
13534
|
+
w[1] = (1 - x) * y;
|
|
13535
|
+
w[2] = x * (1 - y);
|
|
13536
|
+
w[3] = x * y;
|
|
13537
|
+
} else if (pts[0] && pts[1] && pts[2]) {
|
|
13538
|
+
w[1] = y;
|
|
13539
|
+
w[2] = x;
|
|
13540
|
+
w[0] = 1 - w[1] - w[2];
|
|
13541
|
+
if (w[0] < 0) return null;
|
|
13542
|
+
} else if (pts[0] && pts[2] && pts[3]) {
|
|
13543
|
+
w[0] = 1 - x;
|
|
13544
|
+
w[3] = y;
|
|
13545
|
+
w[2] = 1 - w[0] - w[3];
|
|
13546
|
+
if (w[2] < 0) return null;
|
|
13547
|
+
} else if (pts[0] && pts[1] && pts[3]) {
|
|
13548
|
+
w[0] = 1 - y;
|
|
13549
|
+
w[3] = x;
|
|
13550
|
+
w[1] = 1 - w[0] - w[3];
|
|
13551
|
+
if (w[1] < 0) return null;
|
|
13552
|
+
} else if (pts[1] && pts[2] && pts[3]) {
|
|
13553
|
+
w[1] = 1 - x;
|
|
13554
|
+
w[2] = 1 - y;
|
|
13555
|
+
w[3] = 1 - w[1] - w[2];
|
|
13556
|
+
if (w[3] < 0) return null;
|
|
13557
|
+
} else return null;
|
|
13558
|
+
const now = gpsSeconds(week, tow);
|
|
13559
|
+
let delay = 0;
|
|
13560
|
+
let varM2 = 0;
|
|
13561
|
+
for (let i = 0; i < 4; i++) {
|
|
13562
|
+
const g = pts[i];
|
|
13563
|
+
if (!g) continue;
|
|
13564
|
+
delay += w[i] * g.delay;
|
|
13565
|
+
varM2 += w[i] * varicorr(g.give) * 9e-8 * Math.abs(now - g.t0s);
|
|
13566
|
+
}
|
|
13567
|
+
return { delayM: delay * fp, varM2: varM2 * fp * fp };
|
|
13568
|
+
}
|
|
13569
|
+
/** Find the four IGPs bracketing a pierce point (RTKLIB `searchigp`). */
|
|
13570
|
+
searchIgp(latP, lonP) {
|
|
13571
|
+
const lat = latP * R2D;
|
|
13572
|
+
let lon = lonP * R2D;
|
|
13573
|
+
if (lon >= 180) lon -= 360;
|
|
13574
|
+
const latp = [0, 0];
|
|
13575
|
+
const lonp = [0, 0, 0, 0];
|
|
13576
|
+
let x;
|
|
13577
|
+
let y;
|
|
13578
|
+
if (lat >= -55 && lat < 55) {
|
|
13579
|
+
latp[0] = Math.floor(lat / 5) * 5;
|
|
13580
|
+
latp[1] = latp[0] + 5;
|
|
13581
|
+
lonp[0] = lonp[1] = Math.floor(lon / 5) * 5;
|
|
13582
|
+
lonp[2] = lonp[3] = lonp[0] + 5;
|
|
13583
|
+
x = (lon - lonp[0]) / 5;
|
|
13584
|
+
y = (lat - latp[0]) / 5;
|
|
13585
|
+
} else {
|
|
13586
|
+
latp[0] = Math.floor((lat - 5) / 10) * 10 + 5;
|
|
13587
|
+
latp[1] = latp[0] + 10;
|
|
13588
|
+
lonp[0] = lonp[1] = Math.floor(lon / 10) * 10;
|
|
13589
|
+
lonp[2] = lonp[3] = lonp[0] + 10;
|
|
13590
|
+
x = (lon - lonp[0]) / 10;
|
|
13591
|
+
y = (lat - latp[0]) / 10;
|
|
13592
|
+
if (lat >= 75 && lat < 85) {
|
|
13593
|
+
lonp[1] = Math.floor(lon / 90) * 90;
|
|
13594
|
+
lonp[3] = lonp[1] + 90;
|
|
13595
|
+
} else if (lat >= -85 && lat < -75) {
|
|
13596
|
+
lonp[0] = Math.floor((lon - 50) / 90) * 90 + 40;
|
|
13597
|
+
lonp[2] = lonp[0] + 90;
|
|
13598
|
+
} else if (lat >= 85) {
|
|
13599
|
+
for (let i = 0; i < 4; i++) lonp[i] = Math.floor(lon / 90) * 90;
|
|
13600
|
+
} else if (lat < -85) {
|
|
13601
|
+
for (let i = 0; i < 4; i++)
|
|
13602
|
+
lonp[i] = Math.floor((lon - 50) / 90) * 90 + 40;
|
|
13603
|
+
}
|
|
13604
|
+
}
|
|
13605
|
+
for (let i = 0; i < 4; i++) if (lonp[i] === 180) lonp[i] = -180;
|
|
13606
|
+
const pts = [null, null, null, null];
|
|
13607
|
+
for (const band of this.ion) {
|
|
13608
|
+
if (!band) continue;
|
|
13609
|
+
for (const g of band.igp) {
|
|
13610
|
+
if (g.t0s === 0 || g.give <= 0) continue;
|
|
13611
|
+
if (g.lat === latp[0] && g.lon === lonp[0]) pts[0] = g;
|
|
13612
|
+
else if (g.lat === latp[1] && g.lon === lonp[1]) pts[1] = g;
|
|
13613
|
+
else if (g.lat === latp[0] && g.lon === lonp[2]) pts[2] = g;
|
|
13614
|
+
else if (g.lat === latp[1] && g.lon === lonp[3]) pts[3] = g;
|
|
13615
|
+
}
|
|
13616
|
+
}
|
|
13617
|
+
if (!pts[0] && !pts[1] && !pts[2] && !pts[3]) return null;
|
|
13618
|
+
return { pts, x, y };
|
|
13619
|
+
}
|
|
13620
|
+
};
|
|
13621
|
+
|
|
13134
13622
|
// src/positioning/ppp-tropo.ts
|
|
13135
13623
|
var HYD_AVG_A = [
|
|
13136
13624
|
0.0012769934,
|
|
@@ -14524,7 +15012,7 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
|
|
|
14524
15012
|
const systems = [...new Set(prns.map((p) => p[0]))].sort();
|
|
14525
15013
|
const dim = 3 + systems.length;
|
|
14526
15014
|
const sysIndex = new Map(systems.map((s, i) => [s, 3 + i]));
|
|
14527
|
-
let
|
|
15015
|
+
let x9 = 0;
|
|
14528
15016
|
let y2 = 0;
|
|
14529
15017
|
let z2 = 0;
|
|
14530
15018
|
const clock2 = new Map(systems.map((s) => [s, 0]));
|
|
@@ -14539,9 +15027,10 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
|
|
|
14539
15027
|
);
|
|
14540
15028
|
const Htv = new Array(dim).fill(0);
|
|
14541
15029
|
let rows = 0;
|
|
15030
|
+
const sysRows = new Map(systems.map((s) => [s, 0]));
|
|
14542
15031
|
for (const k of Object.keys(residuals2)) delete residuals2[k];
|
|
14543
|
-
const positionSaneIter =
|
|
14544
|
-
const [rxLat, rxLon, rxHgt] = positionSaneIter ? ecefToGeodetic(
|
|
15032
|
+
const positionSaneIter = x9 * x9 + y2 * y2 + z2 * z2 > 1e12;
|
|
15033
|
+
const [rxLat, rxLon, rxHgt] = positionSaneIter ? ecefToGeodetic(x9, y2, z2) : [0, 0, 0];
|
|
14545
15034
|
for (const prn of prns) {
|
|
14546
15035
|
const psr = pseudoranges.get(prn);
|
|
14547
15036
|
const eph = ephemerides.get(prn);
|
|
@@ -14553,10 +15042,10 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
|
|
|
14553
15042
|
if (!Number.isFinite(sat.x)) continue;
|
|
14554
15043
|
const isKepler3 = eph.system !== "R" && eph.system !== "S";
|
|
14555
15044
|
const dts = dtsClock - (tgd && isKepler3 ? eph.tgd : 0);
|
|
14556
|
-
const travel = Math.hypot(sat.x -
|
|
15045
|
+
const travel = Math.hypot(sat.x - x9, sat.y - y2, sat.z - z2) / C_LIGHT;
|
|
14557
15046
|
const [sx, sy, sz] = sagnac2(sat, travel);
|
|
14558
|
-
const rho = Math.hypot(sx -
|
|
14559
|
-
const ux = (
|
|
15047
|
+
const rho = Math.hypot(sx - x9, sy - y2, sz - z2);
|
|
15048
|
+
const ux = (x9 - sx) / rho;
|
|
14560
15049
|
const uy = (y2 - sy) / rho;
|
|
14561
15050
|
const uz = (z2 - sz) / rho;
|
|
14562
15051
|
let elev = Math.PI / 2;
|
|
@@ -14564,7 +15053,7 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
|
|
|
14564
15053
|
let weight = 1;
|
|
14565
15054
|
const positionSane = positionSaneIter;
|
|
14566
15055
|
if (positionSane) {
|
|
14567
|
-
const azel = ecefToAzEl(
|
|
15056
|
+
const azel = ecefToAzEl(x9, y2, z2, sx, sy, sz);
|
|
14568
15057
|
elev = azel.el;
|
|
14569
15058
|
azim = azel.az;
|
|
14570
15059
|
if (iter >= 2 && elev < elevationMaskDeg * Math.PI / 180) continue;
|
|
@@ -14598,11 +15087,22 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
|
|
|
14598
15087
|
}
|
|
14599
15088
|
residuals2[prn] = v;
|
|
14600
15089
|
rows++;
|
|
15090
|
+
sysRows.set(sys, sysRows.get(sys) + 1);
|
|
15091
|
+
}
|
|
15092
|
+
let activeSystems = 0;
|
|
15093
|
+
for (const s of systems) {
|
|
15094
|
+
if (sysRows.get(s) === 0) {
|
|
15095
|
+
const idx = sysIndex.get(s);
|
|
15096
|
+
HtH[idx][idx] = 1;
|
|
15097
|
+
Htv[idx] = 0;
|
|
15098
|
+
} else {
|
|
15099
|
+
activeSystems++;
|
|
15100
|
+
}
|
|
14601
15101
|
}
|
|
14602
|
-
if (rows <
|
|
15102
|
+
if (rows < 3 + activeSystems) return null;
|
|
14603
15103
|
const dx = solveLinear(HtH, Htv);
|
|
14604
15104
|
if (!dx) return null;
|
|
14605
|
-
|
|
15105
|
+
x9 += dx[0];
|
|
14606
15106
|
y2 += dx[1];
|
|
14607
15107
|
z2 += dx[2];
|
|
14608
15108
|
for (const s of systems)
|
|
@@ -14612,7 +15112,7 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
|
|
|
14612
15112
|
break;
|
|
14613
15113
|
}
|
|
14614
15114
|
}
|
|
14615
|
-
return { x:
|
|
15115
|
+
return { x: x9, y: y2, z: z2, clock: clock2, residuals: residuals2, iterations: iterations2, converged: converged2 };
|
|
14616
15116
|
};
|
|
14617
15117
|
const REJECT_THRESHOLD_M = 50;
|
|
14618
15118
|
let candidates = all;
|
|
@@ -17003,6 +17503,7 @@ function computePsdDb(centerMHz, halfSpanChips, numPoints, psdFn, f0 = 1023e3, f
|
|
|
17003
17503
|
SYSTEM_NAMES,
|
|
17004
17504
|
SYSTEM_ORDER,
|
|
17005
17505
|
SYS_SHORT,
|
|
17506
|
+
SbasProcessor,
|
|
17006
17507
|
Scale,
|
|
17007
17508
|
WGS84_ECCENTRICITY_SQUARED,
|
|
17008
17509
|
WGS84_FLATTENING,
|
package/dist/index.d.cts
CHANGED
|
@@ -17,7 +17,7 @@ export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, Trimb
|
|
|
17
17
|
export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.cjs';
|
|
18
18
|
export { AllPositionsData, AlmanacPosition, DopValues, EpochSkyData, SatAzEl, SatPoint, SatPosition, VisibilityPass, VisibilityResult, almanacEpochMs, almanacSatPosition, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassAlmanacEpochMs, glonassAlmanacPosition, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris } from './orbit.cjs';
|
|
19
19
|
export { Helmert14, REFERENCE_FRAMES, ReferenceFrame, applyHelmert, dateToEpoch, transformFrame } from './frames.cjs';
|
|
20
|
-
export { AntennaOffset, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkTrackPoint, SatGeom, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.cjs';
|
|
20
|
+
export { AntennaOffset, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkTrackPoint, SatGeom, SbasIonoDelay, SbasProcessor, SbasSatCorrection, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.cjs';
|
|
21
21
|
export { NtripCaster, NtripConnectionInfo, NtripNetwork, NtripStream, NtripStreamConnection, NtripVersion, Sourcetable, SourcetableEntry, connectToMountpoint, fetchSourcetable, parseSourcetable } from './ntrip.cjs';
|
|
22
22
|
export { CompleteSatSignal, CompleteSignalStats, CompletenessAccumulator, CompletenessResult, CycleSlipAccumulator, CycleSlipEvent, CycleSlipResult, CycleSlipSignalStats, IonoAccumulator, IonoDcbResult, IonoPoint, IonoRatePoint, IonoRateSeries, IonoResult, IonoSeries, MultipathAccumulator, MultipathPoint, MultipathResult, MultipathSeries, MultipathSignalStat, QualityResult, SatDcbMap, analyzeQuality, applyIonoDcb, computeIonoRate, detrendIonoArcs, parseSinexBiasDcb } from './analysis.cjs';
|
|
23
23
|
export { AntennaEntry, AntexFile, FrequencyData, frequencyLabel, parseAntex } from './antex.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, Trimb
|
|
|
17
17
|
export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.js';
|
|
18
18
|
export { AllPositionsData, AlmanacPosition, DopValues, EpochSkyData, SatAzEl, SatPoint, SatPosition, VisibilityPass, VisibilityResult, almanacEpochMs, almanacSatPosition, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassAlmanacEpochMs, glonassAlmanacPosition, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris } from './orbit.js';
|
|
19
19
|
export { Helmert14, REFERENCE_FRAMES, ReferenceFrame, applyHelmert, dateToEpoch, transformFrame } from './frames.js';
|
|
20
|
-
export { AntennaOffset, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkTrackPoint, SatGeom, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.js';
|
|
20
|
+
export { AntennaOffset, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkTrackPoint, SatGeom, SbasIonoDelay, SbasProcessor, SbasSatCorrection, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.js';
|
|
21
21
|
export { NtripCaster, NtripConnectionInfo, NtripNetwork, NtripStream, NtripStreamConnection, NtripVersion, Sourcetable, SourcetableEntry, connectToMountpoint, fetchSourcetable, parseSourcetable } from './ntrip.js';
|
|
22
22
|
export { CompleteSatSignal, CompleteSignalStats, CompletenessAccumulator, CompletenessResult, CycleSlipAccumulator, CycleSlipEvent, CycleSlipResult, CycleSlipSignalStats, IonoAccumulator, IonoDcbResult, IonoPoint, IonoRatePoint, IonoRateSeries, IonoResult, IonoSeries, MultipathAccumulator, MultipathPoint, MultipathResult, MultipathSeries, MultipathSignalStat, QualityResult, SatDcbMap, analyzeQuality, applyIonoDcb, computeIonoRate, detrendIonoArcs, parseSinexBiasDcb } from './analysis.js';
|
|
23
23
|
export { AntennaEntry, AntexFile, FrequencyData, frequencyLabel, parseAntex } from './antex.js';
|