gnss-js 1.62.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, 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, 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,7 +275,11 @@ import {
275
275
  createStationMeta,
276
276
  createStreamStats,
277
277
  decodeEphemeris,
278
+ decodeIgsSsr,
279
+ decodeLegacyObs,
278
280
  decodeMsmFull,
281
+ decodeSsr,
282
+ isSsrMessage,
279
283
  msmEpochToDate,
280
284
  readString,
281
285
  reportDecodeError,
@@ -285,7 +289,7 @@ import {
285
289
  setRtcm3DebugHandler,
286
290
  updateStationMeta,
287
291
  updateStreamStats
288
- } from "./chunk-BRT6XZ7B.js";
292
+ } from "./chunk-5SQLUGWE.js";
289
293
  import {
290
294
  getBdsTime,
291
295
  getDateFromBdsTime,
@@ -494,8 +498,11 @@ export {
494
498
  dateToEpoch,
495
499
  decodeBinexEph,
496
500
  decodeEphemeris,
501
+ decodeIgsSsr,
502
+ decodeLegacyObs,
497
503
  decodeMsmFull,
498
504
  decodeSbfNavigation,
505
+ decodeSsr,
499
506
  deg2dms,
500
507
  deg2rad,
501
508
  detrendIonoArcs,
@@ -588,6 +595,7 @@ export {
588
595
  ionoFree,
589
596
  isSbasL1Preamble,
590
597
  isSbasL5Correction,
598
+ isSsrMessage,
591
599
  keplerPosition,
592
600
  klobucharDelay,
593
601
  lambdaReduction,
package/dist/rtcm3.cjs CHANGED
@@ -26,7 +26,11 @@ __export(rtcm3_exports, {
26
26
  createStationMeta: () => createStationMeta,
27
27
  createStreamStats: () => createStreamStats,
28
28
  decodeEphemeris: () => decodeEphemeris,
29
+ decodeIgsSsr: () => decodeIgsSsr,
30
+ decodeLegacyObs: () => decodeLegacyObs,
29
31
  decodeMsmFull: () => decodeMsmFull,
32
+ decodeSsr: () => decodeSsr,
33
+ isSsrMessage: () => isSsrMessage,
30
34
  msmEpochToDate: () => msmEpochToDate,
31
35
  readString: () => readString,
32
36
  reportDecodeError: () => reportDecodeError,
@@ -587,6 +591,331 @@ function decodeEphemeris(frame) {
587
591
  }
588
592
  }
589
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
+
780
+ // src/constants/gnss.ts
781
+ var C_LIGHT = 299792458;
782
+ var FREQ = {
783
+ G: { "1": 157542e4, "2": 12276e5, "5": 117645e4 },
784
+ // R bands 4/6 are the CDMA L1OC/L2OC center frequencies
785
+ R: { "3": 1202025e3, "4": 1600995e3, "6": 124806e4 },
786
+ E: {
787
+ "1": 157542e4,
788
+ "5": 117645e4,
789
+ "6": 127875e4,
790
+ "7": 120714e4,
791
+ "8": 1191795e3
792
+ },
793
+ C: {
794
+ "1": 157542e4,
795
+ "2": 1561098e3,
796
+ "5": 117645e4,
797
+ "6": 126852e4,
798
+ "7": 120714e4
799
+ },
800
+ J: { "1": 157542e4, "2": 12276e5, "5": 117645e4, "6": 127875e4 },
801
+ I: { "5": 117645e4, "9": 2492028e3 },
802
+ S: { "1": 157542e4, "5": 117645e4 }
803
+ };
804
+ var GLO_F1_BASE = 1602e6;
805
+ var GLO_F1_STEP = 562500;
806
+ var GLO_F2_BASE = 1246e6;
807
+ var GLO_F2_STEP = 437500;
808
+
809
+ // src/rtcm3/legacy-obs.ts
810
+ var PRUNIT_GPS = 299792.458;
811
+ var PRUNIT_GLO = 599584.916;
812
+ var LAM_GPS_L1 = C_LIGHT / 157542e4;
813
+ var LAM_GPS_L2 = C_LIGHT / 12276e5;
814
+ var PPR_INVALID = -(2 ** 19);
815
+ var PR21_INVALID = -(2 ** 13);
816
+ function legacyLockSec(i) {
817
+ if (i < 24) return i;
818
+ if (i < 48) return 2 * i - 24;
819
+ if (i < 72) return 4 * i - 120;
820
+ if (i < 96) return 8 * i - 408;
821
+ if (i < 120) return 16 * i - 1176;
822
+ if (i < 127) return 32 * i - 3096;
823
+ return 937;
824
+ }
825
+ var two2 = (n) => n.toString().padStart(2, "0");
826
+ function decodeLegacyObs(frame) {
827
+ const type = frame.messageType;
828
+ const gps = type >= 1001 && type <= 1004;
829
+ const glo = type >= 1009 && type <= 1012;
830
+ if (!gps && !glo) return null;
831
+ const ext = type === 1002 || type === 1004 || type === 1010 || type === 1012;
832
+ const dual = type === 1003 || type === 1004 || type === 1011 || type === 1012;
833
+ const system = gps ? "G" : "R";
834
+ const r = new BitReader(frame.payload);
835
+ r.readU(12);
836
+ r.readU(12);
837
+ let epochMs;
838
+ let nsat;
839
+ if (gps) {
840
+ epochMs = r.readU(30);
841
+ r.readU(1);
842
+ nsat = r.readU(5);
843
+ r.readU(1);
844
+ r.readU(3);
845
+ } else {
846
+ const tk = r.readU(27);
847
+ r.readU(1);
848
+ nsat = r.readU(5);
849
+ r.readU(1);
850
+ r.readU(3);
851
+ const gloDow = new Date(Date.now() + 3 * 36e5).getUTCDay();
852
+ epochMs = (gloDow << 27 | tk) >>> 0;
853
+ }
854
+ const observations = [];
855
+ for (let s = 0; s < nsat; s++) {
856
+ const satId = r.readU(6);
857
+ const code1 = r.readU(1);
858
+ const freqCh = glo ? r.readU(5) : 0;
859
+ const pr1raw = r.readU(gps ? 24 : 25);
860
+ const ppr1 = r.readS(20);
861
+ const lock1 = r.readU(7);
862
+ let amb = 0;
863
+ let cnr1 = 0;
864
+ if (ext) {
865
+ amb = r.readU(gps ? 8 : 7);
866
+ cnr1 = r.readU(8);
867
+ }
868
+ let code2 = 0;
869
+ let pr21 = 0;
870
+ let ppr2 = 0;
871
+ let lock2 = 0;
872
+ let cnr2 = 0;
873
+ if (dual) {
874
+ code2 = r.readU(2);
875
+ pr21 = r.readS(14);
876
+ ppr2 = r.readS(20);
877
+ lock2 = r.readU(7);
878
+ if (ext) cnr2 = r.readU(8);
879
+ }
880
+ if (gps && (satId < 1 || satId > 32)) continue;
881
+ if (glo && (satId < 1 || satId > 24)) continue;
882
+ const prunit = gps ? PRUNIT_GPS : PRUNIT_GLO;
883
+ const pr1 = pr1raw * 0.02 + amb * prunit;
884
+ const k = freqCh - 7;
885
+ const lamL1 = gps ? LAM_GPS_L1 : C_LIGHT / (GLO_F1_BASE + k * GLO_F1_STEP);
886
+ const lamL2 = gps ? LAM_GPS_L2 : C_LIGHT / (GLO_F2_BASE + k * GLO_F2_STEP);
887
+ const signals = [];
888
+ {
889
+ const sig = {
890
+ rinexCode: gps ? code1 ? "1W" : "1C" : code1 ? "1P" : "1C",
891
+ pseudorange: pr1,
892
+ wavelength: lamL1,
893
+ lockTime: legacyLockSec(lock1)
894
+ };
895
+ if (ppr1 !== PPR_INVALID) sig.phase = (pr1 + ppr1 * 5e-4) / lamL1;
896
+ if (ext && cnr1 > 0) sig.cn0 = cnr1 * 0.25;
897
+ signals.push(sig);
898
+ }
899
+ if (dual) {
900
+ const sig = {
901
+ rinexCode: gps ? code2 === 0 ? "2X" : "2W" : code2 === 0 ? "2C" : "2P",
902
+ wavelength: lamL2,
903
+ lockTime: legacyLockSec(lock2)
904
+ };
905
+ if (pr21 !== PR21_INVALID) sig.pseudorange = pr1 + pr21 * 0.02;
906
+ if (ppr2 !== PPR_INVALID) sig.phase = (pr1 + ppr2 * 5e-4) / lamL2;
907
+ if (ext && cnr2 > 0) sig.cn0 = cnr2 * 0.25;
908
+ signals.push(sig);
909
+ }
910
+ observations.push({
911
+ prn: `${system}${two2(satId)}`,
912
+ system,
913
+ signals
914
+ });
915
+ }
916
+ return { messageType: type, epochMs, system, observations };
917
+ }
918
+
590
919
  // src/constants/time.ts
591
920
  var MILLISECONDS_IN_WEEK = 6048e5;
592
921
  var MILLISECONDS_IN_SECOND = 1e3;
@@ -677,35 +1006,6 @@ function getGpsLeap(date) {
677
1006
  return leap_seconds - 19;
678
1007
  }
679
1008
 
680
- // src/constants/gnss.ts
681
- var C_LIGHT = 299792458;
682
- var FREQ = {
683
- G: { "1": 157542e4, "2": 12276e5, "5": 117645e4 },
684
- // R bands 4/6 are the CDMA L1OC/L2OC center frequencies
685
- R: { "3": 1202025e3, "4": 1600995e3, "6": 124806e4 },
686
- E: {
687
- "1": 157542e4,
688
- "5": 117645e4,
689
- "6": 127875e4,
690
- "7": 120714e4,
691
- "8": 1191795e3
692
- },
693
- C: {
694
- "1": 157542e4,
695
- "2": 1561098e3,
696
- "5": 117645e4,
697
- "6": 126852e4,
698
- "7": 120714e4
699
- },
700
- J: { "1": 157542e4, "2": 12276e5, "5": 117645e4, "6": 127875e4 },
701
- I: { "5": 117645e4, "9": 2492028e3 },
702
- S: { "1": 157542e4, "5": 117645e4 }
703
- };
704
- var GLO_F1_BASE = 1602e6;
705
- var GLO_F1_STEP = 562500;
706
- var GLO_F2_BASE = 1246e6;
707
- var GLO_F2_STEP = 437500;
708
-
709
1009
  // src/rtcm3/msm.ts
710
1010
  var GPS_L1 = FREQ.G["1"];
711
1011
  var GPS_L2 = FREQ.G["2"];
@@ -1240,6 +1540,144 @@ function resetGloFreqCache() {
1240
1540
  gloFreqNum.fill(-128);
1241
1541
  }
1242
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
+
1243
1681
  // src/rtcm3/station.ts
1244
1682
  function createStationMeta() {
1245
1683
  return {
@@ -1590,7 +2028,11 @@ function updateStreamStats(stats, frames, rawBytes) {
1590
2028
  createStationMeta,
1591
2029
  createStreamStats,
1592
2030
  decodeEphemeris,
2031
+ decodeIgsSsr,
2032
+ decodeLegacyObs,
1593
2033
  decodeMsmFull,
2034
+ decodeSsr,
2035
+ isSsrMessage,
1594
2036
  msmEpochToDate,
1595
2037
  readString,
1596
2038
  reportDecodeError,