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/index.cjs CHANGED
@@ -144,9 +144,12 @@ __export(src_exports, {
144
144
  dateToEpoch: () => dateToEpoch,
145
145
  decodeBinexEph: () => decodeBinexEph,
146
146
  decodeEphemeris: () => decodeEphemeris,
147
+ decodeIgsSsr: () => decodeIgsSsr,
147
148
  decodeLegacyObs: () => decodeLegacyObs,
148
149
  decodeMsmFull: () => decodeMsmFull,
149
150
  decodeSbfNavigation: () => decodeSbfNavigation,
151
+ decodeSsr: () => decodeSsr,
152
+ decodeSystemParams: () => decodeSystemParams,
150
153
  deg2dms: () => deg2dms,
151
154
  deg2rad: () => deg2rad,
152
155
  detrendIonoArcs: () => detrendIonoArcs,
@@ -239,6 +242,7 @@ __export(src_exports, {
239
242
  ionoFree: () => ionoFree,
240
243
  isSbasL1Preamble: () => isSbasL1Preamble,
241
244
  isSbasL5Correction: () => isSbasL5Correction,
245
+ isSsrMessage: () => isSsrMessage,
242
246
  keplerPosition: () => keplerPosition,
243
247
  klobucharDelay: () => klobucharDelay,
244
248
  lambdaReduction: () => lambdaReduction,
@@ -5020,6 +5024,192 @@ function decodeEphemeris(frame) {
5020
5024
  }
5021
5025
  }
5022
5026
 
5027
+ // src/rtcm3/igs-ssr.ts
5028
+ var UPDATE_INTERVAL_S = [
5029
+ 1,
5030
+ 2,
5031
+ 5,
5032
+ 10,
5033
+ 15,
5034
+ 30,
5035
+ 60,
5036
+ 120,
5037
+ 240,
5038
+ 300,
5039
+ 600,
5040
+ 900,
5041
+ 1800,
5042
+ 3600,
5043
+ 7200,
5044
+ 10800
5045
+ ];
5046
+ var SYSTEM_BY_BASE = {
5047
+ 20: "G",
5048
+ 40: "R",
5049
+ 60: "E",
5050
+ 80: "J",
5051
+ 100: "C",
5052
+ 120: "S"
5053
+ };
5054
+ var KIND_BY_OFFSET = {
5055
+ 1: "orbit",
5056
+ 2: "clock",
5057
+ 3: "combined",
5058
+ 4: "highRateClock",
5059
+ 5: "codeBias",
5060
+ 6: "phaseBias",
5061
+ 7: "ura"
5062
+ };
5063
+ var two = (n) => n.toString().padStart(2, "0");
5064
+ function prnFor(system, id) {
5065
+ if (system === "J") return `J${two(id)}`;
5066
+ if (system === "S") return `S${two(19 + id)}`;
5067
+ return `${system}${two(id)}`;
5068
+ }
5069
+ function ssrUraMm(v) {
5070
+ if (v === 0) return null;
5071
+ const cls = v >> 3 & 7;
5072
+ const val = v & 7;
5073
+ return 3 ** cls * (1 + val / 4) - 1;
5074
+ }
5075
+ function decodeIgsSsr(frame) {
5076
+ if (frame.messageType !== 4076) return null;
5077
+ const r = new BitReader(frame.payload);
5078
+ r.readU(12);
5079
+ const version = r.readU(3);
5080
+ const im = r.readU(8);
5081
+ if (im === 201) return decodeIono(r, version, im);
5082
+ const base = Math.floor(im / 20) * 20;
5083
+ const system = SYSTEM_BY_BASE[base];
5084
+ const kind = KIND_BY_OFFSET[im - base];
5085
+ if (!system || !kind) return null;
5086
+ const epochS = r.readU(20);
5087
+ const updateIntervalS = UPDATE_INTERVAL_S[r.readU(4)];
5088
+ const multipleMessage = r.readU(1) === 1;
5089
+ const iodSsr = r.readU(4);
5090
+ const providerId = r.readU(16);
5091
+ const solutionId = r.readU(4);
5092
+ const hasDatum = kind === "orbit" || kind === "combined";
5093
+ const referenceDatum = hasDatum ? r.readU(1) : void 0;
5094
+ let dispersiveConsistency;
5095
+ let mwConsistency;
5096
+ if (kind === "phaseBias") {
5097
+ dispersiveConsistency = r.readU(1) === 1;
5098
+ mwConsistency = r.readU(1) === 1;
5099
+ }
5100
+ const nsat = r.readU(6);
5101
+ const readOrbit = (s) => {
5102
+ s.iode = r.readU(8);
5103
+ s.deltaRadial = r.readS(22) * 1e-4;
5104
+ s.deltaAlongTrack = r.readS(20) * 4e-4;
5105
+ s.deltaCrossTrack = r.readS(20) * 4e-4;
5106
+ s.dotRadial = r.readS(21) * 1e-6;
5107
+ s.dotAlongTrack = r.readS(19) * 4e-6;
5108
+ s.dotCrossTrack = r.readS(19) * 4e-6;
5109
+ };
5110
+ const readClock2 = (s) => {
5111
+ s.c0 = r.readS(22) * 1e-4;
5112
+ s.c1 = r.readS(21) * 1e-6;
5113
+ s.c2 = r.readS(27) * 2e-8;
5114
+ };
5115
+ const satellites = [];
5116
+ for (let i = 0; i < nsat; i++) {
5117
+ const id = r.readU(6);
5118
+ const sat = { prn: prnFor(system, id) };
5119
+ if (kind === "orbit" || kind === "combined") readOrbit(sat);
5120
+ if (kind === "clock" || kind === "combined") readClock2(sat);
5121
+ else if (kind === "ura")
5122
+ sat.uraMm = ssrUraMm(r.readU(6));
5123
+ else if (kind === "highRateClock")
5124
+ sat.highRateClock = r.readS(22) * 1e-4;
5125
+ else if (kind === "codeBias") {
5126
+ const n = r.readU(5);
5127
+ const biases = [];
5128
+ for (let b = 0; b < n; b++) {
5129
+ const signal = r.readU(5);
5130
+ biases.push({
5131
+ signal,
5132
+ signalName: `#${signal}`,
5133
+ biasM: r.readS(14) * 0.01
5134
+ // IDF025 0.01 m
5135
+ });
5136
+ }
5137
+ sat.codeBiases = biases;
5138
+ } else if (kind === "phaseBias") {
5139
+ const n = r.readU(5);
5140
+ r.readU(9);
5141
+ r.readS(8);
5142
+ const biases = [];
5143
+ for (let b = 0; b < n; b++) {
5144
+ const signal = r.readU(5);
5145
+ const integer = r.readU(1) === 1;
5146
+ const wideLaneGroup = r.readU(2);
5147
+ const discontinuity = r.readU(4);
5148
+ const biasM = r.readS(20) * 1e-4;
5149
+ biases.push({ signal, integer, wideLaneGroup, discontinuity, biasM });
5150
+ }
5151
+ sat.phaseBiases = biases;
5152
+ }
5153
+ satellites.push(sat);
5154
+ }
5155
+ return {
5156
+ messageType: 4076,
5157
+ version,
5158
+ igsMessageNumber: im,
5159
+ system,
5160
+ kind,
5161
+ epochS,
5162
+ updateIntervalS,
5163
+ multipleMessage,
5164
+ referenceDatum,
5165
+ iodSsr,
5166
+ providerId,
5167
+ solutionId,
5168
+ dispersiveConsistency,
5169
+ mwConsistency,
5170
+ satellites
5171
+ };
5172
+ }
5173
+ function decodeIono(r, version, im) {
5174
+ const epochS = r.readU(20);
5175
+ const updateIntervalS = UPDATE_INTERVAL_S[r.readU(4)];
5176
+ const multipleMessage = r.readU(1) === 1;
5177
+ const iodSsr = r.readU(4);
5178
+ const providerId = r.readU(16);
5179
+ const solutionId = r.readU(4);
5180
+ const qualityTecu = r.readU(9) * 0.05;
5181
+ const nLayers = r.readU(2) + 1;
5182
+ const layers = [];
5183
+ for (let l = 0; l < nLayers; l++) {
5184
+ const heightKm = r.readU(8) * 10;
5185
+ const degree = r.readU(4) + 1;
5186
+ const order = r.readU(4) + 1;
5187
+ const N = degree;
5188
+ const M = order;
5189
+ const nCoef = (N + 1) * (N + 1) - (N - M) * (N - M + 1);
5190
+ const nCos = nCoef;
5191
+ let nSin = 0;
5192
+ for (let m = 1; m <= M; m++) nSin += N - m + 1;
5193
+ for (let i = 0; i < nCos + nSin; i++) r.readS(16);
5194
+ layers.push({ heightKm, degree, order, coefficientCount: nCos + nSin });
5195
+ }
5196
+ return {
5197
+ messageType: 4076,
5198
+ version,
5199
+ igsMessageNumber: im,
5200
+ system: "I",
5201
+ kind: "ionosphere",
5202
+ epochS,
5203
+ updateIntervalS,
5204
+ multipleMessage,
5205
+ iodSsr,
5206
+ providerId,
5207
+ solutionId,
5208
+ satellites: [],
5209
+ iono: { qualityTecu, layers }
5210
+ };
5211
+ }
5212
+
5023
5213
  // src/rtcm3/legacy-obs.ts
5024
5214
  var PRUNIT_GPS = 299792.458;
5025
5215
  var PRUNIT_GLO = 599584.916;
@@ -5036,7 +5226,7 @@ function legacyLockSec(i) {
5036
5226
  if (i < 127) return 32 * i - 3096;
5037
5227
  return 937;
5038
5228
  }
5039
- var two = (n) => n.toString().padStart(2, "0");
5229
+ var two2 = (n) => n.toString().padStart(2, "0");
5040
5230
  function decodeLegacyObs(frame) {
5041
5231
  const type = frame.messageType;
5042
5232
  const gps = type >= 1001 && type <= 1004;
@@ -5122,7 +5312,7 @@ function decodeLegacyObs(frame) {
5122
5312
  signals.push(sig);
5123
5313
  }
5124
5314
  observations.push({
5125
- prn: `${system}${two(satId)}`,
5315
+ prn: `${system}${two2(satId)}`,
5126
5316
  system,
5127
5317
  signals
5128
5318
  });
@@ -5664,6 +5854,168 @@ function resetGloFreqCache() {
5664
5854
  gloFreqNum.fill(-128);
5665
5855
  }
5666
5856
 
5857
+ // src/rtcm3/ssr.ts
5858
+ var UPDATE_INTERVAL_S2 = [
5859
+ 1,
5860
+ 2,
5861
+ 5,
5862
+ 10,
5863
+ 15,
5864
+ 30,
5865
+ 60,
5866
+ 120,
5867
+ 240,
5868
+ 300,
5869
+ 600,
5870
+ 900,
5871
+ 1800,
5872
+ 3600,
5873
+ 7200,
5874
+ 10800
5875
+ ];
5876
+ var GPS_SIGNAL = {
5877
+ 0: "L1 C/A",
5878
+ 1: "L1 P",
5879
+ 2: "L1 Z-tracking",
5880
+ 5: "L2 C/A",
5881
+ 6: "L2 semi-codeless",
5882
+ 7: "L2C(M)",
5883
+ 8: "L2C(L)",
5884
+ 9: "L2C(M+L)",
5885
+ 10: "L2 P",
5886
+ 11: "L2 Z-tracking",
5887
+ 14: "L5 I",
5888
+ 15: "L5 Q"
5889
+ };
5890
+ var GLO_SIGNAL = {
5891
+ 0: "G1 C/A",
5892
+ 1: "G1 P",
5893
+ 2: "G2 C/A",
5894
+ 3: "G2 P"
5895
+ };
5896
+ var SSR_KIND = {
5897
+ 1057: { system: "G", kind: "orbit" },
5898
+ 1058: { system: "G", kind: "clock" },
5899
+ 1059: { system: "G", kind: "codeBias" },
5900
+ 1060: { system: "G", kind: "combined" },
5901
+ 1061: { system: "G", kind: "ura" },
5902
+ 1062: { system: "G", kind: "highRateClock" },
5903
+ 1063: { system: "R", kind: "orbit" },
5904
+ 1064: { system: "R", kind: "clock" },
5905
+ 1065: { system: "R", kind: "codeBias" },
5906
+ 1066: { system: "R", kind: "combined" },
5907
+ 1067: { system: "R", kind: "ura" },
5908
+ 1068: { system: "R", kind: "highRateClock" }
5909
+ };
5910
+ function ssrUraMm2(v) {
5911
+ if (v === 0) return null;
5912
+ const cls = v >> 3 & 7;
5913
+ const val = v & 7;
5914
+ return 3 ** cls * (1 + val / 4) - 1;
5915
+ }
5916
+ var two3 = (n) => n.toString().padStart(2, "0");
5917
+ function decodeSsr(frame) {
5918
+ const spec = SSR_KIND[frame.messageType];
5919
+ if (!spec) return null;
5920
+ const { system, kind } = spec;
5921
+ const gps = system === "G";
5922
+ const r = new BitReader(frame.payload);
5923
+ r.readU(12);
5924
+ const epochS = r.readU(gps ? 20 : 17);
5925
+ const updateIntervalS = UPDATE_INTERVAL_S2[r.readU(4)];
5926
+ const multipleMessage = r.readU(1) === 1;
5927
+ const hasDatum = kind === "orbit" || kind === "combined";
5928
+ const referenceDatum = hasDatum ? r.readU(1) : void 0;
5929
+ const iodSsr = r.readU(4);
5930
+ const providerId = r.readU(16);
5931
+ const solutionId = r.readU(4);
5932
+ const nsat = r.readU(6);
5933
+ const sigName = gps ? GPS_SIGNAL : GLO_SIGNAL;
5934
+ const satellites = [];
5935
+ const readOrbit = (sat) => {
5936
+ sat.deltaRadial = r.readS(22) * 1e-4;
5937
+ sat.deltaAlongTrack = r.readS(20) * 4e-4;
5938
+ sat.deltaCrossTrack = r.readS(20) * 4e-4;
5939
+ sat.dotRadial = r.readS(21) * 1e-6;
5940
+ sat.dotAlongTrack = r.readS(19) * 4e-6;
5941
+ sat.dotCrossTrack = r.readS(19) * 4e-6;
5942
+ };
5943
+ const readClock2 = (sat) => {
5944
+ sat.c0 = r.readS(22) * 1e-4;
5945
+ sat.c1 = r.readS(21) * 1e-6;
5946
+ sat.c2 = r.readS(27) * 2e-8;
5947
+ };
5948
+ for (let i = 0; i < nsat; i++) {
5949
+ const satId = gps ? r.readU(6) : r.readU(5);
5950
+ const sat = { prn: `${system}${two3(satId)}` };
5951
+ if (kind === "orbit" || kind === "combined") {
5952
+ sat.iode = r.readU(8);
5953
+ readOrbit(sat);
5954
+ }
5955
+ if (kind === "combined") readClock2(sat);
5956
+ else if (kind === "clock") readClock2(sat);
5957
+ else if (kind === "ura")
5958
+ sat.uraMm = ssrUraMm2(r.readU(6));
5959
+ else if (kind === "highRateClock")
5960
+ sat.highRateClock = r.readS(22) * 1e-4;
5961
+ else if (kind === "codeBias") {
5962
+ const ncb = r.readU(5);
5963
+ const biases = [];
5964
+ for (let c = 0; c < ncb; c++) {
5965
+ const signal = r.readU(5);
5966
+ const biasM = r.readS(14) * 0.01;
5967
+ biases.push({
5968
+ signal,
5969
+ signalName: sigName[signal] ?? `#${signal}`,
5970
+ biasM
5971
+ });
5972
+ }
5973
+ sat.codeBiases = biases;
5974
+ }
5975
+ satellites.push(sat);
5976
+ }
5977
+ return {
5978
+ messageType: frame.messageType,
5979
+ system,
5980
+ kind,
5981
+ epochS,
5982
+ updateIntervalS,
5983
+ multipleMessage,
5984
+ referenceDatum,
5985
+ iodSsr,
5986
+ providerId,
5987
+ solutionId,
5988
+ satellites
5989
+ };
5990
+ }
5991
+ function isSsrMessage(messageType) {
5992
+ return messageType in SSR_KIND;
5993
+ }
5994
+
5995
+ // src/rtcm3/system-params.ts
5996
+ function decodeSystemParams(frame) {
5997
+ if (frame.messageType !== 1013) return null;
5998
+ const r = new BitReader(frame.payload);
5999
+ r.readU(12);
6000
+ const referenceStationId = r.readU(12);
6001
+ const mjd = r.readU(16);
6002
+ const secondsOfDay = r.readU(17);
6003
+ const nm = r.readU(5);
6004
+ const leapSeconds = r.readU(8);
6005
+ const messages = [];
6006
+ for (let i = 0; i < nm; i++) {
6007
+ messages.push({
6008
+ messageId: r.readU(12),
6009
+ // DF055
6010
+ sync: r.readU(1) === 1,
6011
+ // DF056
6012
+ intervalS: r.readU(16) * 0.1
6013
+ // DF057 (0.1 s)
6014
+ });
6015
+ }
6016
+ return { referenceStationId, mjd, secondsOfDay, leapSeconds, messages };
6017
+ }
6018
+
5667
6019
  // src/rtcm3/station.ts
5668
6020
  function createStationMeta() {
5669
6021
  return {
@@ -5677,7 +6029,8 @@ function createStationMeta() {
5677
6029
  receiverType: null,
5678
6030
  receiverFirmware: null,
5679
6031
  receiverSerial: null,
5680
- description: null
6032
+ description: null,
6033
+ physicalRefStationId: null
5681
6034
  };
5682
6035
  }
5683
6036
  function decodeStationARP(payload, msgType, meta) {
@@ -5700,6 +6053,18 @@ function decodeStationARP(payload, msgType, meta) {
5700
6053
  meta.antennaHeight = r.readU(16) * 1e-4;
5701
6054
  }
5702
6055
  }
6056
+ function decodeStation1032(payload, meta) {
6057
+ if (payload.length < 19) return;
6058
+ const r = new BitReader(payload);
6059
+ r.skip(12);
6060
+ meta.stationId = r.readU(12);
6061
+ meta.physicalRefStationId = r.readU(12);
6062
+ meta.itrf = r.readU(6);
6063
+ const x = r.readS(38) * 1e-4;
6064
+ const y = r.readS(38) * 1e-4;
6065
+ const z = r.readS(38) * 1e-4;
6066
+ if (x !== 0 || y !== 0 || z !== 0) meta.position = [x, y, z];
6067
+ }
5703
6068
  function decodeAntennaDescriptor(payload, msgType, meta) {
5704
6069
  if (payload.length < 5) return;
5705
6070
  const r = new BitReader(payload);
@@ -5780,6 +6145,9 @@ function updateStationMeta(meta, frame) {
5780
6145
  case 1006:
5781
6146
  decodeStationARP(frame.payload, frame.messageType, meta);
5782
6147
  return true;
6148
+ case 1032:
6149
+ decodeStation1032(frame.payload, meta);
6150
+ return true;
5783
6151
  case 1007:
5784
6152
  case 1008:
5785
6153
  decodeAntennaDescriptor(frame.payload, frame.messageType, meta);
@@ -6460,7 +6828,7 @@ function weekOfToe(week, tow, toe) {
6460
6828
  if (toe - tow < -HALF_WEEK3) return week + 1;
6461
6829
  return week;
6462
6830
  }
6463
- var two2 = (n) => String(n).padStart(2, "0");
6831
+ var two4 = (n) => String(n).padStart(2, "0");
6464
6832
  function decodeGalInavWords(words) {
6465
6833
  if (words.length < 96) return null;
6466
6834
  const b = words;
@@ -6548,7 +6916,7 @@ function decodeGalInavWords(words) {
6548
6916
  const tocDate = gpsDate2(week, tocs);
6549
6917
  return {
6550
6918
  system: "E",
6551
- prn: `E${two2(svid)}`,
6919
+ prn: `E${two4(svid)}`,
6552
6920
  toc: tocDate.getTime() / 1e3 % SEC_PER_WEEK5,
6553
6921
  tocDate,
6554
6922
  af0,
@@ -6656,7 +7024,7 @@ function decodeGalFnavPages(pages) {
6656
7024
  const tocDate = gpsDate2(week, tocs);
6657
7025
  return {
6658
7026
  system: "E",
6659
- prn: `E${two2(svid)}`,
7027
+ prn: `E${two4(svid)}`,
6660
7028
  toc: tocDate.getTime() / 1e3 % SEC_PER_WEEK5,
6661
7029
  tocDate,
6662
7030
  af0,
@@ -6712,7 +7080,7 @@ var GalInavAssembler = class {
6712
7080
  sat.words[type * 16 + 15] = getBitU(page, 124, 8);
6713
7081
  if (type !== 5) return null;
6714
7082
  const eph = decodeGalInavWords(sat.words);
6715
- if (!eph || eph.prn !== `E${two2(prn)}`) return null;
7083
+ if (!eph || eph.prn !== `E${two4(prn)}`) return null;
6716
7084
  const key = dedupKey(eph);
6717
7085
  if (key === sat.lastKey) return null;
6718
7086
  sat.lastKey = key;
@@ -6739,7 +7107,7 @@ var GalFnavAssembler = class {
6739
7107
  sat.words.set(page.subarray(0, 31), (type - 1) * 31);
6740
7108
  if (type !== 4) return null;
6741
7109
  const eph = decodeGalFnavPages(sat.words);
6742
- if (!eph || eph.prn !== `E${two2(prn)}`) return null;
7110
+ if (!eph || eph.prn !== `E${two4(prn)}`) return null;
6743
7111
  const key = dedupKey(eph);
6744
7112
  if (key === sat.lastKey) return null;
6745
7113
  sat.lastKey = key;
@@ -6913,7 +7281,7 @@ var GloStringAssembler = class {
6913
7281
  // src/navbits/sbas.ts
6914
7282
  var GPS_EPOCH_MS7 = Date.UTC(1980, 0, 6);
6915
7283
  var MS_PER_WEEK3 = 7 * 86400 * 1e3;
6916
- var two3 = (n) => String(n).padStart(2, "0");
7284
+ var two5 = (n) => String(n).padStart(2, "0");
6917
7285
  var SBAS_MT_GEO_NAV = 9;
6918
7286
  function sbasMessageType(msg) {
6919
7287
  return getBitU(msg, 8, 6);
@@ -6932,7 +7300,7 @@ function decodeSbasGeoNav(msg, prn, week, tow) {
6932
7300
  const ura = getBitU(msg, 35, 4);
6933
7301
  return {
6934
7302
  system: "S",
6935
- prn: `S${two3(prn - 100)}`,
7303
+ prn: `S${two5(prn - 100)}`,
6936
7304
  tocDate: new Date(GPS_EPOCH_MS7 + week * MS_PER_WEEK3 + t0Sec * 1e3),
6937
7305
  tauN: getBitS(msg, 206, 12) * 2 ** -31,
6938
7306
  // a_Gf0, clock offset (s)
@@ -6956,7 +7324,7 @@ function decodeSbasGeoNav(msg, prn, week, tow) {
6956
7324
  // src/ubx/rawnav.ts
6957
7325
  var GPS_EPOCH_MS8 = Date.UTC(1980, 0, 6);
6958
7326
  var SEC_PER_WEEK7 = 7 * 86400;
6959
- var two4 = (n) => String(n).padStart(2, "0");
7327
+ var two6 = (n) => String(n).padStart(2, "0");
6960
7328
  function parseUbxRawNav(data, opts = {}) {
6961
7329
  const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
6962
7330
  const ephemerides = [];
@@ -7032,7 +7400,7 @@ function parseUbxRawNav(data, opts = {}) {
7032
7400
  badParity++;
7033
7401
  continue;
7034
7402
  }
7035
- const eph = bds.push(`C${two4(svId)}`, sf);
7403
+ const eph = bds.push(`C${two6(svId)}`, sf);
7036
7404
  if (eph) ephemerides.push(eph);
7037
7405
  } else if (gnssId === 6) {
7038
7406
  if (p.length < 8 + 16) continue;
@@ -7051,7 +7419,7 @@ function parseUbxRawNav(data, opts = {}) {
7051
7419
  continue;
7052
7420
  }
7053
7421
  if (!refDate) continue;
7054
- const eph = glo.push(`R${two4(svId)}`, str2, refDate, p[3] - 7);
7422
+ const eph = glo.push(`R${two6(svId)}`, str2, refDate, p[3] - 7);
7055
7423
  if (eph) ephemerides.push(eph);
7056
7424
  } else if (gnssId === 1) {
7057
7425
  if (p.length < 8 + 32) continue;
@@ -7152,21 +7520,21 @@ var SIGNALS = {
7152
7520
  6: { 0: ["R", "1C"], 2: ["R", "2C"] }
7153
7521
  // GLONASS L1OF, L2OF
7154
7522
  };
7155
- function prnFor(gnssId, svId) {
7156
- const two10 = (n) => String(n).padStart(2, "0");
7523
+ function prnFor2(gnssId, svId) {
7524
+ const two12 = (n) => String(n).padStart(2, "0");
7157
7525
  switch (gnssId) {
7158
7526
  case 0:
7159
- return svId >= 1 && svId <= 32 ? `G${two10(svId)}` : null;
7527
+ return svId >= 1 && svId <= 32 ? `G${two12(svId)}` : null;
7160
7528
  case 1:
7161
- return svId >= 120 && svId <= 158 ? `S${two10(svId - 100)}` : null;
7529
+ return svId >= 120 && svId <= 158 ? `S${two12(svId - 100)}` : null;
7162
7530
  case 2:
7163
- return svId >= 1 && svId <= 36 ? `E${two10(svId)}` : null;
7531
+ return svId >= 1 && svId <= 36 ? `E${two12(svId)}` : null;
7164
7532
  case 3:
7165
- return svId >= 1 && svId <= 63 ? `C${two10(svId)}` : null;
7533
+ return svId >= 1 && svId <= 63 ? `C${two12(svId)}` : null;
7166
7534
  case 5:
7167
- return svId >= 1 && svId <= 10 ? `J${two10(svId)}` : null;
7535
+ return svId >= 1 && svId <= 10 ? `J${two12(svId)}` : null;
7168
7536
  case 6:
7169
- return svId >= 1 && svId <= 32 ? `R${two10(svId)}` : null;
7537
+ return svId >= 1 && svId <= 32 ? `R${two12(svId)}` : null;
7170
7538
  default:
7171
7539
  return null;
7172
7540
  }
@@ -7198,7 +7566,7 @@ function parseUbxRawx(data) {
7198
7566
  const svId = data[off + 21];
7199
7567
  const sigId = data[off + 22];
7200
7568
  const trkStat = data[off + 30];
7201
- const prn = prnFor(gnssId, svId);
7569
+ const prn = prnFor2(gnssId, svId);
7202
7570
  const sig = SIGNALS[gnssId]?.[sigId];
7203
7571
  if (!prn || !sig) continue;
7204
7572
  const prValid = (trkStat & 1) !== 0;
@@ -7269,22 +7637,22 @@ function scanSbfFrames(data, view, onBlock) {
7269
7637
  }
7270
7638
  return badCrc;
7271
7639
  }
7272
- var two5 = (n) => String(n).padStart(2, "0");
7640
+ var two7 = (n) => String(n).padStart(2, "0");
7273
7641
  function svidToPrn(svid) {
7274
- if (svid >= 1 && svid <= 37) return svid <= 32 ? `G${two5(svid)}` : null;
7275
- if (svid <= 61) return svid - 37 <= 27 ? `R${two5(svid - 37)}` : null;
7642
+ if (svid >= 1 && svid <= 37) return svid <= 32 ? `G${two7(svid)}` : null;
7643
+ if (svid <= 61) return svid - 37 <= 27 ? `R${two7(svid - 37)}` : null;
7276
7644
  if (svid <= 62) return null;
7277
- if (svid <= 68) return svid - 38 <= 27 ? `R${two5(svid - 38)}` : null;
7645
+ if (svid <= 68) return svid - 38 <= 27 ? `R${two7(svid - 38)}` : null;
7278
7646
  if (svid <= 70) return null;
7279
- if (svid <= 106) return svid - 70 <= 36 ? `E${two5(svid - 70)}` : null;
7647
+ if (svid <= 106) return svid - 70 <= 36 ? `E${two7(svid - 70)}` : null;
7280
7648
  if (svid <= 119) return null;
7281
- if (svid <= 140) return `S${two5(svid - 100)}`;
7282
- if (svid <= 180) return svid - 140 <= 50 ? `C${two5(svid - 140)}` : null;
7283
- if (svid <= 190) return `J${two5(svid - 180)}`;
7284
- if (svid <= 197) return svid - 190 <= 14 ? `I${two5(svid - 190)}` : null;
7285
- if (svid <= 215) return `S${two5(svid - 157)}`;
7286
- if (svid <= 222) return svid - 208 <= 14 ? `I${two5(svid - 208)}` : null;
7287
- if (svid <= 245) return svid - 182 <= 50 ? `C${two5(svid - 182)}` : null;
7649
+ if (svid <= 140) return `S${two7(svid - 100)}`;
7650
+ if (svid <= 180) return svid - 140 <= 50 ? `C${two7(svid - 140)}` : null;
7651
+ if (svid <= 190) return `J${two7(svid - 180)}`;
7652
+ if (svid <= 197) return svid - 190 <= 14 ? `I${two7(svid - 190)}` : null;
7653
+ if (svid <= 215) return `S${two7(svid - 157)}`;
7654
+ if (svid <= 222) return svid - 208 <= 14 ? `I${two7(svid - 208)}` : null;
7655
+ if (svid <= 245) return svid - 182 <= 50 ? `C${two7(svid - 182)}` : null;
7288
7656
  return null;
7289
7657
  }
7290
7658
 
@@ -8896,23 +9264,23 @@ var MEAS2_SIG = [
8896
9264
  ["J", "1E"],
8897
9265
  ["J", "5P"]
8898
9266
  ];
8899
- var two6 = (n) => String(n).padStart(2, "0");
9267
+ var two8 = (n) => String(n).padStart(2, "0");
8900
9268
  function m3Prn(navsys, svid) {
8901
9269
  switch (navsys) {
8902
9270
  case 0:
8903
- return svid < 32 ? `G${two6(svid + 1)}` : null;
9271
+ return svid < 32 ? `G${two8(svid + 1)}` : null;
8904
9272
  case 1:
8905
- return svid < 27 ? `R${two6(svid + 1)}` : null;
9273
+ return svid < 27 ? `R${two8(svid + 1)}` : null;
8906
9274
  case 2:
8907
- return svid < 36 ? `E${two6(svid + 1)}` : null;
9275
+ return svid < 36 ? `E${two8(svid + 1)}` : null;
8908
9276
  case 3:
8909
- return svid < 50 ? `C${two6(svid + 1)}` : null;
9277
+ return svid < 50 ? `C${two8(svid + 1)}` : null;
8910
9278
  case 4:
8911
- return svid <= 38 ? `S${two6(svid + 20)}` : null;
9279
+ return svid <= 38 ? `S${two8(svid + 20)}` : null;
8912
9280
  case 5:
8913
- return svid < 10 ? `J${two6(svid + 1)}` : null;
9281
+ return svid < 10 ? `J${two8(svid + 1)}` : null;
8914
9282
  case 6:
8915
- return svid < 14 ? `I${two6(svid + 1)}` : null;
9283
+ return svid < 14 ? `I${two8(svid + 1)}` : null;
8916
9284
  default:
8917
9285
  return null;
8918
9286
  }
@@ -10746,7 +11114,7 @@ var MS_PER_WEEK12 = SEC_PER_WEEK11 * 1e3;
10746
11114
  var SC2RAD = GPS_PI;
10747
11115
  var gpsMs4 = (week, sec) => GPS_EPOCH_MS20 + week * MS_PER_WEEK12 + sec * 1e3;
10748
11116
  var sowOf5 = (dateMs) => (dateMs / 1e3 % SEC_PER_WEEK11 + SEC_PER_WEEK11) % SEC_PER_WEEK11;
10749
- var two7 = (n) => String(n).padStart(2, "0");
11117
+ var two9 = (n) => String(n).padStart(2, "0");
10750
11118
  var Reader = class {
10751
11119
  constructor(view, start, le) {
10752
11120
  this.view = view;
@@ -10841,7 +11209,7 @@ function decodeGpsQzss(view, p, le, sys) {
10841
11209
  const tocDate = new Date(gpsMs4(week, toes));
10842
11210
  return {
10843
11211
  system: sys,
10844
- prn: `${sys}${two7(prn)}`,
11212
+ prn: `${sys}${two9(prn)}`,
10845
11213
  toc: sowOf5(tocDate.getTime()),
10846
11214
  tocDate,
10847
11215
  af0,
@@ -10874,7 +11242,7 @@ function decodeGalileo(view, p, le) {
10874
11242
  const tocDate = new Date(gpsMs4(week, toes));
10875
11243
  return {
10876
11244
  system: "E",
10877
- prn: `E${two7(prn)}`,
11245
+ prn: `E${two9(prn)}`,
10878
11246
  toc: sowOf5(tocDate.getTime()),
10879
11247
  tocDate,
10880
11248
  af0,
@@ -10912,7 +11280,7 @@ function decodeBeidou(view, p, le) {
10912
11280
  const tocDate = new Date(BDT_EPOCH_MS5 + week * MS_PER_WEEK12 + toes * 1e3);
10913
11281
  return {
10914
11282
  system: "C",
10915
- prn: `C${two7(prn)}`,
11283
+ prn: `C${two9(prn)}`,
10916
11284
  toc: sowOf5(tocDate.getTime()),
10917
11285
  tocDate,
10918
11286
  af0,
@@ -10952,7 +11320,7 @@ function decodeGlonass(view, p, le) {
10952
11320
  );
10953
11321
  return {
10954
11322
  system: "R",
10955
- prn: `R${two7(slot)}`,
11323
+ prn: `R${two9(slot)}`,
10956
11324
  tocDate,
10957
11325
  tauN,
10958
11326
  gammaN,
@@ -10991,7 +11359,7 @@ function decodeSbas(view, p, le) {
10991
11359
  if (prn < 120 || prn > 158) return null;
10992
11360
  return {
10993
11361
  system: "S",
10994
- prn: `S${two7(prn - 100)}`,
11362
+ prn: `S${two9(prn - 100)}`,
10995
11363
  tocDate: new Date(gpsMs4(week, toe)),
10996
11364
  tauN: af0,
10997
11365
  gammaN: af1,
@@ -11168,22 +11536,22 @@ var OBS_CODES = {
11168
11536
  ]
11169
11537
  // QZSS
11170
11538
  };
11171
- var two8 = (n) => String(n).padStart(2, "0");
11539
+ var two10 = (n) => String(n).padStart(2, "0");
11172
11540
  function obsPrn(sys, prn) {
11173
11541
  switch (sys) {
11174
11542
  case 0:
11175
- return prn >= 1 && prn <= 32 ? `G${two8(prn)}` : null;
11543
+ return prn >= 1 && prn <= 32 ? `G${two10(prn)}` : null;
11176
11544
  case 1:
11177
- return prn >= 1 && prn <= 27 ? `R${two8(prn)}` : null;
11545
+ return prn >= 1 && prn <= 27 ? `R${two10(prn)}` : null;
11178
11546
  case 2:
11179
- return prn >= 120 && prn <= 158 ? `S${two8(prn - 100)}` : null;
11547
+ return prn >= 120 && prn <= 158 ? `S${two10(prn - 100)}` : null;
11180
11548
  case 3:
11181
- return prn >= 1 && prn <= 36 ? `E${two8(prn)}` : null;
11549
+ return prn >= 1 && prn <= 36 ? `E${two10(prn)}` : null;
11182
11550
  case 4:
11183
- return prn >= 1 && prn <= 63 ? `C${two8(prn)}` : null;
11551
+ return prn >= 1 && prn <= 63 ? `C${two10(prn)}` : null;
11184
11552
  case 5:
11185
- if (prn >= 193 && prn <= 202) return `J${two8(prn - 192)}`;
11186
- return prn >= 1 && prn <= 10 ? `J${two8(prn)}` : null;
11553
+ if (prn >= 193 && prn <= 202) return `J${two10(prn - 192)}`;
11554
+ return prn >= 1 && prn <= 10 ? `J${two10(prn)}` : null;
11187
11555
  default:
11188
11556
  return null;
11189
11557
  }
@@ -13536,7 +13904,7 @@ var SEC_PER_WEEK12 = 604800;
13536
13904
  var MAXSBSAGEF = 30;
13537
13905
  var MAXSBSAGEL = 360;
13538
13906
  var MAXBAND = 10;
13539
- var two9 = (n) => String(n).padStart(2, "0");
13907
+ var two11 = (n) => String(n).padStart(2, "0");
13540
13908
  var VAR_FCORR = [
13541
13909
  0.052,
13542
13910
  0.0924,
@@ -13682,10 +14050,10 @@ var igpband2 = [
13682
14050
  ];
13683
14051
  var gpsSeconds = (week, tow) => week * SEC_PER_WEEK12 + tow;
13684
14052
  function maskPrn(i) {
13685
- if (i >= 1 && i <= 37) return `G${two9(i)}`;
13686
- if (i >= 38 && i <= 61) return `R${two9(i - 37)}`;
13687
- if (i >= 120 && i <= 138) return `S${two9(i - 100)}`;
13688
- if (i >= 193 && i <= 202) return `J${two9(i - 192)}`;
14053
+ if (i >= 1 && i <= 37) return `G${two11(i)}`;
14054
+ if (i >= 38 && i <= 61) return `R${two11(i - 37)}`;
14055
+ if (i >= 120 && i <= 138) return `S${two11(i - 100)}`;
14056
+ if (i >= 193 && i <= 202) return `J${two11(i - 192)}`;
13689
14057
  return null;
13690
14058
  }
13691
14059
  function ionppp(latRad, lonRad, azRad, elRad, re, hion) {
@@ -13724,7 +14092,7 @@ var SbasProcessor = class {
13724
14092
  if (week === 0) return -1;
13725
14093
  const type = sbasMessageType(msg);
13726
14094
  if (geoPrn != null && geoPrn >= 120 && geoPrn <= 158)
13727
- this.geoPrns.add(`S${two9(geoPrn - 100)}`);
14095
+ this.geoPrns.add(`S${two11(geoPrn - 100)}`);
13728
14096
  switch (type) {
13729
14097
  case 1:
13730
14098
  return this.decodeMask(msg) ? type : -1;
@@ -18273,9 +18641,12 @@ function computePsdDb(centerMHz, halfSpanChips, numPoints, psdFn, f0 = 1023e3, f
18273
18641
  dateToEpoch,
18274
18642
  decodeBinexEph,
18275
18643
  decodeEphemeris,
18644
+ decodeIgsSsr,
18276
18645
  decodeLegacyObs,
18277
18646
  decodeMsmFull,
18278
18647
  decodeSbfNavigation,
18648
+ decodeSsr,
18649
+ decodeSystemParams,
18279
18650
  deg2dms,
18280
18651
  deg2rad,
18281
18652
  detrendIonoArcs,
@@ -18368,6 +18739,7 @@ function computePsdDb(centerMHz, halfSpanChips, numPoints, psdFn, f0 = 1023e3, f
18368
18739
  ionoFree,
18369
18740
  isSbasL1Preamble,
18370
18741
  isSbasL5Correction,
18742
+ isSsrMessage,
18371
18743
  keplerPosition,
18372
18744
  klobucharDelay,
18373
18745
  lambdaReduction,