gnss-js 1.63.0 → 1.65.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-QN7Q2ALS.js → chunk-REULRNJ5.js} +371 -3
- package/dist/index.cjs +434 -62
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -1
- package/dist/rtcm3.cjs +375 -3
- package/dist/rtcm3.d.cts +144 -1
- package/dist/rtcm3.d.ts +144 -1
- package/dist/rtcm3.js +9 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -10,7 +10,7 @@ export { E as EpochSummary, P as ParseOptions, R as RinexHeader, a as RinexResul
|
|
|
10
10
|
export { C as CnavEphemeris, E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris, N as NavHeader, a as NavResult, R as RinexCnavEphemeris, p as parseNavFile } from './nav-DImXUdbp.cjs';
|
|
11
11
|
export { C as ClkFile, I as IonexGrid, S as Sp3File, a as Sp3Sample, c as clkBias, p as parseClk, b as parseIonex, d as parseSp3, s as sp3Position } from './clk-DGVBGRzA.cjs';
|
|
12
12
|
export { B as BitReader, E as EphemerisInfo, R as Rtcm3DebugHandler, a as Rtcm3Decoder, b as Rtcm3Frame, d as decodeEphemeris, r as readString, c as reportDecodeError, s as setRtcm3DebugHandler } from './ephemeris-Ohl6NAfw.cjs';
|
|
13
|
-
export { MessageTypeStats, MsmEpoch, MsmSatObs, MsmSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, StationMeta, StreamStats, createStationMeta, createStreamStats, decodeLegacyObs, decodeMsmFull, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.cjs';
|
|
13
|
+
export { IgsSsrIonoLayer, IgsSsrMessage, MessageTypeStats, MsmEpoch, MsmSatObs, MsmSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, SsrCodeBias, SsrKind, SsrMessage, SsrPhaseBias, SsrSatCorrection, StationMeta, StreamStats, SystemParams, SystemParamsMessage, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeSsr, decodeSystemParams, isSsrMessage, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.cjs';
|
|
14
14
|
export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxPvtResult, UbxRawNavOptions, UbxRawNavResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxPvt, parseUbxRawNav, parseUbxRawx, ubxFrames } from './ubx.cjs';
|
|
15
15
|
export { DfmcCensus, DfmcMessageCb, GeoL5Result, HasMessage, SBAS_L5_MT_NAMES, SBAS_L5_PREAMBLE_UW, SbasMessageCb, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGeoL5Result, SbfGeoNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavigation, SbfParseResult, SbfPvt, SbfPvtResult, SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, feedGeoL5Block, isSbasL1Preamble, isSbasL5Correction, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoL5, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfPvt, parseSbfReceiverSetup, sbasL5MessageName, sbasL5MessageType, sbfCrc16, scanSbfFrames } from './sbf.cjs';
|
|
16
16
|
export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, NovatelPvtResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelPvt, parseNovatelRange } from './novatel.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { E as EpochSummary, P as ParseOptions, R as RinexHeader, a as RinexResul
|
|
|
10
10
|
export { C as CnavEphemeris, E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris, N as NavHeader, a as NavResult, R as RinexCnavEphemeris, p as parseNavFile } from './nav-DImXUdbp.js';
|
|
11
11
|
export { C as ClkFile, I as IonexGrid, S as Sp3File, a as Sp3Sample, c as clkBias, p as parseClk, b as parseIonex, d as parseSp3, s as sp3Position } from './clk-DGVBGRzA.js';
|
|
12
12
|
export { B as BitReader, E as EphemerisInfo, R as Rtcm3DebugHandler, a as Rtcm3Decoder, b as Rtcm3Frame, d as decodeEphemeris, r as readString, c as reportDecodeError, s as setRtcm3DebugHandler } from './ephemeris-Ohl6NAfw.js';
|
|
13
|
-
export { MessageTypeStats, MsmEpoch, MsmSatObs, MsmSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, StationMeta, StreamStats, createStationMeta, createStreamStats, decodeLegacyObs, decodeMsmFull, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.js';
|
|
13
|
+
export { IgsSsrIonoLayer, IgsSsrMessage, MessageTypeStats, MsmEpoch, MsmSatObs, MsmSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, SsrCodeBias, SsrKind, SsrMessage, SsrPhaseBias, SsrSatCorrection, StationMeta, StreamStats, SystemParams, SystemParamsMessage, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeSsr, decodeSystemParams, isSsrMessage, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.js';
|
|
14
14
|
export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxPvtResult, UbxRawNavOptions, UbxRawNavResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxPvt, parseUbxRawNav, parseUbxRawx, ubxFrames } from './ubx.js';
|
|
15
15
|
export { DfmcCensus, DfmcMessageCb, GeoL5Result, HasMessage, SBAS_L5_MT_NAMES, SBAS_L5_PREAMBLE_UW, SbasMessageCb, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGeoL5Result, SbfGeoNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavigation, SbfParseResult, SbfPvt, SbfPvtResult, SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, feedGeoL5Block, isSbasL1Preamble, isSbasL5Correction, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoL5, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfPvt, parseSbfReceiverSetup, sbasL5MessageName, sbasL5MessageType, sbfCrc16, scanSbfFrames } from './sbf.js';
|
|
16
16
|
export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, NovatelPvtResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelPvt, parseNovatelRange } from './novatel.js';
|
package/dist/index.js
CHANGED
|
@@ -275,8 +275,12 @@ import {
|
|
|
275
275
|
createStationMeta,
|
|
276
276
|
createStreamStats,
|
|
277
277
|
decodeEphemeris,
|
|
278
|
+
decodeIgsSsr,
|
|
278
279
|
decodeLegacyObs,
|
|
279
280
|
decodeMsmFull,
|
|
281
|
+
decodeSsr,
|
|
282
|
+
decodeSystemParams,
|
|
283
|
+
isSsrMessage,
|
|
280
284
|
msmEpochToDate,
|
|
281
285
|
readString,
|
|
282
286
|
reportDecodeError,
|
|
@@ -286,7 +290,7 @@ import {
|
|
|
286
290
|
setRtcm3DebugHandler,
|
|
287
291
|
updateStationMeta,
|
|
288
292
|
updateStreamStats
|
|
289
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-REULRNJ5.js";
|
|
290
294
|
import {
|
|
291
295
|
getBdsTime,
|
|
292
296
|
getDateFromBdsTime,
|
|
@@ -495,9 +499,12 @@ export {
|
|
|
495
499
|
dateToEpoch,
|
|
496
500
|
decodeBinexEph,
|
|
497
501
|
decodeEphemeris,
|
|
502
|
+
decodeIgsSsr,
|
|
498
503
|
decodeLegacyObs,
|
|
499
504
|
decodeMsmFull,
|
|
500
505
|
decodeSbfNavigation,
|
|
506
|
+
decodeSsr,
|
|
507
|
+
decodeSystemParams,
|
|
501
508
|
deg2dms,
|
|
502
509
|
deg2rad,
|
|
503
510
|
detrendIonoArcs,
|
|
@@ -590,6 +597,7 @@ export {
|
|
|
590
597
|
ionoFree,
|
|
591
598
|
isSbasL1Preamble,
|
|
592
599
|
isSbasL5Correction,
|
|
600
|
+
isSsrMessage,
|
|
593
601
|
keplerPosition,
|
|
594
602
|
klobucharDelay,
|
|
595
603
|
lambdaReduction,
|
package/dist/rtcm3.cjs
CHANGED
|
@@ -26,8 +26,12 @@ __export(rtcm3_exports, {
|
|
|
26
26
|
createStationMeta: () => createStationMeta,
|
|
27
27
|
createStreamStats: () => createStreamStats,
|
|
28
28
|
decodeEphemeris: () => decodeEphemeris,
|
|
29
|
+
decodeIgsSsr: () => decodeIgsSsr,
|
|
29
30
|
decodeLegacyObs: () => decodeLegacyObs,
|
|
30
31
|
decodeMsmFull: () => decodeMsmFull,
|
|
32
|
+
decodeSsr: () => decodeSsr,
|
|
33
|
+
decodeSystemParams: () => decodeSystemParams,
|
|
34
|
+
isSsrMessage: () => isSsrMessage,
|
|
31
35
|
msmEpochToDate: () => msmEpochToDate,
|
|
32
36
|
readString: () => readString,
|
|
33
37
|
reportDecodeError: () => reportDecodeError,
|
|
@@ -588,6 +592,192 @@ function decodeEphemeris(frame) {
|
|
|
588
592
|
}
|
|
589
593
|
}
|
|
590
594
|
|
|
595
|
+
// src/rtcm3/igs-ssr.ts
|
|
596
|
+
var UPDATE_INTERVAL_S = [
|
|
597
|
+
1,
|
|
598
|
+
2,
|
|
599
|
+
5,
|
|
600
|
+
10,
|
|
601
|
+
15,
|
|
602
|
+
30,
|
|
603
|
+
60,
|
|
604
|
+
120,
|
|
605
|
+
240,
|
|
606
|
+
300,
|
|
607
|
+
600,
|
|
608
|
+
900,
|
|
609
|
+
1800,
|
|
610
|
+
3600,
|
|
611
|
+
7200,
|
|
612
|
+
10800
|
|
613
|
+
];
|
|
614
|
+
var SYSTEM_BY_BASE = {
|
|
615
|
+
20: "G",
|
|
616
|
+
40: "R",
|
|
617
|
+
60: "E",
|
|
618
|
+
80: "J",
|
|
619
|
+
100: "C",
|
|
620
|
+
120: "S"
|
|
621
|
+
};
|
|
622
|
+
var KIND_BY_OFFSET = {
|
|
623
|
+
1: "orbit",
|
|
624
|
+
2: "clock",
|
|
625
|
+
3: "combined",
|
|
626
|
+
4: "highRateClock",
|
|
627
|
+
5: "codeBias",
|
|
628
|
+
6: "phaseBias",
|
|
629
|
+
7: "ura"
|
|
630
|
+
};
|
|
631
|
+
var two = (n) => n.toString().padStart(2, "0");
|
|
632
|
+
function prnFor(system, id) {
|
|
633
|
+
if (system === "J") return `J${two(id)}`;
|
|
634
|
+
if (system === "S") return `S${two(19 + id)}`;
|
|
635
|
+
return `${system}${two(id)}`;
|
|
636
|
+
}
|
|
637
|
+
function ssrUraMm(v) {
|
|
638
|
+
if (v === 0) return null;
|
|
639
|
+
const cls = v >> 3 & 7;
|
|
640
|
+
const val = v & 7;
|
|
641
|
+
return 3 ** cls * (1 + val / 4) - 1;
|
|
642
|
+
}
|
|
643
|
+
function decodeIgsSsr(frame) {
|
|
644
|
+
if (frame.messageType !== 4076) return null;
|
|
645
|
+
const r = new BitReader(frame.payload);
|
|
646
|
+
r.readU(12);
|
|
647
|
+
const version = r.readU(3);
|
|
648
|
+
const im = r.readU(8);
|
|
649
|
+
if (im === 201) return decodeIono(r, version, im);
|
|
650
|
+
const base = Math.floor(im / 20) * 20;
|
|
651
|
+
const system = SYSTEM_BY_BASE[base];
|
|
652
|
+
const kind = KIND_BY_OFFSET[im - base];
|
|
653
|
+
if (!system || !kind) return null;
|
|
654
|
+
const epochS = r.readU(20);
|
|
655
|
+
const updateIntervalS = UPDATE_INTERVAL_S[r.readU(4)];
|
|
656
|
+
const multipleMessage = r.readU(1) === 1;
|
|
657
|
+
const iodSsr = r.readU(4);
|
|
658
|
+
const providerId = r.readU(16);
|
|
659
|
+
const solutionId = r.readU(4);
|
|
660
|
+
const hasDatum = kind === "orbit" || kind === "combined";
|
|
661
|
+
const referenceDatum = hasDatum ? r.readU(1) : void 0;
|
|
662
|
+
let dispersiveConsistency;
|
|
663
|
+
let mwConsistency;
|
|
664
|
+
if (kind === "phaseBias") {
|
|
665
|
+
dispersiveConsistency = r.readU(1) === 1;
|
|
666
|
+
mwConsistency = r.readU(1) === 1;
|
|
667
|
+
}
|
|
668
|
+
const nsat = r.readU(6);
|
|
669
|
+
const readOrbit = (s) => {
|
|
670
|
+
s.iode = r.readU(8);
|
|
671
|
+
s.deltaRadial = r.readS(22) * 1e-4;
|
|
672
|
+
s.deltaAlongTrack = r.readS(20) * 4e-4;
|
|
673
|
+
s.deltaCrossTrack = r.readS(20) * 4e-4;
|
|
674
|
+
s.dotRadial = r.readS(21) * 1e-6;
|
|
675
|
+
s.dotAlongTrack = r.readS(19) * 4e-6;
|
|
676
|
+
s.dotCrossTrack = r.readS(19) * 4e-6;
|
|
677
|
+
};
|
|
678
|
+
const readClock = (s) => {
|
|
679
|
+
s.c0 = r.readS(22) * 1e-4;
|
|
680
|
+
s.c1 = r.readS(21) * 1e-6;
|
|
681
|
+
s.c2 = r.readS(27) * 2e-8;
|
|
682
|
+
};
|
|
683
|
+
const satellites = [];
|
|
684
|
+
for (let i = 0; i < nsat; i++) {
|
|
685
|
+
const id = r.readU(6);
|
|
686
|
+
const sat = { prn: prnFor(system, id) };
|
|
687
|
+
if (kind === "orbit" || kind === "combined") readOrbit(sat);
|
|
688
|
+
if (kind === "clock" || kind === "combined") readClock(sat);
|
|
689
|
+
else if (kind === "ura")
|
|
690
|
+
sat.uraMm = ssrUraMm(r.readU(6));
|
|
691
|
+
else if (kind === "highRateClock")
|
|
692
|
+
sat.highRateClock = r.readS(22) * 1e-4;
|
|
693
|
+
else if (kind === "codeBias") {
|
|
694
|
+
const n = r.readU(5);
|
|
695
|
+
const biases = [];
|
|
696
|
+
for (let b = 0; b < n; b++) {
|
|
697
|
+
const signal = r.readU(5);
|
|
698
|
+
biases.push({
|
|
699
|
+
signal,
|
|
700
|
+
signalName: `#${signal}`,
|
|
701
|
+
biasM: r.readS(14) * 0.01
|
|
702
|
+
// IDF025 0.01 m
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
sat.codeBiases = biases;
|
|
706
|
+
} else if (kind === "phaseBias") {
|
|
707
|
+
const n = r.readU(5);
|
|
708
|
+
r.readU(9);
|
|
709
|
+
r.readS(8);
|
|
710
|
+
const biases = [];
|
|
711
|
+
for (let b = 0; b < n; b++) {
|
|
712
|
+
const signal = r.readU(5);
|
|
713
|
+
const integer = r.readU(1) === 1;
|
|
714
|
+
const wideLaneGroup = r.readU(2);
|
|
715
|
+
const discontinuity = r.readU(4);
|
|
716
|
+
const biasM = r.readS(20) * 1e-4;
|
|
717
|
+
biases.push({ signal, integer, wideLaneGroup, discontinuity, biasM });
|
|
718
|
+
}
|
|
719
|
+
sat.phaseBiases = biases;
|
|
720
|
+
}
|
|
721
|
+
satellites.push(sat);
|
|
722
|
+
}
|
|
723
|
+
return {
|
|
724
|
+
messageType: 4076,
|
|
725
|
+
version,
|
|
726
|
+
igsMessageNumber: im,
|
|
727
|
+
system,
|
|
728
|
+
kind,
|
|
729
|
+
epochS,
|
|
730
|
+
updateIntervalS,
|
|
731
|
+
multipleMessage,
|
|
732
|
+
referenceDatum,
|
|
733
|
+
iodSsr,
|
|
734
|
+
providerId,
|
|
735
|
+
solutionId,
|
|
736
|
+
dispersiveConsistency,
|
|
737
|
+
mwConsistency,
|
|
738
|
+
satellites
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
function decodeIono(r, version, im) {
|
|
742
|
+
const epochS = r.readU(20);
|
|
743
|
+
const updateIntervalS = UPDATE_INTERVAL_S[r.readU(4)];
|
|
744
|
+
const multipleMessage = r.readU(1) === 1;
|
|
745
|
+
const iodSsr = r.readU(4);
|
|
746
|
+
const providerId = r.readU(16);
|
|
747
|
+
const solutionId = r.readU(4);
|
|
748
|
+
const qualityTecu = r.readU(9) * 0.05;
|
|
749
|
+
const nLayers = r.readU(2) + 1;
|
|
750
|
+
const layers = [];
|
|
751
|
+
for (let l = 0; l < nLayers; l++) {
|
|
752
|
+
const heightKm = r.readU(8) * 10;
|
|
753
|
+
const degree = r.readU(4) + 1;
|
|
754
|
+
const order = r.readU(4) + 1;
|
|
755
|
+
const N = degree;
|
|
756
|
+
const M = order;
|
|
757
|
+
const nCoef = (N + 1) * (N + 1) - (N - M) * (N - M + 1);
|
|
758
|
+
const nCos = nCoef;
|
|
759
|
+
let nSin = 0;
|
|
760
|
+
for (let m = 1; m <= M; m++) nSin += N - m + 1;
|
|
761
|
+
for (let i = 0; i < nCos + nSin; i++) r.readS(16);
|
|
762
|
+
layers.push({ heightKm, degree, order, coefficientCount: nCos + nSin });
|
|
763
|
+
}
|
|
764
|
+
return {
|
|
765
|
+
messageType: 4076,
|
|
766
|
+
version,
|
|
767
|
+
igsMessageNumber: im,
|
|
768
|
+
system: "I",
|
|
769
|
+
kind: "ionosphere",
|
|
770
|
+
epochS,
|
|
771
|
+
updateIntervalS,
|
|
772
|
+
multipleMessage,
|
|
773
|
+
iodSsr,
|
|
774
|
+
providerId,
|
|
775
|
+
solutionId,
|
|
776
|
+
satellites: [],
|
|
777
|
+
iono: { qualityTecu, layers }
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
|
|
591
781
|
// src/constants/gnss.ts
|
|
592
782
|
var C_LIGHT = 299792458;
|
|
593
783
|
var FREQ = {
|
|
@@ -633,7 +823,7 @@ function legacyLockSec(i) {
|
|
|
633
823
|
if (i < 127) return 32 * i - 3096;
|
|
634
824
|
return 937;
|
|
635
825
|
}
|
|
636
|
-
var
|
|
826
|
+
var two2 = (n) => n.toString().padStart(2, "0");
|
|
637
827
|
function decodeLegacyObs(frame) {
|
|
638
828
|
const type = frame.messageType;
|
|
639
829
|
const gps = type >= 1001 && type <= 1004;
|
|
@@ -719,7 +909,7 @@ function decodeLegacyObs(frame) {
|
|
|
719
909
|
signals.push(sig);
|
|
720
910
|
}
|
|
721
911
|
observations.push({
|
|
722
|
-
prn: `${system}${
|
|
912
|
+
prn: `${system}${two2(satId)}`,
|
|
723
913
|
system,
|
|
724
914
|
signals
|
|
725
915
|
});
|
|
@@ -1351,6 +1541,168 @@ function resetGloFreqCache() {
|
|
|
1351
1541
|
gloFreqNum.fill(-128);
|
|
1352
1542
|
}
|
|
1353
1543
|
|
|
1544
|
+
// src/rtcm3/ssr.ts
|
|
1545
|
+
var UPDATE_INTERVAL_S2 = [
|
|
1546
|
+
1,
|
|
1547
|
+
2,
|
|
1548
|
+
5,
|
|
1549
|
+
10,
|
|
1550
|
+
15,
|
|
1551
|
+
30,
|
|
1552
|
+
60,
|
|
1553
|
+
120,
|
|
1554
|
+
240,
|
|
1555
|
+
300,
|
|
1556
|
+
600,
|
|
1557
|
+
900,
|
|
1558
|
+
1800,
|
|
1559
|
+
3600,
|
|
1560
|
+
7200,
|
|
1561
|
+
10800
|
|
1562
|
+
];
|
|
1563
|
+
var GPS_SIGNAL = {
|
|
1564
|
+
0: "L1 C/A",
|
|
1565
|
+
1: "L1 P",
|
|
1566
|
+
2: "L1 Z-tracking",
|
|
1567
|
+
5: "L2 C/A",
|
|
1568
|
+
6: "L2 semi-codeless",
|
|
1569
|
+
7: "L2C(M)",
|
|
1570
|
+
8: "L2C(L)",
|
|
1571
|
+
9: "L2C(M+L)",
|
|
1572
|
+
10: "L2 P",
|
|
1573
|
+
11: "L2 Z-tracking",
|
|
1574
|
+
14: "L5 I",
|
|
1575
|
+
15: "L5 Q"
|
|
1576
|
+
};
|
|
1577
|
+
var GLO_SIGNAL = {
|
|
1578
|
+
0: "G1 C/A",
|
|
1579
|
+
1: "G1 P",
|
|
1580
|
+
2: "G2 C/A",
|
|
1581
|
+
3: "G2 P"
|
|
1582
|
+
};
|
|
1583
|
+
var SSR_KIND = {
|
|
1584
|
+
1057: { system: "G", kind: "orbit" },
|
|
1585
|
+
1058: { system: "G", kind: "clock" },
|
|
1586
|
+
1059: { system: "G", kind: "codeBias" },
|
|
1587
|
+
1060: { system: "G", kind: "combined" },
|
|
1588
|
+
1061: { system: "G", kind: "ura" },
|
|
1589
|
+
1062: { system: "G", kind: "highRateClock" },
|
|
1590
|
+
1063: { system: "R", kind: "orbit" },
|
|
1591
|
+
1064: { system: "R", kind: "clock" },
|
|
1592
|
+
1065: { system: "R", kind: "codeBias" },
|
|
1593
|
+
1066: { system: "R", kind: "combined" },
|
|
1594
|
+
1067: { system: "R", kind: "ura" },
|
|
1595
|
+
1068: { system: "R", kind: "highRateClock" }
|
|
1596
|
+
};
|
|
1597
|
+
function ssrUraMm2(v) {
|
|
1598
|
+
if (v === 0) return null;
|
|
1599
|
+
const cls = v >> 3 & 7;
|
|
1600
|
+
const val = v & 7;
|
|
1601
|
+
return 3 ** cls * (1 + val / 4) - 1;
|
|
1602
|
+
}
|
|
1603
|
+
var two3 = (n) => n.toString().padStart(2, "0");
|
|
1604
|
+
function decodeSsr(frame) {
|
|
1605
|
+
const spec = SSR_KIND[frame.messageType];
|
|
1606
|
+
if (!spec) return null;
|
|
1607
|
+
const { system, kind } = spec;
|
|
1608
|
+
const gps = system === "G";
|
|
1609
|
+
const r = new BitReader(frame.payload);
|
|
1610
|
+
r.readU(12);
|
|
1611
|
+
const epochS = r.readU(gps ? 20 : 17);
|
|
1612
|
+
const updateIntervalS = UPDATE_INTERVAL_S2[r.readU(4)];
|
|
1613
|
+
const multipleMessage = r.readU(1) === 1;
|
|
1614
|
+
const hasDatum = kind === "orbit" || kind === "combined";
|
|
1615
|
+
const referenceDatum = hasDatum ? r.readU(1) : void 0;
|
|
1616
|
+
const iodSsr = r.readU(4);
|
|
1617
|
+
const providerId = r.readU(16);
|
|
1618
|
+
const solutionId = r.readU(4);
|
|
1619
|
+
const nsat = r.readU(6);
|
|
1620
|
+
const sigName = gps ? GPS_SIGNAL : GLO_SIGNAL;
|
|
1621
|
+
const satellites = [];
|
|
1622
|
+
const readOrbit = (sat) => {
|
|
1623
|
+
sat.deltaRadial = r.readS(22) * 1e-4;
|
|
1624
|
+
sat.deltaAlongTrack = r.readS(20) * 4e-4;
|
|
1625
|
+
sat.deltaCrossTrack = r.readS(20) * 4e-4;
|
|
1626
|
+
sat.dotRadial = r.readS(21) * 1e-6;
|
|
1627
|
+
sat.dotAlongTrack = r.readS(19) * 4e-6;
|
|
1628
|
+
sat.dotCrossTrack = r.readS(19) * 4e-6;
|
|
1629
|
+
};
|
|
1630
|
+
const readClock = (sat) => {
|
|
1631
|
+
sat.c0 = r.readS(22) * 1e-4;
|
|
1632
|
+
sat.c1 = r.readS(21) * 1e-6;
|
|
1633
|
+
sat.c2 = r.readS(27) * 2e-8;
|
|
1634
|
+
};
|
|
1635
|
+
for (let i = 0; i < nsat; i++) {
|
|
1636
|
+
const satId = gps ? r.readU(6) : r.readU(5);
|
|
1637
|
+
const sat = { prn: `${system}${two3(satId)}` };
|
|
1638
|
+
if (kind === "orbit" || kind === "combined") {
|
|
1639
|
+
sat.iode = r.readU(8);
|
|
1640
|
+
readOrbit(sat);
|
|
1641
|
+
}
|
|
1642
|
+
if (kind === "combined") readClock(sat);
|
|
1643
|
+
else if (kind === "clock") readClock(sat);
|
|
1644
|
+
else if (kind === "ura")
|
|
1645
|
+
sat.uraMm = ssrUraMm2(r.readU(6));
|
|
1646
|
+
else if (kind === "highRateClock")
|
|
1647
|
+
sat.highRateClock = r.readS(22) * 1e-4;
|
|
1648
|
+
else if (kind === "codeBias") {
|
|
1649
|
+
const ncb = r.readU(5);
|
|
1650
|
+
const biases = [];
|
|
1651
|
+
for (let c = 0; c < ncb; c++) {
|
|
1652
|
+
const signal = r.readU(5);
|
|
1653
|
+
const biasM = r.readS(14) * 0.01;
|
|
1654
|
+
biases.push({
|
|
1655
|
+
signal,
|
|
1656
|
+
signalName: sigName[signal] ?? `#${signal}`,
|
|
1657
|
+
biasM
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
sat.codeBiases = biases;
|
|
1661
|
+
}
|
|
1662
|
+
satellites.push(sat);
|
|
1663
|
+
}
|
|
1664
|
+
return {
|
|
1665
|
+
messageType: frame.messageType,
|
|
1666
|
+
system,
|
|
1667
|
+
kind,
|
|
1668
|
+
epochS,
|
|
1669
|
+
updateIntervalS,
|
|
1670
|
+
multipleMessage,
|
|
1671
|
+
referenceDatum,
|
|
1672
|
+
iodSsr,
|
|
1673
|
+
providerId,
|
|
1674
|
+
solutionId,
|
|
1675
|
+
satellites
|
|
1676
|
+
};
|
|
1677
|
+
}
|
|
1678
|
+
function isSsrMessage(messageType) {
|
|
1679
|
+
return messageType in SSR_KIND;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
// src/rtcm3/system-params.ts
|
|
1683
|
+
function decodeSystemParams(frame) {
|
|
1684
|
+
if (frame.messageType !== 1013) return null;
|
|
1685
|
+
const r = new BitReader(frame.payload);
|
|
1686
|
+
r.readU(12);
|
|
1687
|
+
const referenceStationId = r.readU(12);
|
|
1688
|
+
const mjd = r.readU(16);
|
|
1689
|
+
const secondsOfDay = r.readU(17);
|
|
1690
|
+
const nm = r.readU(5);
|
|
1691
|
+
const leapSeconds = r.readU(8);
|
|
1692
|
+
const messages = [];
|
|
1693
|
+
for (let i = 0; i < nm; i++) {
|
|
1694
|
+
messages.push({
|
|
1695
|
+
messageId: r.readU(12),
|
|
1696
|
+
// DF055
|
|
1697
|
+
sync: r.readU(1) === 1,
|
|
1698
|
+
// DF056
|
|
1699
|
+
intervalS: r.readU(16) * 0.1
|
|
1700
|
+
// DF057 (0.1 s)
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
return { referenceStationId, mjd, secondsOfDay, leapSeconds, messages };
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1354
1706
|
// src/rtcm3/station.ts
|
|
1355
1707
|
function createStationMeta() {
|
|
1356
1708
|
return {
|
|
@@ -1364,7 +1716,8 @@ function createStationMeta() {
|
|
|
1364
1716
|
receiverType: null,
|
|
1365
1717
|
receiverFirmware: null,
|
|
1366
1718
|
receiverSerial: null,
|
|
1367
|
-
description: null
|
|
1719
|
+
description: null,
|
|
1720
|
+
physicalRefStationId: null
|
|
1368
1721
|
};
|
|
1369
1722
|
}
|
|
1370
1723
|
function decodeStationARP(payload, msgType, meta) {
|
|
@@ -1387,6 +1740,18 @@ function decodeStationARP(payload, msgType, meta) {
|
|
|
1387
1740
|
meta.antennaHeight = r.readU(16) * 1e-4;
|
|
1388
1741
|
}
|
|
1389
1742
|
}
|
|
1743
|
+
function decodeStation1032(payload, meta) {
|
|
1744
|
+
if (payload.length < 19) return;
|
|
1745
|
+
const r = new BitReader(payload);
|
|
1746
|
+
r.skip(12);
|
|
1747
|
+
meta.stationId = r.readU(12);
|
|
1748
|
+
meta.physicalRefStationId = r.readU(12);
|
|
1749
|
+
meta.itrf = r.readU(6);
|
|
1750
|
+
const x = r.readS(38) * 1e-4;
|
|
1751
|
+
const y = r.readS(38) * 1e-4;
|
|
1752
|
+
const z = r.readS(38) * 1e-4;
|
|
1753
|
+
if (x !== 0 || y !== 0 || z !== 0) meta.position = [x, y, z];
|
|
1754
|
+
}
|
|
1390
1755
|
function decodeAntennaDescriptor(payload, msgType, meta) {
|
|
1391
1756
|
if (payload.length < 5) return;
|
|
1392
1757
|
const r = new BitReader(payload);
|
|
@@ -1467,6 +1832,9 @@ function updateStationMeta(meta, frame) {
|
|
|
1467
1832
|
case 1006:
|
|
1468
1833
|
decodeStationARP(frame.payload, frame.messageType, meta);
|
|
1469
1834
|
return true;
|
|
1835
|
+
case 1032:
|
|
1836
|
+
decodeStation1032(frame.payload, meta);
|
|
1837
|
+
return true;
|
|
1470
1838
|
case 1007:
|
|
1471
1839
|
case 1008:
|
|
1472
1840
|
decodeAntennaDescriptor(frame.payload, frame.messageType, meta);
|
|
@@ -1701,8 +2069,12 @@ function updateStreamStats(stats, frames, rawBytes) {
|
|
|
1701
2069
|
createStationMeta,
|
|
1702
2070
|
createStreamStats,
|
|
1703
2071
|
decodeEphemeris,
|
|
2072
|
+
decodeIgsSsr,
|
|
1704
2073
|
decodeLegacyObs,
|
|
1705
2074
|
decodeMsmFull,
|
|
2075
|
+
decodeSsr,
|
|
2076
|
+
decodeSystemParams,
|
|
2077
|
+
isSsrMessage,
|
|
1706
2078
|
msmEpochToDate,
|
|
1707
2079
|
readString,
|
|
1708
2080
|
reportDecodeError,
|
package/dist/rtcm3.d.cts
CHANGED
|
@@ -1,6 +1,121 @@
|
|
|
1
1
|
import { b as Rtcm3Frame, E as EphemerisInfo } from './ephemeris-Ohl6NAfw.cjs';
|
|
2
2
|
export { B as BitReader, R as Rtcm3DebugHandler, a as Rtcm3Decoder, d as decodeEphemeris, r as readString, c as reportDecodeError, s as setRtcm3DebugHandler } from './ephemeris-Ohl6NAfw.cjs';
|
|
3
3
|
|
|
4
|
+
/** One code bias for a specific signal (DF380/DF381 + DF383). */
|
|
5
|
+
interface SsrCodeBias {
|
|
6
|
+
/** Signal & tracking-mode indicator (DF380 GPS / DF381 GLONASS). */
|
|
7
|
+
signal: number;
|
|
8
|
+
/** Human-readable signal name. */
|
|
9
|
+
signalName: string;
|
|
10
|
+
/** Code bias (metres). */
|
|
11
|
+
biasM: number;
|
|
12
|
+
}
|
|
13
|
+
/** One phase bias for a signal — IGS-SSR (4076 IGM06) only. */
|
|
14
|
+
interface SsrPhaseBias {
|
|
15
|
+
signal: number;
|
|
16
|
+
/** Bias is a fixable integer number of cycles. */
|
|
17
|
+
integer: boolean;
|
|
18
|
+
/** Wide-lane integer group indicator (0–3). */
|
|
19
|
+
wideLaneGroup: number;
|
|
20
|
+
/** Discontinuity counter — increments on a phase-bias reset/slip. */
|
|
21
|
+
discontinuity: number;
|
|
22
|
+
/** Phase bias (metres). */
|
|
23
|
+
biasM: number;
|
|
24
|
+
}
|
|
25
|
+
/** Per-satellite SSR correction (fields present depend on the message kind). */
|
|
26
|
+
interface SsrSatCorrection {
|
|
27
|
+
prn: string;
|
|
28
|
+
/** Issue of data ephemeris this correction refers to (orbit/combined msgs). */
|
|
29
|
+
iode?: number;
|
|
30
|
+
/** Orbit correction in the radial/along/cross frame (metres). */
|
|
31
|
+
deltaRadial?: number;
|
|
32
|
+
deltaAlongTrack?: number;
|
|
33
|
+
deltaCrossTrack?: number;
|
|
34
|
+
/** Orbit correction rate (m/s). */
|
|
35
|
+
dotRadial?: number;
|
|
36
|
+
dotAlongTrack?: number;
|
|
37
|
+
dotCrossTrack?: number;
|
|
38
|
+
/** Clock correction polynomial: c0 (m), c1 (m/s), c2 (m/s²). */
|
|
39
|
+
c0?: number;
|
|
40
|
+
c1?: number;
|
|
41
|
+
c2?: number;
|
|
42
|
+
/** High-rate clock correction (metres), added to the c0/c1/c2 polynomial. */
|
|
43
|
+
highRateClock?: number;
|
|
44
|
+
/** User range accuracy, 1σ (mm); null when undefined/unknown. */
|
|
45
|
+
uraMm?: number | null;
|
|
46
|
+
/** Per-signal code biases. */
|
|
47
|
+
codeBiases?: SsrCodeBias[];
|
|
48
|
+
/** Per-signal phase biases (IGS-SSR 4076 only). */
|
|
49
|
+
phaseBiases?: SsrPhaseBias[];
|
|
50
|
+
}
|
|
51
|
+
type SsrKind = 'orbit' | 'clock' | 'codeBias' | 'combined' | 'ura' | 'highRateClock';
|
|
52
|
+
/** A decoded SSR message (one of 1057–1068). */
|
|
53
|
+
interface SsrMessage {
|
|
54
|
+
messageType: number;
|
|
55
|
+
/** System letter: 'G' (GPS) or 'R' (GLONASS). */
|
|
56
|
+
system: 'G' | 'R';
|
|
57
|
+
kind: SsrKind;
|
|
58
|
+
/** Epoch time: seconds of GPS week (GPS) or seconds of GLONASS day (GLONASS). */
|
|
59
|
+
epochS: number;
|
|
60
|
+
/** SSR update interval (seconds) decoded from DF391. */
|
|
61
|
+
updateIntervalS: number;
|
|
62
|
+
/** True when more SSR messages for this epoch follow (DF388). */
|
|
63
|
+
multipleMessage: boolean;
|
|
64
|
+
/** Satellite reference datum (orbit/combined only): 0 = ITRF, 1 = regional. */
|
|
65
|
+
referenceDatum?: number;
|
|
66
|
+
iodSsr: number;
|
|
67
|
+
providerId: number;
|
|
68
|
+
solutionId: number;
|
|
69
|
+
satellites: SsrSatCorrection[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Decode an RTCM3 SSR message (1057–1068) into an {@link SsrMessage}, or null
|
|
73
|
+
* for any other message type.
|
|
74
|
+
*/
|
|
75
|
+
declare function decodeSsr(frame: Rtcm3Frame): SsrMessage | null;
|
|
76
|
+
/** True if the message type is an RTCM3 SSR correction (1057–1068). */
|
|
77
|
+
declare function isSsrMessage(messageType: number): boolean;
|
|
78
|
+
|
|
79
|
+
/** A decoded IGS-SSR (4076) message. */
|
|
80
|
+
interface IgsSsrMessage {
|
|
81
|
+
messageType: 4076;
|
|
82
|
+
/** IGS SSR format version (IDF001). */
|
|
83
|
+
version: number;
|
|
84
|
+
/** IGS Message Number / subtype (IDF002). */
|
|
85
|
+
igsMessageNumber: number;
|
|
86
|
+
/** System letter, or 'I' for the ionosphere (VTEC) message. */
|
|
87
|
+
system: 'G' | 'R' | 'E' | 'J' | 'C' | 'S' | 'I';
|
|
88
|
+
kind: SsrKind | 'phaseBias' | 'ionosphere';
|
|
89
|
+
epochS: number;
|
|
90
|
+
updateIntervalS: number;
|
|
91
|
+
multipleMessage: boolean;
|
|
92
|
+
referenceDatum?: number;
|
|
93
|
+
iodSsr: number;
|
|
94
|
+
providerId: number;
|
|
95
|
+
solutionId: number;
|
|
96
|
+
/** Phase-bias header consistency indicators (phaseBias only). */
|
|
97
|
+
dispersiveConsistency?: boolean;
|
|
98
|
+
mwConsistency?: boolean;
|
|
99
|
+
satellites: SsrSatCorrection[];
|
|
100
|
+
/** Ionosphere summary (IM201 only). */
|
|
101
|
+
iono?: {
|
|
102
|
+
qualityTecu: number;
|
|
103
|
+
layers: IgsSsrIonoLayer[];
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** One ionospheric layer header (IM201). */
|
|
107
|
+
interface IgsSsrIonoLayer {
|
|
108
|
+
heightKm: number;
|
|
109
|
+
degree: number;
|
|
110
|
+
order: number;
|
|
111
|
+
coefficientCount: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Decode an RTCM3 IGS-SSR message (4076) into an {@link IgsSsrMessage}, or null
|
|
115
|
+
* if the frame is not 4076 or carries an unrecognised subtype.
|
|
116
|
+
*/
|
|
117
|
+
declare function decodeIgsSsr(frame: Rtcm3Frame): IgsSsrMessage | null;
|
|
118
|
+
|
|
4
119
|
/**
|
|
5
120
|
* Full RTCM3 MSM4-7 decoder — extracts pseudorange, carrier phase,
|
|
6
121
|
* Doppler, and C/N0 for every satellite × signal cell.
|
|
@@ -88,6 +203,33 @@ declare function resetGloFreqCache(): void;
|
|
|
88
203
|
*/
|
|
89
204
|
declare function decodeLegacyObs(frame: Rtcm3Frame): MsmEpoch | null;
|
|
90
205
|
|
|
206
|
+
/** One announced message in the station's schedule (DF055/DF056/DF057). */
|
|
207
|
+
interface SystemParamsMessage {
|
|
208
|
+
/** RTCM message type the station broadcasts. */
|
|
209
|
+
messageId: number;
|
|
210
|
+
/** Synchronous flag. */
|
|
211
|
+
sync: boolean;
|
|
212
|
+
/** Transmission interval (seconds; 0.1 s resolution per DF057). */
|
|
213
|
+
intervalS: number;
|
|
214
|
+
}
|
|
215
|
+
/** Decoded RTCM3 System Parameters (message 1013). */
|
|
216
|
+
interface SystemParams {
|
|
217
|
+
referenceStationId: number;
|
|
218
|
+
/** Modified Julian Day number of the reference epoch. */
|
|
219
|
+
mjd: number;
|
|
220
|
+
/** Seconds of day (UTC) of the reference epoch. */
|
|
221
|
+
secondsOfDay: number;
|
|
222
|
+
/** Current GPS−UTC leap seconds. */
|
|
223
|
+
leapSeconds: number;
|
|
224
|
+
/** The message types this station announces it transmits. */
|
|
225
|
+
messages: SystemParamsMessage[];
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Decode an RTCM3 System Parameters message (1013), or null for any other type
|
|
229
|
+
* or a short/corrupt frame.
|
|
230
|
+
*/
|
|
231
|
+
declare function decodeSystemParams(frame: Rtcm3Frame): SystemParams | null;
|
|
232
|
+
|
|
91
233
|
/**
|
|
92
234
|
* RTCM3 station metadata decoders (messages 1005/1006, 1007/1008, 1029, 1033).
|
|
93
235
|
*/
|
|
@@ -104,6 +246,7 @@ interface StationMeta {
|
|
|
104
246
|
receiverFirmware: string | null;
|
|
105
247
|
receiverSerial: string | null;
|
|
106
248
|
description: string | null;
|
|
249
|
+
physicalRefStationId: number | null;
|
|
107
250
|
}
|
|
108
251
|
declare function createStationMeta(): StationMeta;
|
|
109
252
|
/** Update station metadata from an RTCM3 frame. Returns true if the frame was a metadata message. */
|
|
@@ -160,4 +303,4 @@ declare function rtcm3Constellation(msgType: number): string | null;
|
|
|
160
303
|
declare function createStreamStats(): StreamStats;
|
|
161
304
|
declare function updateStreamStats(stats: StreamStats, frames: Rtcm3Frame[], rawBytes: number): void;
|
|
162
305
|
|
|
163
|
-
export { EphemerisInfo, type MessageTypeStats, type MsmEpoch, type MsmSatObs, type MsmSignal, RTCM3_MESSAGE_NAMES, Rtcm3Frame, type SatCn0, type SignalCn0, type StationMeta, type StreamStats, createStationMeta, createStreamStats, decodeLegacyObs, decodeMsmFull, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats };
|
|
306
|
+
export { EphemerisInfo, type IgsSsrIonoLayer, type IgsSsrMessage, type MessageTypeStats, type MsmEpoch, type MsmSatObs, type MsmSignal, RTCM3_MESSAGE_NAMES, Rtcm3Frame, type SatCn0, type SignalCn0, type SsrCodeBias, type SsrKind, type SsrMessage, type SsrPhaseBias, type SsrSatCorrection, type StationMeta, type StreamStats, type SystemParams, type SystemParamsMessage, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeSsr, decodeSystemParams, isSsrMessage, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats };
|