gnss-js 1.63.0 → 1.64.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/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, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeSsr, 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, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeSsr, 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,11 @@ import {
275
275
  createStationMeta,
276
276
  createStreamStats,
277
277
  decodeEphemeris,
278
+ decodeIgsSsr,
278
279
  decodeLegacyObs,
279
280
  decodeMsmFull,
281
+ decodeSsr,
282
+ isSsrMessage,
280
283
  msmEpochToDate,
281
284
  readString,
282
285
  reportDecodeError,
@@ -286,7 +289,7 @@ import {
286
289
  setRtcm3DebugHandler,
287
290
  updateStationMeta,
288
291
  updateStreamStats
289
- } from "./chunk-QN7Q2ALS.js";
292
+ } from "./chunk-5SQLUGWE.js";
290
293
  import {
291
294
  getBdsTime,
292
295
  getDateFromBdsTime,
@@ -495,9 +498,11 @@ export {
495
498
  dateToEpoch,
496
499
  decodeBinexEph,
497
500
  decodeEphemeris,
501
+ decodeIgsSsr,
498
502
  decodeLegacyObs,
499
503
  decodeMsmFull,
500
504
  decodeSbfNavigation,
505
+ decodeSsr,
501
506
  deg2dms,
502
507
  deg2rad,
503
508
  detrendIonoArcs,
@@ -590,6 +595,7 @@ export {
590
595
  ionoFree,
591
596
  isSbasL1Preamble,
592
597
  isSbasL5Correction,
598
+ isSsrMessage,
593
599
  keplerPosition,
594
600
  klobucharDelay,
595
601
  lambdaReduction,
package/dist/rtcm3.cjs CHANGED
@@ -26,8 +26,11 @@ __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
+ isSsrMessage: () => isSsrMessage,
31
34
  msmEpochToDate: () => msmEpochToDate,
32
35
  readString: () => readString,
33
36
  reportDecodeError: () => reportDecodeError,
@@ -588,6 +591,192 @@ function decodeEphemeris(frame) {
588
591
  }
589
592
  }
590
593
 
594
+ // src/rtcm3/igs-ssr.ts
595
+ var UPDATE_INTERVAL_S = [
596
+ 1,
597
+ 2,
598
+ 5,
599
+ 10,
600
+ 15,
601
+ 30,
602
+ 60,
603
+ 120,
604
+ 240,
605
+ 300,
606
+ 600,
607
+ 900,
608
+ 1800,
609
+ 3600,
610
+ 7200,
611
+ 10800
612
+ ];
613
+ var SYSTEM_BY_BASE = {
614
+ 20: "G",
615
+ 40: "R",
616
+ 60: "E",
617
+ 80: "J",
618
+ 100: "C",
619
+ 120: "S"
620
+ };
621
+ var KIND_BY_OFFSET = {
622
+ 1: "orbit",
623
+ 2: "clock",
624
+ 3: "combined",
625
+ 4: "highRateClock",
626
+ 5: "codeBias",
627
+ 6: "phaseBias",
628
+ 7: "ura"
629
+ };
630
+ var two = (n) => n.toString().padStart(2, "0");
631
+ function prnFor(system, id) {
632
+ if (system === "J") return `J${two(id)}`;
633
+ if (system === "S") return `S${two(19 + id)}`;
634
+ return `${system}${two(id)}`;
635
+ }
636
+ function ssrUraMm(v) {
637
+ if (v === 0) return null;
638
+ const cls = v >> 3 & 7;
639
+ const val = v & 7;
640
+ return 3 ** cls * (1 + val / 4) - 1;
641
+ }
642
+ function decodeIgsSsr(frame) {
643
+ if (frame.messageType !== 4076) return null;
644
+ const r = new BitReader(frame.payload);
645
+ r.readU(12);
646
+ const version = r.readU(3);
647
+ const im = r.readU(8);
648
+ if (im === 201) return decodeIono(r, version, im);
649
+ const base = Math.floor(im / 20) * 20;
650
+ const system = SYSTEM_BY_BASE[base];
651
+ const kind = KIND_BY_OFFSET[im - base];
652
+ if (!system || !kind) return null;
653
+ const epochS = r.readU(20);
654
+ const updateIntervalS = UPDATE_INTERVAL_S[r.readU(4)];
655
+ const multipleMessage = r.readU(1) === 1;
656
+ const iodSsr = r.readU(4);
657
+ const providerId = r.readU(16);
658
+ const solutionId = r.readU(4);
659
+ const hasDatum = kind === "orbit" || kind === "combined";
660
+ const referenceDatum = hasDatum ? r.readU(1) : void 0;
661
+ let dispersiveConsistency;
662
+ let mwConsistency;
663
+ if (kind === "phaseBias") {
664
+ dispersiveConsistency = r.readU(1) === 1;
665
+ mwConsistency = r.readU(1) === 1;
666
+ }
667
+ const nsat = r.readU(6);
668
+ const readOrbit = (s) => {
669
+ s.iode = r.readU(8);
670
+ s.deltaRadial = r.readS(22) * 1e-4;
671
+ s.deltaAlongTrack = r.readS(20) * 4e-4;
672
+ s.deltaCrossTrack = r.readS(20) * 4e-4;
673
+ s.dotRadial = r.readS(21) * 1e-6;
674
+ s.dotAlongTrack = r.readS(19) * 4e-6;
675
+ s.dotCrossTrack = r.readS(19) * 4e-6;
676
+ };
677
+ const readClock = (s) => {
678
+ s.c0 = r.readS(22) * 1e-4;
679
+ s.c1 = r.readS(21) * 1e-6;
680
+ s.c2 = r.readS(27) * 2e-8;
681
+ };
682
+ const satellites = [];
683
+ for (let i = 0; i < nsat; i++) {
684
+ const id = r.readU(6);
685
+ const sat = { prn: prnFor(system, id) };
686
+ if (kind === "orbit" || kind === "combined") readOrbit(sat);
687
+ if (kind === "clock" || kind === "combined") readClock(sat);
688
+ else if (kind === "ura")
689
+ sat.uraMm = ssrUraMm(r.readU(6));
690
+ else if (kind === "highRateClock")
691
+ sat.highRateClock = r.readS(22) * 1e-4;
692
+ else if (kind === "codeBias") {
693
+ const n = r.readU(5);
694
+ const biases = [];
695
+ for (let b = 0; b < n; b++) {
696
+ const signal = r.readU(5);
697
+ biases.push({
698
+ signal,
699
+ signalName: `#${signal}`,
700
+ biasM: r.readS(14) * 0.01
701
+ // IDF025 0.01 m
702
+ });
703
+ }
704
+ sat.codeBiases = biases;
705
+ } else if (kind === "phaseBias") {
706
+ const n = r.readU(5);
707
+ r.readU(9);
708
+ r.readS(8);
709
+ const biases = [];
710
+ for (let b = 0; b < n; b++) {
711
+ const signal = r.readU(5);
712
+ const integer = r.readU(1) === 1;
713
+ const wideLaneGroup = r.readU(2);
714
+ const discontinuity = r.readU(4);
715
+ const biasM = r.readS(20) * 1e-4;
716
+ biases.push({ signal, integer, wideLaneGroup, discontinuity, biasM });
717
+ }
718
+ sat.phaseBiases = biases;
719
+ }
720
+ satellites.push(sat);
721
+ }
722
+ return {
723
+ messageType: 4076,
724
+ version,
725
+ igsMessageNumber: im,
726
+ system,
727
+ kind,
728
+ epochS,
729
+ updateIntervalS,
730
+ multipleMessage,
731
+ referenceDatum,
732
+ iodSsr,
733
+ providerId,
734
+ solutionId,
735
+ dispersiveConsistency,
736
+ mwConsistency,
737
+ satellites
738
+ };
739
+ }
740
+ function decodeIono(r, version, im) {
741
+ const epochS = r.readU(20);
742
+ const updateIntervalS = UPDATE_INTERVAL_S[r.readU(4)];
743
+ const multipleMessage = r.readU(1) === 1;
744
+ const iodSsr = r.readU(4);
745
+ const providerId = r.readU(16);
746
+ const solutionId = r.readU(4);
747
+ const qualityTecu = r.readU(9) * 0.05;
748
+ const nLayers = r.readU(2) + 1;
749
+ const layers = [];
750
+ for (let l = 0; l < nLayers; l++) {
751
+ const heightKm = r.readU(8) * 10;
752
+ const degree = r.readU(4) + 1;
753
+ const order = r.readU(4) + 1;
754
+ const N = degree;
755
+ const M = order;
756
+ const nCoef = (N + 1) * (N + 1) - (N - M) * (N - M + 1);
757
+ const nCos = nCoef;
758
+ let nSin = 0;
759
+ for (let m = 1; m <= M; m++) nSin += N - m + 1;
760
+ for (let i = 0; i < nCos + nSin; i++) r.readS(16);
761
+ layers.push({ heightKm, degree, order, coefficientCount: nCos + nSin });
762
+ }
763
+ return {
764
+ messageType: 4076,
765
+ version,
766
+ igsMessageNumber: im,
767
+ system: "I",
768
+ kind: "ionosphere",
769
+ epochS,
770
+ updateIntervalS,
771
+ multipleMessage,
772
+ iodSsr,
773
+ providerId,
774
+ solutionId,
775
+ satellites: [],
776
+ iono: { qualityTecu, layers }
777
+ };
778
+ }
779
+
591
780
  // src/constants/gnss.ts
592
781
  var C_LIGHT = 299792458;
593
782
  var FREQ = {
@@ -633,7 +822,7 @@ function legacyLockSec(i) {
633
822
  if (i < 127) return 32 * i - 3096;
634
823
  return 937;
635
824
  }
636
- var two = (n) => n.toString().padStart(2, "0");
825
+ var two2 = (n) => n.toString().padStart(2, "0");
637
826
  function decodeLegacyObs(frame) {
638
827
  const type = frame.messageType;
639
828
  const gps = type >= 1001 && type <= 1004;
@@ -719,7 +908,7 @@ function decodeLegacyObs(frame) {
719
908
  signals.push(sig);
720
909
  }
721
910
  observations.push({
722
- prn: `${system}${two(satId)}`,
911
+ prn: `${system}${two2(satId)}`,
723
912
  system,
724
913
  signals
725
914
  });
@@ -1351,6 +1540,144 @@ function resetGloFreqCache() {
1351
1540
  gloFreqNum.fill(-128);
1352
1541
  }
1353
1542
 
1543
+ // src/rtcm3/ssr.ts
1544
+ var UPDATE_INTERVAL_S2 = [
1545
+ 1,
1546
+ 2,
1547
+ 5,
1548
+ 10,
1549
+ 15,
1550
+ 30,
1551
+ 60,
1552
+ 120,
1553
+ 240,
1554
+ 300,
1555
+ 600,
1556
+ 900,
1557
+ 1800,
1558
+ 3600,
1559
+ 7200,
1560
+ 10800
1561
+ ];
1562
+ var GPS_SIGNAL = {
1563
+ 0: "L1 C/A",
1564
+ 1: "L1 P",
1565
+ 2: "L1 Z-tracking",
1566
+ 5: "L2 C/A",
1567
+ 6: "L2 semi-codeless",
1568
+ 7: "L2C(M)",
1569
+ 8: "L2C(L)",
1570
+ 9: "L2C(M+L)",
1571
+ 10: "L2 P",
1572
+ 11: "L2 Z-tracking",
1573
+ 14: "L5 I",
1574
+ 15: "L5 Q"
1575
+ };
1576
+ var GLO_SIGNAL = {
1577
+ 0: "G1 C/A",
1578
+ 1: "G1 P",
1579
+ 2: "G2 C/A",
1580
+ 3: "G2 P"
1581
+ };
1582
+ var SSR_KIND = {
1583
+ 1057: { system: "G", kind: "orbit" },
1584
+ 1058: { system: "G", kind: "clock" },
1585
+ 1059: { system: "G", kind: "codeBias" },
1586
+ 1060: { system: "G", kind: "combined" },
1587
+ 1061: { system: "G", kind: "ura" },
1588
+ 1062: { system: "G", kind: "highRateClock" },
1589
+ 1063: { system: "R", kind: "orbit" },
1590
+ 1064: { system: "R", kind: "clock" },
1591
+ 1065: { system: "R", kind: "codeBias" },
1592
+ 1066: { system: "R", kind: "combined" },
1593
+ 1067: { system: "R", kind: "ura" },
1594
+ 1068: { system: "R", kind: "highRateClock" }
1595
+ };
1596
+ function ssrUraMm2(v) {
1597
+ if (v === 0) return null;
1598
+ const cls = v >> 3 & 7;
1599
+ const val = v & 7;
1600
+ return 3 ** cls * (1 + val / 4) - 1;
1601
+ }
1602
+ var two3 = (n) => n.toString().padStart(2, "0");
1603
+ function decodeSsr(frame) {
1604
+ const spec = SSR_KIND[frame.messageType];
1605
+ if (!spec) return null;
1606
+ const { system, kind } = spec;
1607
+ const gps = system === "G";
1608
+ const r = new BitReader(frame.payload);
1609
+ r.readU(12);
1610
+ const epochS = r.readU(gps ? 20 : 17);
1611
+ const updateIntervalS = UPDATE_INTERVAL_S2[r.readU(4)];
1612
+ const multipleMessage = r.readU(1) === 1;
1613
+ const hasDatum = kind === "orbit" || kind === "combined";
1614
+ const referenceDatum = hasDatum ? r.readU(1) : void 0;
1615
+ const iodSsr = r.readU(4);
1616
+ const providerId = r.readU(16);
1617
+ const solutionId = r.readU(4);
1618
+ const nsat = r.readU(6);
1619
+ const sigName = gps ? GPS_SIGNAL : GLO_SIGNAL;
1620
+ const satellites = [];
1621
+ const readOrbit = (sat) => {
1622
+ sat.deltaRadial = r.readS(22) * 1e-4;
1623
+ sat.deltaAlongTrack = r.readS(20) * 4e-4;
1624
+ sat.deltaCrossTrack = r.readS(20) * 4e-4;
1625
+ sat.dotRadial = r.readS(21) * 1e-6;
1626
+ sat.dotAlongTrack = r.readS(19) * 4e-6;
1627
+ sat.dotCrossTrack = r.readS(19) * 4e-6;
1628
+ };
1629
+ const readClock = (sat) => {
1630
+ sat.c0 = r.readS(22) * 1e-4;
1631
+ sat.c1 = r.readS(21) * 1e-6;
1632
+ sat.c2 = r.readS(27) * 2e-8;
1633
+ };
1634
+ for (let i = 0; i < nsat; i++) {
1635
+ const satId = gps ? r.readU(6) : r.readU(5);
1636
+ const sat = { prn: `${system}${two3(satId)}` };
1637
+ if (kind === "orbit" || kind === "combined") {
1638
+ sat.iode = r.readU(8);
1639
+ readOrbit(sat);
1640
+ }
1641
+ if (kind === "combined") readClock(sat);
1642
+ else if (kind === "clock") readClock(sat);
1643
+ else if (kind === "ura")
1644
+ sat.uraMm = ssrUraMm2(r.readU(6));
1645
+ else if (kind === "highRateClock")
1646
+ sat.highRateClock = r.readS(22) * 1e-4;
1647
+ else if (kind === "codeBias") {
1648
+ const ncb = r.readU(5);
1649
+ const biases = [];
1650
+ for (let c = 0; c < ncb; c++) {
1651
+ const signal = r.readU(5);
1652
+ const biasM = r.readS(14) * 0.01;
1653
+ biases.push({
1654
+ signal,
1655
+ signalName: sigName[signal] ?? `#${signal}`,
1656
+ biasM
1657
+ });
1658
+ }
1659
+ sat.codeBiases = biases;
1660
+ }
1661
+ satellites.push(sat);
1662
+ }
1663
+ return {
1664
+ messageType: frame.messageType,
1665
+ system,
1666
+ kind,
1667
+ epochS,
1668
+ updateIntervalS,
1669
+ multipleMessage,
1670
+ referenceDatum,
1671
+ iodSsr,
1672
+ providerId,
1673
+ solutionId,
1674
+ satellites
1675
+ };
1676
+ }
1677
+ function isSsrMessage(messageType) {
1678
+ return messageType in SSR_KIND;
1679
+ }
1680
+
1354
1681
  // src/rtcm3/station.ts
1355
1682
  function createStationMeta() {
1356
1683
  return {
@@ -1701,8 +2028,11 @@ function updateStreamStats(stats, frames, rawBytes) {
1701
2028
  createStationMeta,
1702
2029
  createStreamStats,
1703
2030
  decodeEphemeris,
2031
+ decodeIgsSsr,
1704
2032
  decodeLegacyObs,
1705
2033
  decodeMsmFull,
2034
+ decodeSsr,
2035
+ isSsrMessage,
1706
2036
  msmEpochToDate,
1707
2037
  readString,
1708
2038
  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.
@@ -160,4 +275,4 @@ declare function rtcm3Constellation(msgType: number): string | null;
160
275
  declare function createStreamStats(): StreamStats;
161
276
  declare function updateStreamStats(stats: StreamStats, frames: Rtcm3Frame[], rawBytes: number): void;
162
277
 
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 };
278
+ 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, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeSsr, isSsrMessage, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats };
package/dist/rtcm3.d.ts CHANGED
@@ -1,6 +1,121 @@
1
1
  import { b as Rtcm3Frame, E as EphemerisInfo } from './ephemeris-Ohl6NAfw.js';
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.js';
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.
@@ -160,4 +275,4 @@ declare function rtcm3Constellation(msgType: number): string | null;
160
275
  declare function createStreamStats(): StreamStats;
161
276
  declare function updateStreamStats(stats: StreamStats, frames: Rtcm3Frame[], rawBytes: number): void;
162
277
 
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 };
278
+ 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, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeSsr, isSsrMessage, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats };