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.cjs CHANGED
@@ -144,9 +144,11 @@ __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,
150
152
  deg2dms: () => deg2dms,
151
153
  deg2rad: () => deg2rad,
152
154
  detrendIonoArcs: () => detrendIonoArcs,
@@ -239,6 +241,7 @@ __export(src_exports, {
239
241
  ionoFree: () => ionoFree,
240
242
  isSbasL1Preamble: () => isSbasL1Preamble,
241
243
  isSbasL5Correction: () => isSbasL5Correction,
244
+ isSsrMessage: () => isSsrMessage,
242
245
  keplerPosition: () => keplerPosition,
243
246
  klobucharDelay: () => klobucharDelay,
244
247
  lambdaReduction: () => lambdaReduction,
@@ -5020,6 +5023,192 @@ function decodeEphemeris(frame) {
5020
5023
  }
5021
5024
  }
5022
5025
 
5026
+ // src/rtcm3/igs-ssr.ts
5027
+ var UPDATE_INTERVAL_S = [
5028
+ 1,
5029
+ 2,
5030
+ 5,
5031
+ 10,
5032
+ 15,
5033
+ 30,
5034
+ 60,
5035
+ 120,
5036
+ 240,
5037
+ 300,
5038
+ 600,
5039
+ 900,
5040
+ 1800,
5041
+ 3600,
5042
+ 7200,
5043
+ 10800
5044
+ ];
5045
+ var SYSTEM_BY_BASE = {
5046
+ 20: "G",
5047
+ 40: "R",
5048
+ 60: "E",
5049
+ 80: "J",
5050
+ 100: "C",
5051
+ 120: "S"
5052
+ };
5053
+ var KIND_BY_OFFSET = {
5054
+ 1: "orbit",
5055
+ 2: "clock",
5056
+ 3: "combined",
5057
+ 4: "highRateClock",
5058
+ 5: "codeBias",
5059
+ 6: "phaseBias",
5060
+ 7: "ura"
5061
+ };
5062
+ var two = (n) => n.toString().padStart(2, "0");
5063
+ function prnFor(system, id) {
5064
+ if (system === "J") return `J${two(id)}`;
5065
+ if (system === "S") return `S${two(19 + id)}`;
5066
+ return `${system}${two(id)}`;
5067
+ }
5068
+ function ssrUraMm(v) {
5069
+ if (v === 0) return null;
5070
+ const cls = v >> 3 & 7;
5071
+ const val = v & 7;
5072
+ return 3 ** cls * (1 + val / 4) - 1;
5073
+ }
5074
+ function decodeIgsSsr(frame) {
5075
+ if (frame.messageType !== 4076) return null;
5076
+ const r = new BitReader(frame.payload);
5077
+ r.readU(12);
5078
+ const version = r.readU(3);
5079
+ const im = r.readU(8);
5080
+ if (im === 201) return decodeIono(r, version, im);
5081
+ const base = Math.floor(im / 20) * 20;
5082
+ const system = SYSTEM_BY_BASE[base];
5083
+ const kind = KIND_BY_OFFSET[im - base];
5084
+ if (!system || !kind) return null;
5085
+ const epochS = r.readU(20);
5086
+ const updateIntervalS = UPDATE_INTERVAL_S[r.readU(4)];
5087
+ const multipleMessage = r.readU(1) === 1;
5088
+ const iodSsr = r.readU(4);
5089
+ const providerId = r.readU(16);
5090
+ const solutionId = r.readU(4);
5091
+ const hasDatum = kind === "orbit" || kind === "combined";
5092
+ const referenceDatum = hasDatum ? r.readU(1) : void 0;
5093
+ let dispersiveConsistency;
5094
+ let mwConsistency;
5095
+ if (kind === "phaseBias") {
5096
+ dispersiveConsistency = r.readU(1) === 1;
5097
+ mwConsistency = r.readU(1) === 1;
5098
+ }
5099
+ const nsat = r.readU(6);
5100
+ const readOrbit = (s) => {
5101
+ s.iode = r.readU(8);
5102
+ s.deltaRadial = r.readS(22) * 1e-4;
5103
+ s.deltaAlongTrack = r.readS(20) * 4e-4;
5104
+ s.deltaCrossTrack = r.readS(20) * 4e-4;
5105
+ s.dotRadial = r.readS(21) * 1e-6;
5106
+ s.dotAlongTrack = r.readS(19) * 4e-6;
5107
+ s.dotCrossTrack = r.readS(19) * 4e-6;
5108
+ };
5109
+ const readClock2 = (s) => {
5110
+ s.c0 = r.readS(22) * 1e-4;
5111
+ s.c1 = r.readS(21) * 1e-6;
5112
+ s.c2 = r.readS(27) * 2e-8;
5113
+ };
5114
+ const satellites = [];
5115
+ for (let i = 0; i < nsat; i++) {
5116
+ const id = r.readU(6);
5117
+ const sat = { prn: prnFor(system, id) };
5118
+ if (kind === "orbit" || kind === "combined") readOrbit(sat);
5119
+ if (kind === "clock" || kind === "combined") readClock2(sat);
5120
+ else if (kind === "ura")
5121
+ sat.uraMm = ssrUraMm(r.readU(6));
5122
+ else if (kind === "highRateClock")
5123
+ sat.highRateClock = r.readS(22) * 1e-4;
5124
+ else if (kind === "codeBias") {
5125
+ const n = r.readU(5);
5126
+ const biases = [];
5127
+ for (let b = 0; b < n; b++) {
5128
+ const signal = r.readU(5);
5129
+ biases.push({
5130
+ signal,
5131
+ signalName: `#${signal}`,
5132
+ biasM: r.readS(14) * 0.01
5133
+ // IDF025 0.01 m
5134
+ });
5135
+ }
5136
+ sat.codeBiases = biases;
5137
+ } else if (kind === "phaseBias") {
5138
+ const n = r.readU(5);
5139
+ r.readU(9);
5140
+ r.readS(8);
5141
+ const biases = [];
5142
+ for (let b = 0; b < n; b++) {
5143
+ const signal = r.readU(5);
5144
+ const integer = r.readU(1) === 1;
5145
+ const wideLaneGroup = r.readU(2);
5146
+ const discontinuity = r.readU(4);
5147
+ const biasM = r.readS(20) * 1e-4;
5148
+ biases.push({ signal, integer, wideLaneGroup, discontinuity, biasM });
5149
+ }
5150
+ sat.phaseBiases = biases;
5151
+ }
5152
+ satellites.push(sat);
5153
+ }
5154
+ return {
5155
+ messageType: 4076,
5156
+ version,
5157
+ igsMessageNumber: im,
5158
+ system,
5159
+ kind,
5160
+ epochS,
5161
+ updateIntervalS,
5162
+ multipleMessage,
5163
+ referenceDatum,
5164
+ iodSsr,
5165
+ providerId,
5166
+ solutionId,
5167
+ dispersiveConsistency,
5168
+ mwConsistency,
5169
+ satellites
5170
+ };
5171
+ }
5172
+ function decodeIono(r, version, im) {
5173
+ const epochS = r.readU(20);
5174
+ const updateIntervalS = UPDATE_INTERVAL_S[r.readU(4)];
5175
+ const multipleMessage = r.readU(1) === 1;
5176
+ const iodSsr = r.readU(4);
5177
+ const providerId = r.readU(16);
5178
+ const solutionId = r.readU(4);
5179
+ const qualityTecu = r.readU(9) * 0.05;
5180
+ const nLayers = r.readU(2) + 1;
5181
+ const layers = [];
5182
+ for (let l = 0; l < nLayers; l++) {
5183
+ const heightKm = r.readU(8) * 10;
5184
+ const degree = r.readU(4) + 1;
5185
+ const order = r.readU(4) + 1;
5186
+ const N = degree;
5187
+ const M = order;
5188
+ const nCoef = (N + 1) * (N + 1) - (N - M) * (N - M + 1);
5189
+ const nCos = nCoef;
5190
+ let nSin = 0;
5191
+ for (let m = 1; m <= M; m++) nSin += N - m + 1;
5192
+ for (let i = 0; i < nCos + nSin; i++) r.readS(16);
5193
+ layers.push({ heightKm, degree, order, coefficientCount: nCos + nSin });
5194
+ }
5195
+ return {
5196
+ messageType: 4076,
5197
+ version,
5198
+ igsMessageNumber: im,
5199
+ system: "I",
5200
+ kind: "ionosphere",
5201
+ epochS,
5202
+ updateIntervalS,
5203
+ multipleMessage,
5204
+ iodSsr,
5205
+ providerId,
5206
+ solutionId,
5207
+ satellites: [],
5208
+ iono: { qualityTecu, layers }
5209
+ };
5210
+ }
5211
+
5023
5212
  // src/rtcm3/legacy-obs.ts
5024
5213
  var PRUNIT_GPS = 299792.458;
5025
5214
  var PRUNIT_GLO = 599584.916;
@@ -5036,7 +5225,7 @@ function legacyLockSec(i) {
5036
5225
  if (i < 127) return 32 * i - 3096;
5037
5226
  return 937;
5038
5227
  }
5039
- var two = (n) => n.toString().padStart(2, "0");
5228
+ var two2 = (n) => n.toString().padStart(2, "0");
5040
5229
  function decodeLegacyObs(frame) {
5041
5230
  const type = frame.messageType;
5042
5231
  const gps = type >= 1001 && type <= 1004;
@@ -5122,7 +5311,7 @@ function decodeLegacyObs(frame) {
5122
5311
  signals.push(sig);
5123
5312
  }
5124
5313
  observations.push({
5125
- prn: `${system}${two(satId)}`,
5314
+ prn: `${system}${two2(satId)}`,
5126
5315
  system,
5127
5316
  signals
5128
5317
  });
@@ -5664,6 +5853,144 @@ function resetGloFreqCache() {
5664
5853
  gloFreqNum.fill(-128);
5665
5854
  }
5666
5855
 
5856
+ // src/rtcm3/ssr.ts
5857
+ var UPDATE_INTERVAL_S2 = [
5858
+ 1,
5859
+ 2,
5860
+ 5,
5861
+ 10,
5862
+ 15,
5863
+ 30,
5864
+ 60,
5865
+ 120,
5866
+ 240,
5867
+ 300,
5868
+ 600,
5869
+ 900,
5870
+ 1800,
5871
+ 3600,
5872
+ 7200,
5873
+ 10800
5874
+ ];
5875
+ var GPS_SIGNAL = {
5876
+ 0: "L1 C/A",
5877
+ 1: "L1 P",
5878
+ 2: "L1 Z-tracking",
5879
+ 5: "L2 C/A",
5880
+ 6: "L2 semi-codeless",
5881
+ 7: "L2C(M)",
5882
+ 8: "L2C(L)",
5883
+ 9: "L2C(M+L)",
5884
+ 10: "L2 P",
5885
+ 11: "L2 Z-tracking",
5886
+ 14: "L5 I",
5887
+ 15: "L5 Q"
5888
+ };
5889
+ var GLO_SIGNAL = {
5890
+ 0: "G1 C/A",
5891
+ 1: "G1 P",
5892
+ 2: "G2 C/A",
5893
+ 3: "G2 P"
5894
+ };
5895
+ var SSR_KIND = {
5896
+ 1057: { system: "G", kind: "orbit" },
5897
+ 1058: { system: "G", kind: "clock" },
5898
+ 1059: { system: "G", kind: "codeBias" },
5899
+ 1060: { system: "G", kind: "combined" },
5900
+ 1061: { system: "G", kind: "ura" },
5901
+ 1062: { system: "G", kind: "highRateClock" },
5902
+ 1063: { system: "R", kind: "orbit" },
5903
+ 1064: { system: "R", kind: "clock" },
5904
+ 1065: { system: "R", kind: "codeBias" },
5905
+ 1066: { system: "R", kind: "combined" },
5906
+ 1067: { system: "R", kind: "ura" },
5907
+ 1068: { system: "R", kind: "highRateClock" }
5908
+ };
5909
+ function ssrUraMm2(v) {
5910
+ if (v === 0) return null;
5911
+ const cls = v >> 3 & 7;
5912
+ const val = v & 7;
5913
+ return 3 ** cls * (1 + val / 4) - 1;
5914
+ }
5915
+ var two3 = (n) => n.toString().padStart(2, "0");
5916
+ function decodeSsr(frame) {
5917
+ const spec = SSR_KIND[frame.messageType];
5918
+ if (!spec) return null;
5919
+ const { system, kind } = spec;
5920
+ const gps = system === "G";
5921
+ const r = new BitReader(frame.payload);
5922
+ r.readU(12);
5923
+ const epochS = r.readU(gps ? 20 : 17);
5924
+ const updateIntervalS = UPDATE_INTERVAL_S2[r.readU(4)];
5925
+ const multipleMessage = r.readU(1) === 1;
5926
+ const hasDatum = kind === "orbit" || kind === "combined";
5927
+ const referenceDatum = hasDatum ? r.readU(1) : void 0;
5928
+ const iodSsr = r.readU(4);
5929
+ const providerId = r.readU(16);
5930
+ const solutionId = r.readU(4);
5931
+ const nsat = r.readU(6);
5932
+ const sigName = gps ? GPS_SIGNAL : GLO_SIGNAL;
5933
+ const satellites = [];
5934
+ const readOrbit = (sat) => {
5935
+ sat.deltaRadial = r.readS(22) * 1e-4;
5936
+ sat.deltaAlongTrack = r.readS(20) * 4e-4;
5937
+ sat.deltaCrossTrack = r.readS(20) * 4e-4;
5938
+ sat.dotRadial = r.readS(21) * 1e-6;
5939
+ sat.dotAlongTrack = r.readS(19) * 4e-6;
5940
+ sat.dotCrossTrack = r.readS(19) * 4e-6;
5941
+ };
5942
+ const readClock2 = (sat) => {
5943
+ sat.c0 = r.readS(22) * 1e-4;
5944
+ sat.c1 = r.readS(21) * 1e-6;
5945
+ sat.c2 = r.readS(27) * 2e-8;
5946
+ };
5947
+ for (let i = 0; i < nsat; i++) {
5948
+ const satId = gps ? r.readU(6) : r.readU(5);
5949
+ const sat = { prn: `${system}${two3(satId)}` };
5950
+ if (kind === "orbit" || kind === "combined") {
5951
+ sat.iode = r.readU(8);
5952
+ readOrbit(sat);
5953
+ }
5954
+ if (kind === "combined") readClock2(sat);
5955
+ else if (kind === "clock") readClock2(sat);
5956
+ else if (kind === "ura")
5957
+ sat.uraMm = ssrUraMm2(r.readU(6));
5958
+ else if (kind === "highRateClock")
5959
+ sat.highRateClock = r.readS(22) * 1e-4;
5960
+ else if (kind === "codeBias") {
5961
+ const ncb = r.readU(5);
5962
+ const biases = [];
5963
+ for (let c = 0; c < ncb; c++) {
5964
+ const signal = r.readU(5);
5965
+ const biasM = r.readS(14) * 0.01;
5966
+ biases.push({
5967
+ signal,
5968
+ signalName: sigName[signal] ?? `#${signal}`,
5969
+ biasM
5970
+ });
5971
+ }
5972
+ sat.codeBiases = biases;
5973
+ }
5974
+ satellites.push(sat);
5975
+ }
5976
+ return {
5977
+ messageType: frame.messageType,
5978
+ system,
5979
+ kind,
5980
+ epochS,
5981
+ updateIntervalS,
5982
+ multipleMessage,
5983
+ referenceDatum,
5984
+ iodSsr,
5985
+ providerId,
5986
+ solutionId,
5987
+ satellites
5988
+ };
5989
+ }
5990
+ function isSsrMessage(messageType) {
5991
+ return messageType in SSR_KIND;
5992
+ }
5993
+
5667
5994
  // src/rtcm3/station.ts
5668
5995
  function createStationMeta() {
5669
5996
  return {
@@ -6460,7 +6787,7 @@ function weekOfToe(week, tow, toe) {
6460
6787
  if (toe - tow < -HALF_WEEK3) return week + 1;
6461
6788
  return week;
6462
6789
  }
6463
- var two2 = (n) => String(n).padStart(2, "0");
6790
+ var two4 = (n) => String(n).padStart(2, "0");
6464
6791
  function decodeGalInavWords(words) {
6465
6792
  if (words.length < 96) return null;
6466
6793
  const b = words;
@@ -6548,7 +6875,7 @@ function decodeGalInavWords(words) {
6548
6875
  const tocDate = gpsDate2(week, tocs);
6549
6876
  return {
6550
6877
  system: "E",
6551
- prn: `E${two2(svid)}`,
6878
+ prn: `E${two4(svid)}`,
6552
6879
  toc: tocDate.getTime() / 1e3 % SEC_PER_WEEK5,
6553
6880
  tocDate,
6554
6881
  af0,
@@ -6656,7 +6983,7 @@ function decodeGalFnavPages(pages) {
6656
6983
  const tocDate = gpsDate2(week, tocs);
6657
6984
  return {
6658
6985
  system: "E",
6659
- prn: `E${two2(svid)}`,
6986
+ prn: `E${two4(svid)}`,
6660
6987
  toc: tocDate.getTime() / 1e3 % SEC_PER_WEEK5,
6661
6988
  tocDate,
6662
6989
  af0,
@@ -6712,7 +7039,7 @@ var GalInavAssembler = class {
6712
7039
  sat.words[type * 16 + 15] = getBitU(page, 124, 8);
6713
7040
  if (type !== 5) return null;
6714
7041
  const eph = decodeGalInavWords(sat.words);
6715
- if (!eph || eph.prn !== `E${two2(prn)}`) return null;
7042
+ if (!eph || eph.prn !== `E${two4(prn)}`) return null;
6716
7043
  const key = dedupKey(eph);
6717
7044
  if (key === sat.lastKey) return null;
6718
7045
  sat.lastKey = key;
@@ -6739,7 +7066,7 @@ var GalFnavAssembler = class {
6739
7066
  sat.words.set(page.subarray(0, 31), (type - 1) * 31);
6740
7067
  if (type !== 4) return null;
6741
7068
  const eph = decodeGalFnavPages(sat.words);
6742
- if (!eph || eph.prn !== `E${two2(prn)}`) return null;
7069
+ if (!eph || eph.prn !== `E${two4(prn)}`) return null;
6743
7070
  const key = dedupKey(eph);
6744
7071
  if (key === sat.lastKey) return null;
6745
7072
  sat.lastKey = key;
@@ -6913,7 +7240,7 @@ var GloStringAssembler = class {
6913
7240
  // src/navbits/sbas.ts
6914
7241
  var GPS_EPOCH_MS7 = Date.UTC(1980, 0, 6);
6915
7242
  var MS_PER_WEEK3 = 7 * 86400 * 1e3;
6916
- var two3 = (n) => String(n).padStart(2, "0");
7243
+ var two5 = (n) => String(n).padStart(2, "0");
6917
7244
  var SBAS_MT_GEO_NAV = 9;
6918
7245
  function sbasMessageType(msg) {
6919
7246
  return getBitU(msg, 8, 6);
@@ -6932,7 +7259,7 @@ function decodeSbasGeoNav(msg, prn, week, tow) {
6932
7259
  const ura = getBitU(msg, 35, 4);
6933
7260
  return {
6934
7261
  system: "S",
6935
- prn: `S${two3(prn - 100)}`,
7262
+ prn: `S${two5(prn - 100)}`,
6936
7263
  tocDate: new Date(GPS_EPOCH_MS7 + week * MS_PER_WEEK3 + t0Sec * 1e3),
6937
7264
  tauN: getBitS(msg, 206, 12) * 2 ** -31,
6938
7265
  // a_Gf0, clock offset (s)
@@ -6956,7 +7283,7 @@ function decodeSbasGeoNav(msg, prn, week, tow) {
6956
7283
  // src/ubx/rawnav.ts
6957
7284
  var GPS_EPOCH_MS8 = Date.UTC(1980, 0, 6);
6958
7285
  var SEC_PER_WEEK7 = 7 * 86400;
6959
- var two4 = (n) => String(n).padStart(2, "0");
7286
+ var two6 = (n) => String(n).padStart(2, "0");
6960
7287
  function parseUbxRawNav(data, opts = {}) {
6961
7288
  const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
6962
7289
  const ephemerides = [];
@@ -7032,7 +7359,7 @@ function parseUbxRawNav(data, opts = {}) {
7032
7359
  badParity++;
7033
7360
  continue;
7034
7361
  }
7035
- const eph = bds.push(`C${two4(svId)}`, sf);
7362
+ const eph = bds.push(`C${two6(svId)}`, sf);
7036
7363
  if (eph) ephemerides.push(eph);
7037
7364
  } else if (gnssId === 6) {
7038
7365
  if (p.length < 8 + 16) continue;
@@ -7051,7 +7378,7 @@ function parseUbxRawNav(data, opts = {}) {
7051
7378
  continue;
7052
7379
  }
7053
7380
  if (!refDate) continue;
7054
- const eph = glo.push(`R${two4(svId)}`, str2, refDate, p[3] - 7);
7381
+ const eph = glo.push(`R${two6(svId)}`, str2, refDate, p[3] - 7);
7055
7382
  if (eph) ephemerides.push(eph);
7056
7383
  } else if (gnssId === 1) {
7057
7384
  if (p.length < 8 + 32) continue;
@@ -7152,21 +7479,21 @@ var SIGNALS = {
7152
7479
  6: { 0: ["R", "1C"], 2: ["R", "2C"] }
7153
7480
  // GLONASS L1OF, L2OF
7154
7481
  };
7155
- function prnFor(gnssId, svId) {
7156
- const two10 = (n) => String(n).padStart(2, "0");
7482
+ function prnFor2(gnssId, svId) {
7483
+ const two12 = (n) => String(n).padStart(2, "0");
7157
7484
  switch (gnssId) {
7158
7485
  case 0:
7159
- return svId >= 1 && svId <= 32 ? `G${two10(svId)}` : null;
7486
+ return svId >= 1 && svId <= 32 ? `G${two12(svId)}` : null;
7160
7487
  case 1:
7161
- return svId >= 120 && svId <= 158 ? `S${two10(svId - 100)}` : null;
7488
+ return svId >= 120 && svId <= 158 ? `S${two12(svId - 100)}` : null;
7162
7489
  case 2:
7163
- return svId >= 1 && svId <= 36 ? `E${two10(svId)}` : null;
7490
+ return svId >= 1 && svId <= 36 ? `E${two12(svId)}` : null;
7164
7491
  case 3:
7165
- return svId >= 1 && svId <= 63 ? `C${two10(svId)}` : null;
7492
+ return svId >= 1 && svId <= 63 ? `C${two12(svId)}` : null;
7166
7493
  case 5:
7167
- return svId >= 1 && svId <= 10 ? `J${two10(svId)}` : null;
7494
+ return svId >= 1 && svId <= 10 ? `J${two12(svId)}` : null;
7168
7495
  case 6:
7169
- return svId >= 1 && svId <= 32 ? `R${two10(svId)}` : null;
7496
+ return svId >= 1 && svId <= 32 ? `R${two12(svId)}` : null;
7170
7497
  default:
7171
7498
  return null;
7172
7499
  }
@@ -7198,7 +7525,7 @@ function parseUbxRawx(data) {
7198
7525
  const svId = data[off + 21];
7199
7526
  const sigId = data[off + 22];
7200
7527
  const trkStat = data[off + 30];
7201
- const prn = prnFor(gnssId, svId);
7528
+ const prn = prnFor2(gnssId, svId);
7202
7529
  const sig = SIGNALS[gnssId]?.[sigId];
7203
7530
  if (!prn || !sig) continue;
7204
7531
  const prValid = (trkStat & 1) !== 0;
@@ -7269,22 +7596,22 @@ function scanSbfFrames(data, view, onBlock) {
7269
7596
  }
7270
7597
  return badCrc;
7271
7598
  }
7272
- var two5 = (n) => String(n).padStart(2, "0");
7599
+ var two7 = (n) => String(n).padStart(2, "0");
7273
7600
  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;
7601
+ if (svid >= 1 && svid <= 37) return svid <= 32 ? `G${two7(svid)}` : null;
7602
+ if (svid <= 61) return svid - 37 <= 27 ? `R${two7(svid - 37)}` : null;
7276
7603
  if (svid <= 62) return null;
7277
- if (svid <= 68) return svid - 38 <= 27 ? `R${two5(svid - 38)}` : null;
7604
+ if (svid <= 68) return svid - 38 <= 27 ? `R${two7(svid - 38)}` : null;
7278
7605
  if (svid <= 70) return null;
7279
- if (svid <= 106) return svid - 70 <= 36 ? `E${two5(svid - 70)}` : null;
7606
+ if (svid <= 106) return svid - 70 <= 36 ? `E${two7(svid - 70)}` : null;
7280
7607
  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;
7608
+ if (svid <= 140) return `S${two7(svid - 100)}`;
7609
+ if (svid <= 180) return svid - 140 <= 50 ? `C${two7(svid - 140)}` : null;
7610
+ if (svid <= 190) return `J${two7(svid - 180)}`;
7611
+ if (svid <= 197) return svid - 190 <= 14 ? `I${two7(svid - 190)}` : null;
7612
+ if (svid <= 215) return `S${two7(svid - 157)}`;
7613
+ if (svid <= 222) return svid - 208 <= 14 ? `I${two7(svid - 208)}` : null;
7614
+ if (svid <= 245) return svid - 182 <= 50 ? `C${two7(svid - 182)}` : null;
7288
7615
  return null;
7289
7616
  }
7290
7617
 
@@ -8896,23 +9223,23 @@ var MEAS2_SIG = [
8896
9223
  ["J", "1E"],
8897
9224
  ["J", "5P"]
8898
9225
  ];
8899
- var two6 = (n) => String(n).padStart(2, "0");
9226
+ var two8 = (n) => String(n).padStart(2, "0");
8900
9227
  function m3Prn(navsys, svid) {
8901
9228
  switch (navsys) {
8902
9229
  case 0:
8903
- return svid < 32 ? `G${two6(svid + 1)}` : null;
9230
+ return svid < 32 ? `G${two8(svid + 1)}` : null;
8904
9231
  case 1:
8905
- return svid < 27 ? `R${two6(svid + 1)}` : null;
9232
+ return svid < 27 ? `R${two8(svid + 1)}` : null;
8906
9233
  case 2:
8907
- return svid < 36 ? `E${two6(svid + 1)}` : null;
9234
+ return svid < 36 ? `E${two8(svid + 1)}` : null;
8908
9235
  case 3:
8909
- return svid < 50 ? `C${two6(svid + 1)}` : null;
9236
+ return svid < 50 ? `C${two8(svid + 1)}` : null;
8910
9237
  case 4:
8911
- return svid <= 38 ? `S${two6(svid + 20)}` : null;
9238
+ return svid <= 38 ? `S${two8(svid + 20)}` : null;
8912
9239
  case 5:
8913
- return svid < 10 ? `J${two6(svid + 1)}` : null;
9240
+ return svid < 10 ? `J${two8(svid + 1)}` : null;
8914
9241
  case 6:
8915
- return svid < 14 ? `I${two6(svid + 1)}` : null;
9242
+ return svid < 14 ? `I${two8(svid + 1)}` : null;
8916
9243
  default:
8917
9244
  return null;
8918
9245
  }
@@ -10746,7 +11073,7 @@ var MS_PER_WEEK12 = SEC_PER_WEEK11 * 1e3;
10746
11073
  var SC2RAD = GPS_PI;
10747
11074
  var gpsMs4 = (week, sec) => GPS_EPOCH_MS20 + week * MS_PER_WEEK12 + sec * 1e3;
10748
11075
  var sowOf5 = (dateMs) => (dateMs / 1e3 % SEC_PER_WEEK11 + SEC_PER_WEEK11) % SEC_PER_WEEK11;
10749
- var two7 = (n) => String(n).padStart(2, "0");
11076
+ var two9 = (n) => String(n).padStart(2, "0");
10750
11077
  var Reader = class {
10751
11078
  constructor(view, start, le) {
10752
11079
  this.view = view;
@@ -10841,7 +11168,7 @@ function decodeGpsQzss(view, p, le, sys) {
10841
11168
  const tocDate = new Date(gpsMs4(week, toes));
10842
11169
  return {
10843
11170
  system: sys,
10844
- prn: `${sys}${two7(prn)}`,
11171
+ prn: `${sys}${two9(prn)}`,
10845
11172
  toc: sowOf5(tocDate.getTime()),
10846
11173
  tocDate,
10847
11174
  af0,
@@ -10874,7 +11201,7 @@ function decodeGalileo(view, p, le) {
10874
11201
  const tocDate = new Date(gpsMs4(week, toes));
10875
11202
  return {
10876
11203
  system: "E",
10877
- prn: `E${two7(prn)}`,
11204
+ prn: `E${two9(prn)}`,
10878
11205
  toc: sowOf5(tocDate.getTime()),
10879
11206
  tocDate,
10880
11207
  af0,
@@ -10912,7 +11239,7 @@ function decodeBeidou(view, p, le) {
10912
11239
  const tocDate = new Date(BDT_EPOCH_MS5 + week * MS_PER_WEEK12 + toes * 1e3);
10913
11240
  return {
10914
11241
  system: "C",
10915
- prn: `C${two7(prn)}`,
11242
+ prn: `C${two9(prn)}`,
10916
11243
  toc: sowOf5(tocDate.getTime()),
10917
11244
  tocDate,
10918
11245
  af0,
@@ -10952,7 +11279,7 @@ function decodeGlonass(view, p, le) {
10952
11279
  );
10953
11280
  return {
10954
11281
  system: "R",
10955
- prn: `R${two7(slot)}`,
11282
+ prn: `R${two9(slot)}`,
10956
11283
  tocDate,
10957
11284
  tauN,
10958
11285
  gammaN,
@@ -10991,7 +11318,7 @@ function decodeSbas(view, p, le) {
10991
11318
  if (prn < 120 || prn > 158) return null;
10992
11319
  return {
10993
11320
  system: "S",
10994
- prn: `S${two7(prn - 100)}`,
11321
+ prn: `S${two9(prn - 100)}`,
10995
11322
  tocDate: new Date(gpsMs4(week, toe)),
10996
11323
  tauN: af0,
10997
11324
  gammaN: af1,
@@ -11168,22 +11495,22 @@ var OBS_CODES = {
11168
11495
  ]
11169
11496
  // QZSS
11170
11497
  };
11171
- var two8 = (n) => String(n).padStart(2, "0");
11498
+ var two10 = (n) => String(n).padStart(2, "0");
11172
11499
  function obsPrn(sys, prn) {
11173
11500
  switch (sys) {
11174
11501
  case 0:
11175
- return prn >= 1 && prn <= 32 ? `G${two8(prn)}` : null;
11502
+ return prn >= 1 && prn <= 32 ? `G${two10(prn)}` : null;
11176
11503
  case 1:
11177
- return prn >= 1 && prn <= 27 ? `R${two8(prn)}` : null;
11504
+ return prn >= 1 && prn <= 27 ? `R${two10(prn)}` : null;
11178
11505
  case 2:
11179
- return prn >= 120 && prn <= 158 ? `S${two8(prn - 100)}` : null;
11506
+ return prn >= 120 && prn <= 158 ? `S${two10(prn - 100)}` : null;
11180
11507
  case 3:
11181
- return prn >= 1 && prn <= 36 ? `E${two8(prn)}` : null;
11508
+ return prn >= 1 && prn <= 36 ? `E${two10(prn)}` : null;
11182
11509
  case 4:
11183
- return prn >= 1 && prn <= 63 ? `C${two8(prn)}` : null;
11510
+ return prn >= 1 && prn <= 63 ? `C${two10(prn)}` : null;
11184
11511
  case 5:
11185
- if (prn >= 193 && prn <= 202) return `J${two8(prn - 192)}`;
11186
- return prn >= 1 && prn <= 10 ? `J${two8(prn)}` : null;
11512
+ if (prn >= 193 && prn <= 202) return `J${two10(prn - 192)}`;
11513
+ return prn >= 1 && prn <= 10 ? `J${two10(prn)}` : null;
11187
11514
  default:
11188
11515
  return null;
11189
11516
  }
@@ -13536,7 +13863,7 @@ var SEC_PER_WEEK12 = 604800;
13536
13863
  var MAXSBSAGEF = 30;
13537
13864
  var MAXSBSAGEL = 360;
13538
13865
  var MAXBAND = 10;
13539
- var two9 = (n) => String(n).padStart(2, "0");
13866
+ var two11 = (n) => String(n).padStart(2, "0");
13540
13867
  var VAR_FCORR = [
13541
13868
  0.052,
13542
13869
  0.0924,
@@ -13682,10 +14009,10 @@ var igpband2 = [
13682
14009
  ];
13683
14010
  var gpsSeconds = (week, tow) => week * SEC_PER_WEEK12 + tow;
13684
14011
  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)}`;
14012
+ if (i >= 1 && i <= 37) return `G${two11(i)}`;
14013
+ if (i >= 38 && i <= 61) return `R${two11(i - 37)}`;
14014
+ if (i >= 120 && i <= 138) return `S${two11(i - 100)}`;
14015
+ if (i >= 193 && i <= 202) return `J${two11(i - 192)}`;
13689
14016
  return null;
13690
14017
  }
13691
14018
  function ionppp(latRad, lonRad, azRad, elRad, re, hion) {
@@ -13724,7 +14051,7 @@ var SbasProcessor = class {
13724
14051
  if (week === 0) return -1;
13725
14052
  const type = sbasMessageType(msg);
13726
14053
  if (geoPrn != null && geoPrn >= 120 && geoPrn <= 158)
13727
- this.geoPrns.add(`S${two9(geoPrn - 100)}`);
14054
+ this.geoPrns.add(`S${two11(geoPrn - 100)}`);
13728
14055
  switch (type) {
13729
14056
  case 1:
13730
14057
  return this.decodeMask(msg) ? type : -1;
@@ -18273,9 +18600,11 @@ function computePsdDb(centerMHz, halfSpanChips, numPoints, psdFn, f0 = 1023e3, f
18273
18600
  dateToEpoch,
18274
18601
  decodeBinexEph,
18275
18602
  decodeEphemeris,
18603
+ decodeIgsSsr,
18276
18604
  decodeLegacyObs,
18277
18605
  decodeMsmFull,
18278
18606
  decodeSbfNavigation,
18607
+ decodeSsr,
18279
18608
  deg2dms,
18280
18609
  deg2rad,
18281
18610
  detrendIonoArcs,
@@ -18368,6 +18697,7 @@ function computePsdDb(centerMHz, halfSpanChips, numPoints, psdFn, f0 = 1023e3, f
18368
18697
  ionoFree,
18369
18698
  isSbasL1Preamble,
18370
18699
  isSbasL5Correction,
18700
+ isSsrMessage,
18371
18701
  keplerPosition,
18372
18702
  klobucharDelay,
18373
18703
  lambdaReduction,