gnss-js 2.5.0 → 2.6.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-B2XWO4RP.js → chunk-BWLLHLLS.js} +158 -0
- package/dist/index.cjs +161 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/positioning.cjs +180 -0
- package/dist/positioning.d.cts +56 -1
- package/dist/positioning.d.ts +56 -1
- package/dist/positioning.js +3 -1
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-V2D5KUKH.js";
|
|
23
23
|
import {
|
|
24
24
|
C_LIGHT,
|
|
25
|
+
FREQ,
|
|
25
26
|
OMEGA_E
|
|
26
27
|
} from "./chunk-FIEWO4J4.js";
|
|
27
28
|
|
|
@@ -1463,6 +1464,162 @@ function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
|
1463
1464
|
return { track, solved, unmatched, fixRate: solved ? fixed / solved : 0 };
|
|
1464
1465
|
}
|
|
1465
1466
|
|
|
1467
|
+
// src/positioning/zero-baseline.ts
|
|
1468
|
+
function carrierFreqHz2(sys, band, gloChannel) {
|
|
1469
|
+
if (sys === "R") {
|
|
1470
|
+
if (band === "1") return 1602e6 + (gloChannel ?? 0) * 562500;
|
|
1471
|
+
if (band === "2") return 1246e6 + (gloChannel ?? 0) * 437500;
|
|
1472
|
+
return FREQ.R?.[band] ?? 0;
|
|
1473
|
+
}
|
|
1474
|
+
return FREQ[sys]?.[band] ?? 0;
|
|
1475
|
+
}
|
|
1476
|
+
function median(a) {
|
|
1477
|
+
if (a.length === 0) return 0;
|
|
1478
|
+
const s = [...a].sort((x, y) => x - y);
|
|
1479
|
+
const m = s.length >> 1;
|
|
1480
|
+
return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
|
|
1481
|
+
}
|
|
1482
|
+
var ZeroBaselineEngine = class {
|
|
1483
|
+
ref;
|
|
1484
|
+
refSys;
|
|
1485
|
+
slip;
|
|
1486
|
+
/** Per (receiver|prn|code) continuous phase-SD arc. */
|
|
1487
|
+
arcs = /* @__PURE__ */ new Map();
|
|
1488
|
+
/** Per receiver: integrated phase-smoothed clock (m). */
|
|
1489
|
+
phaseClock = /* @__PURE__ */ new Map();
|
|
1490
|
+
/** Per (receiver|system): accumulated ISB (m) + count. */
|
|
1491
|
+
isb = /* @__PURE__ */ new Map();
|
|
1492
|
+
constructor(opts) {
|
|
1493
|
+
this.ref = opts.reference;
|
|
1494
|
+
this.refSys = opts.referenceSystem ?? "G";
|
|
1495
|
+
this.slip = opts.slipThreshM ?? 0.05;
|
|
1496
|
+
}
|
|
1497
|
+
reset() {
|
|
1498
|
+
this.arcs.clear();
|
|
1499
|
+
this.phaseClock.clear();
|
|
1500
|
+
this.isb.clear();
|
|
1501
|
+
}
|
|
1502
|
+
/** ISB/IFB estimates accumulated so far, per receiver × system. */
|
|
1503
|
+
biases() {
|
|
1504
|
+
const out = [];
|
|
1505
|
+
for (const [key, { sum, n }] of this.isb) {
|
|
1506
|
+
const [receiver, system] = key.split("|");
|
|
1507
|
+
out.push({ receiver, system, biasM: sum / n, n });
|
|
1508
|
+
}
|
|
1509
|
+
return out;
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Ingest one time-aligned instant: observations per receiver id. Returns one
|
|
1513
|
+
* {@link ReceiverClockSample} per non-reference receiver present this epoch.
|
|
1514
|
+
*/
|
|
1515
|
+
process(epoch) {
|
|
1516
|
+
const refObs = epoch.obs[this.ref];
|
|
1517
|
+
if (!refObs) return [];
|
|
1518
|
+
const refByKey = /* @__PURE__ */ new Map();
|
|
1519
|
+
for (const o of refObs)
|
|
1520
|
+
if (o.pr != null && Number.isFinite(o.pr))
|
|
1521
|
+
refByKey.set(`${o.prn}|${o.code}`, o);
|
|
1522
|
+
const out = [];
|
|
1523
|
+
for (const rx of Object.keys(epoch.obs)) {
|
|
1524
|
+
if (rx === this.ref) continue;
|
|
1525
|
+
out.push(
|
|
1526
|
+
this.processReceiver(rx, epoch.obs[rx], refByKey, epoch.timeMs)
|
|
1527
|
+
);
|
|
1528
|
+
}
|
|
1529
|
+
return out;
|
|
1530
|
+
}
|
|
1531
|
+
processReceiver(rx, obs, refByKey, t) {
|
|
1532
|
+
const codeBySys = /* @__PURE__ */ new Map();
|
|
1533
|
+
const phase = [];
|
|
1534
|
+
for (const o of obs) {
|
|
1535
|
+
if (o.pr == null || !Number.isFinite(o.pr)) continue;
|
|
1536
|
+
const r = refByKey.get(`${o.prn}|${o.code}`);
|
|
1537
|
+
if (!r || r.pr == null) continue;
|
|
1538
|
+
const sys = o.prn[0];
|
|
1539
|
+
(codeBySys.get(sys) ?? codeBySys.set(sys, []).get(sys)).push(
|
|
1540
|
+
o.pr - r.pr
|
|
1541
|
+
);
|
|
1542
|
+
if (o.cp != null && r.cp != null) {
|
|
1543
|
+
const f = carrierFreqHz2(
|
|
1544
|
+
sys,
|
|
1545
|
+
o.code[0],
|
|
1546
|
+
o.gloChannel ?? r.gloChannel ?? null
|
|
1547
|
+
);
|
|
1548
|
+
if (f > 0)
|
|
1549
|
+
phase.push({
|
|
1550
|
+
key: `${rx}|${o.prn}|${o.code}`,
|
|
1551
|
+
sdM: (o.cp - r.cp) * (C_LIGHT / f),
|
|
1552
|
+
lock: o.lockTimeS
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
if (codeBySys.size === 0)
|
|
1557
|
+
return {
|
|
1558
|
+
t,
|
|
1559
|
+
receiver: rx,
|
|
1560
|
+
clockOffsetM: null,
|
|
1561
|
+
clockOffsetPhaseM: this.phaseClock.get(rx) ?? null,
|
|
1562
|
+
used: 0,
|
|
1563
|
+
rejected: 0,
|
|
1564
|
+
residualRmsM: 0
|
|
1565
|
+
};
|
|
1566
|
+
const sysMedian = /* @__PURE__ */ new Map();
|
|
1567
|
+
for (const [sys, v] of codeBySys) sysMedian.set(sys, median(v));
|
|
1568
|
+
const allSd = [];
|
|
1569
|
+
for (const v of codeBySys.values()) allSd.push(...v);
|
|
1570
|
+
const clk = sysMedian.get(this.refSys) ?? median(allSd);
|
|
1571
|
+
for (const [sys, med] of sysMedian) {
|
|
1572
|
+
if (sys === this.refSys) continue;
|
|
1573
|
+
const cur = this.isb.get(`${rx}|${sys}`) ?? { sum: 0, n: 0 };
|
|
1574
|
+
cur.sum += med - clk;
|
|
1575
|
+
cur.n += 1;
|
|
1576
|
+
this.isb.set(`${rx}|${sys}`, cur);
|
|
1577
|
+
}
|
|
1578
|
+
let ss = 0, used = 0, rejected = 0;
|
|
1579
|
+
for (const [sys, v] of codeBySys) {
|
|
1580
|
+
const isb = sys === this.refSys ? 0 : sysMedian.get(sys) - clk;
|
|
1581
|
+
for (const sd of v) {
|
|
1582
|
+
const res = sd - clk - isb;
|
|
1583
|
+
if (Math.abs(res) > 5) {
|
|
1584
|
+
rejected++;
|
|
1585
|
+
continue;
|
|
1586
|
+
}
|
|
1587
|
+
ss += res * res;
|
|
1588
|
+
used++;
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
const residualRmsM = used ? Math.sqrt(ss / used) : 0;
|
|
1592
|
+
const deltas = [];
|
|
1593
|
+
for (const p of phase) {
|
|
1594
|
+
const arc = this.arcs.get(p.key);
|
|
1595
|
+
this.arcs.set(p.key, { lastPhaseSdM: p.sdM, lastLock: p.lock });
|
|
1596
|
+
if (!arc) continue;
|
|
1597
|
+
const lockReset = p.lock != null && arc.lastLock != null && p.lock < arc.lastLock;
|
|
1598
|
+
if (lockReset) continue;
|
|
1599
|
+
deltas.push(p.sdM - arc.lastPhaseSdM);
|
|
1600
|
+
}
|
|
1601
|
+
let phaseClockM = this.phaseClock.get(rx) ?? null;
|
|
1602
|
+
if (phaseClockM == null) {
|
|
1603
|
+
phaseClockM = clk;
|
|
1604
|
+
} else if (deltas.length) {
|
|
1605
|
+
const md = median(deltas);
|
|
1606
|
+
const good = deltas.filter((d) => Math.abs(d - md) < this.slip);
|
|
1607
|
+
const step = good.length ? good.reduce((a, b) => a + b, 0) / good.length : md;
|
|
1608
|
+
phaseClockM += step;
|
|
1609
|
+
}
|
|
1610
|
+
this.phaseClock.set(rx, phaseClockM);
|
|
1611
|
+
return {
|
|
1612
|
+
t,
|
|
1613
|
+
receiver: rx,
|
|
1614
|
+
clockOffsetM: clk,
|
|
1615
|
+
clockOffsetPhaseM: phaseClockM,
|
|
1616
|
+
used,
|
|
1617
|
+
rejected,
|
|
1618
|
+
residualRmsM
|
|
1619
|
+
};
|
|
1620
|
+
}
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1466
1623
|
// src/positioning/sbas.ts
|
|
1467
1624
|
var P2_11 = 2 ** -11;
|
|
1468
1625
|
var P2_31 = 2 ** -31;
|
|
@@ -3874,6 +4031,7 @@ export {
|
|
|
3874
4031
|
solveDgnss,
|
|
3875
4032
|
RtkFloatEngine,
|
|
3876
4033
|
postProcessRtk,
|
|
4034
|
+
ZeroBaselineEngine,
|
|
3877
4035
|
sbasLongTermDeg,
|
|
3878
4036
|
sbasIonoDeg,
|
|
3879
4037
|
SbasProcessor,
|
package/dist/index.cjs
CHANGED
|
@@ -113,6 +113,7 @@ __export(src_exports, {
|
|
|
113
113
|
WGS84_SEMI_MAJOR_AXIS: () => WGS84_SEMI_MAJOR_AXIS,
|
|
114
114
|
WGS84_SEMI_MINOR_AXIS: () => WGS84_SEMI_MINOR_AXIS,
|
|
115
115
|
WarningAccumulator: () => WarningAccumulator,
|
|
116
|
+
ZeroBaselineEngine: () => ZeroBaselineEngine,
|
|
116
117
|
almanacEpochMs: () => almanacEpochMs,
|
|
117
118
|
almanacSatPosition: () => almanacSatPosition,
|
|
118
119
|
analyzeQuality: () => analyzeQuality,
|
|
@@ -14636,6 +14637,162 @@ function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
|
14636
14637
|
return { track, solved, unmatched, fixRate: solved ? fixed / solved : 0 };
|
|
14637
14638
|
}
|
|
14638
14639
|
|
|
14640
|
+
// src/positioning/zero-baseline.ts
|
|
14641
|
+
function carrierFreqHz2(sys, band, gloChannel) {
|
|
14642
|
+
if (sys === "R") {
|
|
14643
|
+
if (band === "1") return 1602e6 + (gloChannel ?? 0) * 562500;
|
|
14644
|
+
if (band === "2") return 1246e6 + (gloChannel ?? 0) * 437500;
|
|
14645
|
+
return FREQ.R?.[band] ?? 0;
|
|
14646
|
+
}
|
|
14647
|
+
return FREQ[sys]?.[band] ?? 0;
|
|
14648
|
+
}
|
|
14649
|
+
function median(a) {
|
|
14650
|
+
if (a.length === 0) return 0;
|
|
14651
|
+
const s = [...a].sort((x, y) => x - y);
|
|
14652
|
+
const m = s.length >> 1;
|
|
14653
|
+
return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
|
|
14654
|
+
}
|
|
14655
|
+
var ZeroBaselineEngine = class {
|
|
14656
|
+
ref;
|
|
14657
|
+
refSys;
|
|
14658
|
+
slip;
|
|
14659
|
+
/** Per (receiver|prn|code) continuous phase-SD arc. */
|
|
14660
|
+
arcs = /* @__PURE__ */ new Map();
|
|
14661
|
+
/** Per receiver: integrated phase-smoothed clock (m). */
|
|
14662
|
+
phaseClock = /* @__PURE__ */ new Map();
|
|
14663
|
+
/** Per (receiver|system): accumulated ISB (m) + count. */
|
|
14664
|
+
isb = /* @__PURE__ */ new Map();
|
|
14665
|
+
constructor(opts) {
|
|
14666
|
+
this.ref = opts.reference;
|
|
14667
|
+
this.refSys = opts.referenceSystem ?? "G";
|
|
14668
|
+
this.slip = opts.slipThreshM ?? 0.05;
|
|
14669
|
+
}
|
|
14670
|
+
reset() {
|
|
14671
|
+
this.arcs.clear();
|
|
14672
|
+
this.phaseClock.clear();
|
|
14673
|
+
this.isb.clear();
|
|
14674
|
+
}
|
|
14675
|
+
/** ISB/IFB estimates accumulated so far, per receiver × system. */
|
|
14676
|
+
biases() {
|
|
14677
|
+
const out = [];
|
|
14678
|
+
for (const [key, { sum, n }] of this.isb) {
|
|
14679
|
+
const [receiver, system] = key.split("|");
|
|
14680
|
+
out.push({ receiver, system, biasM: sum / n, n });
|
|
14681
|
+
}
|
|
14682
|
+
return out;
|
|
14683
|
+
}
|
|
14684
|
+
/**
|
|
14685
|
+
* Ingest one time-aligned instant: observations per receiver id. Returns one
|
|
14686
|
+
* {@link ReceiverClockSample} per non-reference receiver present this epoch.
|
|
14687
|
+
*/
|
|
14688
|
+
process(epoch) {
|
|
14689
|
+
const refObs = epoch.obs[this.ref];
|
|
14690
|
+
if (!refObs) return [];
|
|
14691
|
+
const refByKey = /* @__PURE__ */ new Map();
|
|
14692
|
+
for (const o of refObs)
|
|
14693
|
+
if (o.pr != null && Number.isFinite(o.pr))
|
|
14694
|
+
refByKey.set(`${o.prn}|${o.code}`, o);
|
|
14695
|
+
const out = [];
|
|
14696
|
+
for (const rx of Object.keys(epoch.obs)) {
|
|
14697
|
+
if (rx === this.ref) continue;
|
|
14698
|
+
out.push(
|
|
14699
|
+
this.processReceiver(rx, epoch.obs[rx], refByKey, epoch.timeMs)
|
|
14700
|
+
);
|
|
14701
|
+
}
|
|
14702
|
+
return out;
|
|
14703
|
+
}
|
|
14704
|
+
processReceiver(rx, obs, refByKey, t) {
|
|
14705
|
+
const codeBySys = /* @__PURE__ */ new Map();
|
|
14706
|
+
const phase = [];
|
|
14707
|
+
for (const o of obs) {
|
|
14708
|
+
if (o.pr == null || !Number.isFinite(o.pr)) continue;
|
|
14709
|
+
const r = refByKey.get(`${o.prn}|${o.code}`);
|
|
14710
|
+
if (!r || r.pr == null) continue;
|
|
14711
|
+
const sys = o.prn[0];
|
|
14712
|
+
(codeBySys.get(sys) ?? codeBySys.set(sys, []).get(sys)).push(
|
|
14713
|
+
o.pr - r.pr
|
|
14714
|
+
);
|
|
14715
|
+
if (o.cp != null && r.cp != null) {
|
|
14716
|
+
const f = carrierFreqHz2(
|
|
14717
|
+
sys,
|
|
14718
|
+
o.code[0],
|
|
14719
|
+
o.gloChannel ?? r.gloChannel ?? null
|
|
14720
|
+
);
|
|
14721
|
+
if (f > 0)
|
|
14722
|
+
phase.push({
|
|
14723
|
+
key: `${rx}|${o.prn}|${o.code}`,
|
|
14724
|
+
sdM: (o.cp - r.cp) * (C_LIGHT / f),
|
|
14725
|
+
lock: o.lockTimeS
|
|
14726
|
+
});
|
|
14727
|
+
}
|
|
14728
|
+
}
|
|
14729
|
+
if (codeBySys.size === 0)
|
|
14730
|
+
return {
|
|
14731
|
+
t,
|
|
14732
|
+
receiver: rx,
|
|
14733
|
+
clockOffsetM: null,
|
|
14734
|
+
clockOffsetPhaseM: this.phaseClock.get(rx) ?? null,
|
|
14735
|
+
used: 0,
|
|
14736
|
+
rejected: 0,
|
|
14737
|
+
residualRmsM: 0
|
|
14738
|
+
};
|
|
14739
|
+
const sysMedian = /* @__PURE__ */ new Map();
|
|
14740
|
+
for (const [sys, v] of codeBySys) sysMedian.set(sys, median(v));
|
|
14741
|
+
const allSd = [];
|
|
14742
|
+
for (const v of codeBySys.values()) allSd.push(...v);
|
|
14743
|
+
const clk = sysMedian.get(this.refSys) ?? median(allSd);
|
|
14744
|
+
for (const [sys, med] of sysMedian) {
|
|
14745
|
+
if (sys === this.refSys) continue;
|
|
14746
|
+
const cur = this.isb.get(`${rx}|${sys}`) ?? { sum: 0, n: 0 };
|
|
14747
|
+
cur.sum += med - clk;
|
|
14748
|
+
cur.n += 1;
|
|
14749
|
+
this.isb.set(`${rx}|${sys}`, cur);
|
|
14750
|
+
}
|
|
14751
|
+
let ss = 0, used = 0, rejected = 0;
|
|
14752
|
+
for (const [sys, v] of codeBySys) {
|
|
14753
|
+
const isb = sys === this.refSys ? 0 : sysMedian.get(sys) - clk;
|
|
14754
|
+
for (const sd2 of v) {
|
|
14755
|
+
const res = sd2 - clk - isb;
|
|
14756
|
+
if (Math.abs(res) > 5) {
|
|
14757
|
+
rejected++;
|
|
14758
|
+
continue;
|
|
14759
|
+
}
|
|
14760
|
+
ss += res * res;
|
|
14761
|
+
used++;
|
|
14762
|
+
}
|
|
14763
|
+
}
|
|
14764
|
+
const residualRmsM = used ? Math.sqrt(ss / used) : 0;
|
|
14765
|
+
const deltas = [];
|
|
14766
|
+
for (const p of phase) {
|
|
14767
|
+
const arc = this.arcs.get(p.key);
|
|
14768
|
+
this.arcs.set(p.key, { lastPhaseSdM: p.sdM, lastLock: p.lock });
|
|
14769
|
+
if (!arc) continue;
|
|
14770
|
+
const lockReset = p.lock != null && arc.lastLock != null && p.lock < arc.lastLock;
|
|
14771
|
+
if (lockReset) continue;
|
|
14772
|
+
deltas.push(p.sdM - arc.lastPhaseSdM);
|
|
14773
|
+
}
|
|
14774
|
+
let phaseClockM = this.phaseClock.get(rx) ?? null;
|
|
14775
|
+
if (phaseClockM == null) {
|
|
14776
|
+
phaseClockM = clk;
|
|
14777
|
+
} else if (deltas.length) {
|
|
14778
|
+
const md = median(deltas);
|
|
14779
|
+
const good = deltas.filter((d) => Math.abs(d - md) < this.slip);
|
|
14780
|
+
const step = good.length ? good.reduce((a, b) => a + b, 0) / good.length : md;
|
|
14781
|
+
phaseClockM += step;
|
|
14782
|
+
}
|
|
14783
|
+
this.phaseClock.set(rx, phaseClockM);
|
|
14784
|
+
return {
|
|
14785
|
+
t,
|
|
14786
|
+
receiver: rx,
|
|
14787
|
+
clockOffsetM: clk,
|
|
14788
|
+
clockOffsetPhaseM: phaseClockM,
|
|
14789
|
+
used,
|
|
14790
|
+
rejected,
|
|
14791
|
+
residualRmsM
|
|
14792
|
+
};
|
|
14793
|
+
}
|
|
14794
|
+
};
|
|
14795
|
+
|
|
14639
14796
|
// src/positioning/sbas.ts
|
|
14640
14797
|
var P2_11 = 2 ** -11;
|
|
14641
14798
|
var P2_31 = 2 ** -31;
|
|
@@ -17183,7 +17340,7 @@ async function connectToMountpoint(proxyUrl, info, signal) {
|
|
|
17183
17340
|
|
|
17184
17341
|
// src/analysis/stats-util.ts
|
|
17185
17342
|
var MIN_ARC_LENGTH = 10;
|
|
17186
|
-
function
|
|
17343
|
+
function median2(values) {
|
|
17187
17344
|
const s = [...values].sort((a, b) => a - b);
|
|
17188
17345
|
const m = s.length >> 1;
|
|
17189
17346
|
return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
|
|
@@ -17262,7 +17419,7 @@ var MultipathAccumulator = class {
|
|
|
17262
17419
|
this.closeArc(prn, band, refBand, bandState);
|
|
17263
17420
|
} else if (bandState.arc.rawMp.length > 0) {
|
|
17264
17421
|
const recent = bandState.arc.rawMp.slice(-MP_JUMP_WINDOW);
|
|
17265
|
-
if (Math.abs(mp -
|
|
17422
|
+
if (Math.abs(mp - median2(recent)) > MP_JUMP_M) {
|
|
17266
17423
|
this.closeArc(prn, band, refBand, bandState);
|
|
17267
17424
|
}
|
|
17268
17425
|
}
|
|
@@ -17783,7 +17940,7 @@ var IonoAccumulator = class {
|
|
|
17783
17940
|
closeArc(prn, pairKey, ps) {
|
|
17784
17941
|
const arc = ps.arc;
|
|
17785
17942
|
if (arc.times.length >= MIN_ARC_LENGTH) {
|
|
17786
|
-
const level =
|
|
17943
|
+
const level = median2(arc.l4.map((v, k) => v - arc.p4[k]));
|
|
17787
17944
|
const toTecu = arc.fi * arc.fi / TEC_FACTOR / (arc.gamma - 1);
|
|
17788
17945
|
let satArcs = this.closed.get(prn);
|
|
17789
17946
|
if (!satArcs) {
|
|
@@ -19387,6 +19544,7 @@ function computePsdDb(centerMHz, halfSpanChips, numPoints, psdFn, f0 = 1023e3, f
|
|
|
19387
19544
|
WGS84_SEMI_MAJOR_AXIS,
|
|
19388
19545
|
WGS84_SEMI_MINOR_AXIS,
|
|
19389
19546
|
WarningAccumulator,
|
|
19547
|
+
ZeroBaselineEngine,
|
|
19390
19548
|
almanacEpochMs,
|
|
19391
19549
|
almanacSatPosition,
|
|
19392
19550
|
analyzeQuality,
|
package/dist/index.d.cts
CHANGED
|
@@ -19,7 +19,7 @@ export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, Trimb
|
|
|
19
19
|
export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.cjs';
|
|
20
20
|
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';
|
|
21
21
|
export { Helmert14, REFERENCE_FRAMES, ReferenceFrame, applyHelmert, dateToEpoch, transformFrame } from './frames.cjs';
|
|
22
|
-
export { AntennaOffset, AppliedOrbitClock, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, Degradation, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, OrbitClockCorrection, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEngine, PppEphemerisSource, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, RtkAntennaConfig, RtkAntennaModel, RtkAntennaOffset, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkReceiverAntenna, RtkTrackPoint, SatGeom, SatSample, SbasCorrectionSource, SbasIgp, SbasIonoDelay, SbasProcessor, SbasSatCorrection, Sp3EphemerisSource, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, antexFreqOfGroup, applyOrbitClock, buildPppAntenna, buildRtkAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, hasToOrbitClock, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, rcvAntennaRangeM, resolvePppAmbiguities, satClockCorrection, sbasIonoDeg, sbasLongTermDeg, sbasProtectionLevels, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.cjs';
|
|
22
|
+
export { AntennaOffset, AppliedOrbitClock, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, Degradation, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, OrbitClockCorrection, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEngine, PppEphemerisSource, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, ReceiverBias, ReceiverClockSample, RtkAntennaConfig, RtkAntennaModel, RtkAntennaOffset, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkReceiverAntenna, RtkTrackPoint, SatGeom, SatSample, SbasCorrectionSource, SbasIgp, SbasIonoDelay, SbasProcessor, SbasSatCorrection, Sp3EphemerisSource, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, ZeroBaselineEngine, ZeroBaselineOptions, antexFreqOfGroup, applyOrbitClock, buildPppAntenna, buildRtkAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, hasToOrbitClock, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, rcvAntennaRangeM, resolvePppAmbiguities, satClockCorrection, sbasIonoDeg, sbasLongTermDeg, sbasProtectionLevels, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.cjs';
|
|
23
23
|
export { NtripCaster, NtripConnectionInfo, NtripNetwork, NtripStream, NtripStreamConnection, NtripVersion, Sourcetable, SourcetableEntry, connectToMountpoint, fetchSourcetable, parseSourcetable } from './ntrip.cjs';
|
|
24
24
|
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';
|
|
25
25
|
export { AntennaEntry, AntexFile, FrequencyData, frequencyLabel, parseAntex } from './antex.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, Trimb
|
|
|
19
19
|
export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.js';
|
|
20
20
|
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';
|
|
21
21
|
export { Helmert14, REFERENCE_FRAMES, ReferenceFrame, applyHelmert, dateToEpoch, transformFrame } from './frames.js';
|
|
22
|
-
export { AntennaOffset, AppliedOrbitClock, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, Degradation, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, OrbitClockCorrection, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEngine, PppEphemerisSource, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, RtkAntennaConfig, RtkAntennaModel, RtkAntennaOffset, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkReceiverAntenna, RtkTrackPoint, SatGeom, SatSample, SbasCorrectionSource, SbasIgp, SbasIonoDelay, SbasProcessor, SbasSatCorrection, Sp3EphemerisSource, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, antexFreqOfGroup, applyOrbitClock, buildPppAntenna, buildRtkAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, hasToOrbitClock, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, rcvAntennaRangeM, resolvePppAmbiguities, satClockCorrection, sbasIonoDeg, sbasLongTermDeg, sbasProtectionLevels, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.js';
|
|
22
|
+
export { AntennaOffset, AppliedOrbitClock, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, Degradation, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, OrbitClockCorrection, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEngine, PppEphemerisSource, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, ReceiverBias, ReceiverClockSample, RtkAntennaConfig, RtkAntennaModel, RtkAntennaOffset, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkReceiverAntenna, RtkTrackPoint, SatGeom, SatSample, SbasCorrectionSource, SbasIgp, SbasIonoDelay, SbasProcessor, SbasSatCorrection, Sp3EphemerisSource, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, ZeroBaselineEngine, ZeroBaselineOptions, antexFreqOfGroup, applyOrbitClock, buildPppAntenna, buildRtkAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, hasToOrbitClock, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, rcvAntennaRangeM, resolvePppAmbiguities, satClockCorrection, sbasIonoDeg, sbasLongTermDeg, sbasProtectionLevels, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.js';
|
|
23
23
|
export { NtripCaster, NtripConnectionInfo, NtripNetwork, NtripStream, NtripStreamConnection, NtripVersion, Sourcetable, SourcetableEntry, connectToMountpoint, fetchSourcetable, parseSourcetable } from './ntrip.js';
|
|
24
24
|
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';
|
|
25
25
|
export { AntennaEntry, AntexFile, FrequencyData, frequencyLabel, parseAntex } from './antex.js';
|
package/dist/index.js
CHANGED
|
@@ -177,6 +177,7 @@ import {
|
|
|
177
177
|
RtkFloatEngine,
|
|
178
178
|
SbasProcessor,
|
|
179
179
|
Sp3EphemerisSource,
|
|
180
|
+
ZeroBaselineEngine,
|
|
180
181
|
antexFreqOfGroup,
|
|
181
182
|
applyOrbitClock,
|
|
182
183
|
buildPppAntenna,
|
|
@@ -212,7 +213,7 @@ import {
|
|
|
212
213
|
sunEcef,
|
|
213
214
|
toRtkEpoch,
|
|
214
215
|
wlWavelength
|
|
215
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-BWLLHLLS.js";
|
|
216
217
|
import "./chunk-WQX354KD.js";
|
|
217
218
|
import {
|
|
218
219
|
almanacEpochMs,
|
|
@@ -489,6 +490,7 @@ export {
|
|
|
489
490
|
WGS84_SEMI_MAJOR_AXIS,
|
|
490
491
|
WGS84_SEMI_MINOR_AXIS,
|
|
491
492
|
WarningAccumulator,
|
|
493
|
+
ZeroBaselineEngine,
|
|
492
494
|
almanacEpochMs,
|
|
493
495
|
almanacSatPosition,
|
|
494
496
|
analyzeQuality,
|
package/dist/positioning.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(positioning_exports, {
|
|
|
25
25
|
RtkFloatEngine: () => RtkFloatEngine,
|
|
26
26
|
SbasProcessor: () => SbasProcessor,
|
|
27
27
|
Sp3EphemerisSource: () => Sp3EphemerisSource,
|
|
28
|
+
ZeroBaselineEngine: () => ZeroBaselineEngine,
|
|
28
29
|
antexFreqOfGroup: () => antexFreqOfGroup,
|
|
29
30
|
applyOrbitClock: () => applyOrbitClock,
|
|
30
31
|
buildPppAntenna: () => buildPppAntenna,
|
|
@@ -124,6 +125,28 @@ var START_NTP_TIME = /* @__PURE__ */ new Date("1900-01-01T00:00:00Z");
|
|
|
124
125
|
// src/constants/gnss.ts
|
|
125
126
|
var C_LIGHT = 299792458;
|
|
126
127
|
var OMEGA_E = 72921151467e-15;
|
|
128
|
+
var FREQ = {
|
|
129
|
+
G: { "1": 157542e4, "2": 12276e5, "5": 117645e4 },
|
|
130
|
+
// R bands 4/6 are the CDMA L1OC/L2OC center frequencies
|
|
131
|
+
R: { "3": 1202025e3, "4": 1600995e3, "6": 124806e4 },
|
|
132
|
+
E: {
|
|
133
|
+
"1": 157542e4,
|
|
134
|
+
"5": 117645e4,
|
|
135
|
+
"6": 127875e4,
|
|
136
|
+
"7": 120714e4,
|
|
137
|
+
"8": 1191795e3
|
|
138
|
+
},
|
|
139
|
+
C: {
|
|
140
|
+
"1": 157542e4,
|
|
141
|
+
"2": 1561098e3,
|
|
142
|
+
"5": 117645e4,
|
|
143
|
+
"6": 126852e4,
|
|
144
|
+
"7": 120714e4
|
|
145
|
+
},
|
|
146
|
+
J: { "1": 157542e4, "2": 12276e5, "5": 117645e4, "6": 127875e4 },
|
|
147
|
+
I: { "5": 117645e4, "9": 2492028e3 },
|
|
148
|
+
S: { "1": 157542e4, "5": 117645e4 }
|
|
149
|
+
};
|
|
127
150
|
|
|
128
151
|
// src/time/gnss.ts
|
|
129
152
|
function getTaiDate(date) {
|
|
@@ -1923,6 +1946,162 @@ function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
|
1923
1946
|
return { track, solved, unmatched, fixRate: solved ? fixed / solved : 0 };
|
|
1924
1947
|
}
|
|
1925
1948
|
|
|
1949
|
+
// src/positioning/zero-baseline.ts
|
|
1950
|
+
function carrierFreqHz2(sys, band, gloChannel) {
|
|
1951
|
+
if (sys === "R") {
|
|
1952
|
+
if (band === "1") return 1602e6 + (gloChannel ?? 0) * 562500;
|
|
1953
|
+
if (band === "2") return 1246e6 + (gloChannel ?? 0) * 437500;
|
|
1954
|
+
return FREQ.R?.[band] ?? 0;
|
|
1955
|
+
}
|
|
1956
|
+
return FREQ[sys]?.[band] ?? 0;
|
|
1957
|
+
}
|
|
1958
|
+
function median(a) {
|
|
1959
|
+
if (a.length === 0) return 0;
|
|
1960
|
+
const s = [...a].sort((x, y) => x - y);
|
|
1961
|
+
const m = s.length >> 1;
|
|
1962
|
+
return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
|
|
1963
|
+
}
|
|
1964
|
+
var ZeroBaselineEngine = class {
|
|
1965
|
+
ref;
|
|
1966
|
+
refSys;
|
|
1967
|
+
slip;
|
|
1968
|
+
/** Per (receiver|prn|code) continuous phase-SD arc. */
|
|
1969
|
+
arcs = /* @__PURE__ */ new Map();
|
|
1970
|
+
/** Per receiver: integrated phase-smoothed clock (m). */
|
|
1971
|
+
phaseClock = /* @__PURE__ */ new Map();
|
|
1972
|
+
/** Per (receiver|system): accumulated ISB (m) + count. */
|
|
1973
|
+
isb = /* @__PURE__ */ new Map();
|
|
1974
|
+
constructor(opts) {
|
|
1975
|
+
this.ref = opts.reference;
|
|
1976
|
+
this.refSys = opts.referenceSystem ?? "G";
|
|
1977
|
+
this.slip = opts.slipThreshM ?? 0.05;
|
|
1978
|
+
}
|
|
1979
|
+
reset() {
|
|
1980
|
+
this.arcs.clear();
|
|
1981
|
+
this.phaseClock.clear();
|
|
1982
|
+
this.isb.clear();
|
|
1983
|
+
}
|
|
1984
|
+
/** ISB/IFB estimates accumulated so far, per receiver × system. */
|
|
1985
|
+
biases() {
|
|
1986
|
+
const out = [];
|
|
1987
|
+
for (const [key, { sum, n }] of this.isb) {
|
|
1988
|
+
const [receiver, system] = key.split("|");
|
|
1989
|
+
out.push({ receiver, system, biasM: sum / n, n });
|
|
1990
|
+
}
|
|
1991
|
+
return out;
|
|
1992
|
+
}
|
|
1993
|
+
/**
|
|
1994
|
+
* Ingest one time-aligned instant: observations per receiver id. Returns one
|
|
1995
|
+
* {@link ReceiverClockSample} per non-reference receiver present this epoch.
|
|
1996
|
+
*/
|
|
1997
|
+
process(epoch) {
|
|
1998
|
+
const refObs = epoch.obs[this.ref];
|
|
1999
|
+
if (!refObs) return [];
|
|
2000
|
+
const refByKey = /* @__PURE__ */ new Map();
|
|
2001
|
+
for (const o of refObs)
|
|
2002
|
+
if (o.pr != null && Number.isFinite(o.pr))
|
|
2003
|
+
refByKey.set(`${o.prn}|${o.code}`, o);
|
|
2004
|
+
const out = [];
|
|
2005
|
+
for (const rx of Object.keys(epoch.obs)) {
|
|
2006
|
+
if (rx === this.ref) continue;
|
|
2007
|
+
out.push(
|
|
2008
|
+
this.processReceiver(rx, epoch.obs[rx], refByKey, epoch.timeMs)
|
|
2009
|
+
);
|
|
2010
|
+
}
|
|
2011
|
+
return out;
|
|
2012
|
+
}
|
|
2013
|
+
processReceiver(rx, obs, refByKey, t) {
|
|
2014
|
+
const codeBySys = /* @__PURE__ */ new Map();
|
|
2015
|
+
const phase = [];
|
|
2016
|
+
for (const o of obs) {
|
|
2017
|
+
if (o.pr == null || !Number.isFinite(o.pr)) continue;
|
|
2018
|
+
const r = refByKey.get(`${o.prn}|${o.code}`);
|
|
2019
|
+
if (!r || r.pr == null) continue;
|
|
2020
|
+
const sys = o.prn[0];
|
|
2021
|
+
(codeBySys.get(sys) ?? codeBySys.set(sys, []).get(sys)).push(
|
|
2022
|
+
o.pr - r.pr
|
|
2023
|
+
);
|
|
2024
|
+
if (o.cp != null && r.cp != null) {
|
|
2025
|
+
const f = carrierFreqHz2(
|
|
2026
|
+
sys,
|
|
2027
|
+
o.code[0],
|
|
2028
|
+
o.gloChannel ?? r.gloChannel ?? null
|
|
2029
|
+
);
|
|
2030
|
+
if (f > 0)
|
|
2031
|
+
phase.push({
|
|
2032
|
+
key: `${rx}|${o.prn}|${o.code}`,
|
|
2033
|
+
sdM: (o.cp - r.cp) * (C_LIGHT / f),
|
|
2034
|
+
lock: o.lockTimeS
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2037
|
+
}
|
|
2038
|
+
if (codeBySys.size === 0)
|
|
2039
|
+
return {
|
|
2040
|
+
t,
|
|
2041
|
+
receiver: rx,
|
|
2042
|
+
clockOffsetM: null,
|
|
2043
|
+
clockOffsetPhaseM: this.phaseClock.get(rx) ?? null,
|
|
2044
|
+
used: 0,
|
|
2045
|
+
rejected: 0,
|
|
2046
|
+
residualRmsM: 0
|
|
2047
|
+
};
|
|
2048
|
+
const sysMedian = /* @__PURE__ */ new Map();
|
|
2049
|
+
for (const [sys, v] of codeBySys) sysMedian.set(sys, median(v));
|
|
2050
|
+
const allSd = [];
|
|
2051
|
+
for (const v of codeBySys.values()) allSd.push(...v);
|
|
2052
|
+
const clk = sysMedian.get(this.refSys) ?? median(allSd);
|
|
2053
|
+
for (const [sys, med] of sysMedian) {
|
|
2054
|
+
if (sys === this.refSys) continue;
|
|
2055
|
+
const cur = this.isb.get(`${rx}|${sys}`) ?? { sum: 0, n: 0 };
|
|
2056
|
+
cur.sum += med - clk;
|
|
2057
|
+
cur.n += 1;
|
|
2058
|
+
this.isb.set(`${rx}|${sys}`, cur);
|
|
2059
|
+
}
|
|
2060
|
+
let ss = 0, used = 0, rejected = 0;
|
|
2061
|
+
for (const [sys, v] of codeBySys) {
|
|
2062
|
+
const isb = sys === this.refSys ? 0 : sysMedian.get(sys) - clk;
|
|
2063
|
+
for (const sd of v) {
|
|
2064
|
+
const res = sd - clk - isb;
|
|
2065
|
+
if (Math.abs(res) > 5) {
|
|
2066
|
+
rejected++;
|
|
2067
|
+
continue;
|
|
2068
|
+
}
|
|
2069
|
+
ss += res * res;
|
|
2070
|
+
used++;
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
const residualRmsM = used ? Math.sqrt(ss / used) : 0;
|
|
2074
|
+
const deltas = [];
|
|
2075
|
+
for (const p of phase) {
|
|
2076
|
+
const arc = this.arcs.get(p.key);
|
|
2077
|
+
this.arcs.set(p.key, { lastPhaseSdM: p.sdM, lastLock: p.lock });
|
|
2078
|
+
if (!arc) continue;
|
|
2079
|
+
const lockReset = p.lock != null && arc.lastLock != null && p.lock < arc.lastLock;
|
|
2080
|
+
if (lockReset) continue;
|
|
2081
|
+
deltas.push(p.sdM - arc.lastPhaseSdM);
|
|
2082
|
+
}
|
|
2083
|
+
let phaseClockM = this.phaseClock.get(rx) ?? null;
|
|
2084
|
+
if (phaseClockM == null) {
|
|
2085
|
+
phaseClockM = clk;
|
|
2086
|
+
} else if (deltas.length) {
|
|
2087
|
+
const md = median(deltas);
|
|
2088
|
+
const good = deltas.filter((d) => Math.abs(d - md) < this.slip);
|
|
2089
|
+
const step = good.length ? good.reduce((a, b) => a + b, 0) / good.length : md;
|
|
2090
|
+
phaseClockM += step;
|
|
2091
|
+
}
|
|
2092
|
+
this.phaseClock.set(rx, phaseClockM);
|
|
2093
|
+
return {
|
|
2094
|
+
t,
|
|
2095
|
+
receiver: rx,
|
|
2096
|
+
clockOffsetM: clk,
|
|
2097
|
+
clockOffsetPhaseM: phaseClockM,
|
|
2098
|
+
used,
|
|
2099
|
+
rejected,
|
|
2100
|
+
residualRmsM
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
};
|
|
2104
|
+
|
|
1926
2105
|
// src/navbits/index.ts
|
|
1927
2106
|
var GPS_EPOCH_MS2 = Date.UTC(1980, 0, 6);
|
|
1928
2107
|
var SEC_PER_WEEK = 7 * 86400;
|
|
@@ -4420,6 +4599,7 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
|
|
|
4420
4599
|
RtkFloatEngine,
|
|
4421
4600
|
SbasProcessor,
|
|
4422
4601
|
Sp3EphemerisSource,
|
|
4602
|
+
ZeroBaselineEngine,
|
|
4423
4603
|
antexFreqOfGroup,
|
|
4424
4604
|
applyOrbitClock,
|
|
4425
4605
|
buildPppAntenna,
|
package/dist/positioning.d.cts
CHANGED
|
@@ -558,6 +558,61 @@ interface RtkPostProcessResult {
|
|
|
558
558
|
*/
|
|
559
559
|
declare function postProcessRtk(base: RtkObsInput, rover: RtkObsInput, ephemerides: EphemerisSource, baseEcef: readonly [number, number, number], opts?: RtkPostProcessOptions): RtkPostProcessResult;
|
|
560
560
|
|
|
561
|
+
interface ZeroBaselineOptions {
|
|
562
|
+
/** Reference receiver id (every other receiver is differenced against it). */
|
|
563
|
+
reference: string;
|
|
564
|
+
/** ISB datum system letter (biases are reported relative to it). Default 'G'. */
|
|
565
|
+
referenceSystem?: string;
|
|
566
|
+
/** Phase-SD inter-epoch jump gate (m) for cycle-slip rejection. Default 0.05. */
|
|
567
|
+
slipThreshM?: number;
|
|
568
|
+
}
|
|
569
|
+
/** One receiver's relative-clock estimate at one epoch. */
|
|
570
|
+
interface ReceiverClockSample {
|
|
571
|
+
t: number;
|
|
572
|
+
receiver: string;
|
|
573
|
+
/** Code relative clock (m); divide by c for seconds. Null with no data. */
|
|
574
|
+
clockOffsetM: number | null;
|
|
575
|
+
/** Phase-smoothed relative clock (m) — precise; anchored to the code clock. */
|
|
576
|
+
clockOffsetPhaseM: number | null;
|
|
577
|
+
/** Signals used / rejected in the code solution this epoch. */
|
|
578
|
+
used: number;
|
|
579
|
+
rejected: number;
|
|
580
|
+
/** RMS of the code-SD residuals about the clock+ISB fit (m). */
|
|
581
|
+
residualRmsM: number;
|
|
582
|
+
}
|
|
583
|
+
/** A receiver's inter-system bias relative to the datum system (m). */
|
|
584
|
+
interface ReceiverBias {
|
|
585
|
+
receiver: string;
|
|
586
|
+
system: string;
|
|
587
|
+
biasM: number;
|
|
588
|
+
/** Epochs the estimate averages over. */
|
|
589
|
+
n: number;
|
|
590
|
+
}
|
|
591
|
+
declare class ZeroBaselineEngine {
|
|
592
|
+
private readonly ref;
|
|
593
|
+
private readonly refSys;
|
|
594
|
+
private readonly slip;
|
|
595
|
+
/** Per (receiver|prn|code) continuous phase-SD arc. */
|
|
596
|
+
private readonly arcs;
|
|
597
|
+
/** Per receiver: integrated phase-smoothed clock (m). */
|
|
598
|
+
private readonly phaseClock;
|
|
599
|
+
/** Per (receiver|system): accumulated ISB (m) + count. */
|
|
600
|
+
private readonly isb;
|
|
601
|
+
constructor(opts: ZeroBaselineOptions);
|
|
602
|
+
reset(): void;
|
|
603
|
+
/** ISB/IFB estimates accumulated so far, per receiver × system. */
|
|
604
|
+
biases(): ReceiverBias[];
|
|
605
|
+
/**
|
|
606
|
+
* Ingest one time-aligned instant: observations per receiver id. Returns one
|
|
607
|
+
* {@link ReceiverClockSample} per non-reference receiver present this epoch.
|
|
608
|
+
*/
|
|
609
|
+
process(epoch: {
|
|
610
|
+
timeMs: number;
|
|
611
|
+
obs: Record<string, readonly RawObservation[]>;
|
|
612
|
+
}): ReceiverClockSample[];
|
|
613
|
+
private processReceiver;
|
|
614
|
+
}
|
|
615
|
+
|
|
561
616
|
/**
|
|
562
617
|
* Integer ambiguity resolution: LAMBDA decorrelation + MLAMBDA
|
|
563
618
|
* integer least-squares search.
|
|
@@ -1659,4 +1714,4 @@ declare function sbasProtectionLevels(sats: readonly {
|
|
|
1659
1714
|
*/
|
|
1660
1715
|
declare function solveSpp(pseudoranges: Map<string, number>, ephemerides: Map<string, Ephemeris>, timeMs: number, opts?: SppOptions): SppSolution | null;
|
|
1661
1716
|
|
|
1662
|
-
export { type AntennaOffset, type AppliedOrbitClock, type ArFixedSat, type ArOptions, type ArResult, type ArSat, type CorrectionResult, type Degradation, type DgnssOptions, type DgnssSolution, type EphemerisSource, type FixedPositionResult, IONO_L1_M_PER_TECU, type KlobucharCoeffs, type LambdaResult, type NetworkFcbResult, type NetworkFcbSummary, type NlArc, type NlFcbResult, type OrbitClockCorrection, type PppAntennaModel, type PppArc, type PppCorrectionConfig, type PppCorrections, PppEngine, type PppEphemerisSource, type PppEpoch, type PppEpochContext, type PppEpochResult, type PppFixState, type PppOptions, type PppSatObs, type PppSolution, type RawObservation, type RtkAntennaConfig, type RtkAntennaModel, type RtkAntennaOffset, type RtkEpochMeasurements, RtkFloatEngine, type RtkFloatOptions, type RtkFloatSolution, type RtkMeasurement, type RtkObsEpoch, type RtkObsInput, type RtkPostProcessOptions, type RtkPostProcessResult, type RtkReceiverAntenna, type RtkTrackPoint, type SatGeom, type SatSample, type SbasCorrectionSource, type SbasIgp, type SbasIonoDelay, SbasProcessor, type SbasSatCorrection, Sp3EphemerisSource, type SppOptions, type SppSolution, type TropoMapping, type WlArc, type WlFcbOptions, type WlFcbResult, type WlObs, antexFreqOfGroup, applyOrbitClock, buildPppAntenna, buildRtkAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, hasToOrbitClock, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, rcvAntennaRangeM, resolvePppAmbiguities, satClockCorrection, sbasIonoDeg, sbasLongTermDeg, sbasProtectionLevels, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
|
|
1717
|
+
export { type AntennaOffset, type AppliedOrbitClock, type ArFixedSat, type ArOptions, type ArResult, type ArSat, type CorrectionResult, type Degradation, type DgnssOptions, type DgnssSolution, type EphemerisSource, type FixedPositionResult, IONO_L1_M_PER_TECU, type KlobucharCoeffs, type LambdaResult, type NetworkFcbResult, type NetworkFcbSummary, type NlArc, type NlFcbResult, type OrbitClockCorrection, type PppAntennaModel, type PppArc, type PppCorrectionConfig, type PppCorrections, PppEngine, type PppEphemerisSource, type PppEpoch, type PppEpochContext, type PppEpochResult, type PppFixState, type PppOptions, type PppSatObs, type PppSolution, type RawObservation, type ReceiverBias, type ReceiverClockSample, type RtkAntennaConfig, type RtkAntennaModel, type RtkAntennaOffset, type RtkEpochMeasurements, RtkFloatEngine, type RtkFloatOptions, type RtkFloatSolution, type RtkMeasurement, type RtkObsEpoch, type RtkObsInput, type RtkPostProcessOptions, type RtkPostProcessResult, type RtkReceiverAntenna, type RtkTrackPoint, type SatGeom, type SatSample, type SbasCorrectionSource, type SbasIgp, type SbasIonoDelay, SbasProcessor, type SbasSatCorrection, Sp3EphemerisSource, type SppOptions, type SppSolution, type TropoMapping, type WlArc, type WlFcbOptions, type WlFcbResult, type WlObs, ZeroBaselineEngine, type ZeroBaselineOptions, antexFreqOfGroup, applyOrbitClock, buildPppAntenna, buildRtkAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, hasToOrbitClock, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, rcvAntennaRangeM, resolvePppAmbiguities, satClockCorrection, sbasIonoDeg, sbasLongTermDeg, sbasProtectionLevels, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
|
package/dist/positioning.d.ts
CHANGED
|
@@ -558,6 +558,61 @@ interface RtkPostProcessResult {
|
|
|
558
558
|
*/
|
|
559
559
|
declare function postProcessRtk(base: RtkObsInput, rover: RtkObsInput, ephemerides: EphemerisSource, baseEcef: readonly [number, number, number], opts?: RtkPostProcessOptions): RtkPostProcessResult;
|
|
560
560
|
|
|
561
|
+
interface ZeroBaselineOptions {
|
|
562
|
+
/** Reference receiver id (every other receiver is differenced against it). */
|
|
563
|
+
reference: string;
|
|
564
|
+
/** ISB datum system letter (biases are reported relative to it). Default 'G'. */
|
|
565
|
+
referenceSystem?: string;
|
|
566
|
+
/** Phase-SD inter-epoch jump gate (m) for cycle-slip rejection. Default 0.05. */
|
|
567
|
+
slipThreshM?: number;
|
|
568
|
+
}
|
|
569
|
+
/** One receiver's relative-clock estimate at one epoch. */
|
|
570
|
+
interface ReceiverClockSample {
|
|
571
|
+
t: number;
|
|
572
|
+
receiver: string;
|
|
573
|
+
/** Code relative clock (m); divide by c for seconds. Null with no data. */
|
|
574
|
+
clockOffsetM: number | null;
|
|
575
|
+
/** Phase-smoothed relative clock (m) — precise; anchored to the code clock. */
|
|
576
|
+
clockOffsetPhaseM: number | null;
|
|
577
|
+
/** Signals used / rejected in the code solution this epoch. */
|
|
578
|
+
used: number;
|
|
579
|
+
rejected: number;
|
|
580
|
+
/** RMS of the code-SD residuals about the clock+ISB fit (m). */
|
|
581
|
+
residualRmsM: number;
|
|
582
|
+
}
|
|
583
|
+
/** A receiver's inter-system bias relative to the datum system (m). */
|
|
584
|
+
interface ReceiverBias {
|
|
585
|
+
receiver: string;
|
|
586
|
+
system: string;
|
|
587
|
+
biasM: number;
|
|
588
|
+
/** Epochs the estimate averages over. */
|
|
589
|
+
n: number;
|
|
590
|
+
}
|
|
591
|
+
declare class ZeroBaselineEngine {
|
|
592
|
+
private readonly ref;
|
|
593
|
+
private readonly refSys;
|
|
594
|
+
private readonly slip;
|
|
595
|
+
/** Per (receiver|prn|code) continuous phase-SD arc. */
|
|
596
|
+
private readonly arcs;
|
|
597
|
+
/** Per receiver: integrated phase-smoothed clock (m). */
|
|
598
|
+
private readonly phaseClock;
|
|
599
|
+
/** Per (receiver|system): accumulated ISB (m) + count. */
|
|
600
|
+
private readonly isb;
|
|
601
|
+
constructor(opts: ZeroBaselineOptions);
|
|
602
|
+
reset(): void;
|
|
603
|
+
/** ISB/IFB estimates accumulated so far, per receiver × system. */
|
|
604
|
+
biases(): ReceiverBias[];
|
|
605
|
+
/**
|
|
606
|
+
* Ingest one time-aligned instant: observations per receiver id. Returns one
|
|
607
|
+
* {@link ReceiverClockSample} per non-reference receiver present this epoch.
|
|
608
|
+
*/
|
|
609
|
+
process(epoch: {
|
|
610
|
+
timeMs: number;
|
|
611
|
+
obs: Record<string, readonly RawObservation[]>;
|
|
612
|
+
}): ReceiverClockSample[];
|
|
613
|
+
private processReceiver;
|
|
614
|
+
}
|
|
615
|
+
|
|
561
616
|
/**
|
|
562
617
|
* Integer ambiguity resolution: LAMBDA decorrelation + MLAMBDA
|
|
563
618
|
* integer least-squares search.
|
|
@@ -1659,4 +1714,4 @@ declare function sbasProtectionLevels(sats: readonly {
|
|
|
1659
1714
|
*/
|
|
1660
1715
|
declare function solveSpp(pseudoranges: Map<string, number>, ephemerides: Map<string, Ephemeris>, timeMs: number, opts?: SppOptions): SppSolution | null;
|
|
1661
1716
|
|
|
1662
|
-
export { type AntennaOffset, type AppliedOrbitClock, type ArFixedSat, type ArOptions, type ArResult, type ArSat, type CorrectionResult, type Degradation, type DgnssOptions, type DgnssSolution, type EphemerisSource, type FixedPositionResult, IONO_L1_M_PER_TECU, type KlobucharCoeffs, type LambdaResult, type NetworkFcbResult, type NetworkFcbSummary, type NlArc, type NlFcbResult, type OrbitClockCorrection, type PppAntennaModel, type PppArc, type PppCorrectionConfig, type PppCorrections, PppEngine, type PppEphemerisSource, type PppEpoch, type PppEpochContext, type PppEpochResult, type PppFixState, type PppOptions, type PppSatObs, type PppSolution, type RawObservation, type RtkAntennaConfig, type RtkAntennaModel, type RtkAntennaOffset, type RtkEpochMeasurements, RtkFloatEngine, type RtkFloatOptions, type RtkFloatSolution, type RtkMeasurement, type RtkObsEpoch, type RtkObsInput, type RtkPostProcessOptions, type RtkPostProcessResult, type RtkReceiverAntenna, type RtkTrackPoint, type SatGeom, type SatSample, type SbasCorrectionSource, type SbasIgp, type SbasIonoDelay, SbasProcessor, type SbasSatCorrection, Sp3EphemerisSource, type SppOptions, type SppSolution, type TropoMapping, type WlArc, type WlFcbOptions, type WlFcbResult, type WlObs, antexFreqOfGroup, applyOrbitClock, buildPppAntenna, buildRtkAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, hasToOrbitClock, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, rcvAntennaRangeM, resolvePppAmbiguities, satClockCorrection, sbasIonoDeg, sbasLongTermDeg, sbasProtectionLevels, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
|
|
1717
|
+
export { type AntennaOffset, type AppliedOrbitClock, type ArFixedSat, type ArOptions, type ArResult, type ArSat, type CorrectionResult, type Degradation, type DgnssOptions, type DgnssSolution, type EphemerisSource, type FixedPositionResult, IONO_L1_M_PER_TECU, type KlobucharCoeffs, type LambdaResult, type NetworkFcbResult, type NetworkFcbSummary, type NlArc, type NlFcbResult, type OrbitClockCorrection, type PppAntennaModel, type PppArc, type PppCorrectionConfig, type PppCorrections, PppEngine, type PppEphemerisSource, type PppEpoch, type PppEpochContext, type PppEpochResult, type PppFixState, type PppOptions, type PppSatObs, type PppSolution, type RawObservation, type ReceiverBias, type ReceiverClockSample, type RtkAntennaConfig, type RtkAntennaModel, type RtkAntennaOffset, type RtkEpochMeasurements, RtkFloatEngine, type RtkFloatOptions, type RtkFloatSolution, type RtkMeasurement, type RtkObsEpoch, type RtkObsInput, type RtkPostProcessOptions, type RtkPostProcessResult, type RtkReceiverAntenna, type RtkTrackPoint, type SatGeom, type SatSample, type SbasCorrectionSource, type SbasIgp, type SbasIonoDelay, SbasProcessor, type SbasSatCorrection, Sp3EphemerisSource, type SppOptions, type SppSolution, type TropoMapping, type WlArc, type WlFcbOptions, type WlFcbResult, type WlObs, ZeroBaselineEngine, type ZeroBaselineOptions, antexFreqOfGroup, applyOrbitClock, buildPppAntenna, buildRtkAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, hasToOrbitClock, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, postProcessRtk, rcvAntennaRangeM, resolvePppAmbiguities, satClockCorrection, sbasIonoDeg, sbasLongTermDeg, sbasProtectionLevels, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
|
package/dist/positioning.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
RtkFloatEngine,
|
|
5
5
|
SbasProcessor,
|
|
6
6
|
Sp3EphemerisSource,
|
|
7
|
+
ZeroBaselineEngine,
|
|
7
8
|
antexFreqOfGroup,
|
|
8
9
|
applyOrbitClock,
|
|
9
10
|
buildPppAntenna,
|
|
@@ -39,7 +40,7 @@ import {
|
|
|
39
40
|
sunEcef,
|
|
40
41
|
toRtkEpoch,
|
|
41
42
|
wlWavelength
|
|
42
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-BWLLHLLS.js";
|
|
43
44
|
import "./chunk-WQX354KD.js";
|
|
44
45
|
import "./chunk-JYWYQ7DW.js";
|
|
45
46
|
import "./chunk-HVXYFUCB.js";
|
|
@@ -57,6 +58,7 @@ export {
|
|
|
57
58
|
RtkFloatEngine,
|
|
58
59
|
SbasProcessor,
|
|
59
60
|
Sp3EphemerisSource,
|
|
61
|
+
ZeroBaselineEngine,
|
|
60
62
|
antexFreqOfGroup,
|
|
61
63
|
applyOrbitClock,
|
|
62
64
|
buildPppAntenna,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gnss-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Comprehensive GNSS library for JavaScript — time scales, coordinates, RINEX parsing, RTCM3 decoding, orbit computation, and signal analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|