gnss-js 2.3.0 → 2.5.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
@@ -13,7 +13,7 @@ export { RTCM2_MESSAGE_NAMES, Rtcm2Correction, Rtcm2Decoder, Rtcm2Frame, Rtcm2Ob
13
13
  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-BAnBLLB9.cjs';
14
14
  export { IgsSsrIonoLayer, IgsSsrMessage, MessageTypeStats, ObsEpoch, ObsSatObs, ObsSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, SsrCodeBias, SsrKind, SsrMessage, SsrPhaseBias, SsrSatCorrection, StationMeta, StreamStats, SystemParams, SystemParamsMessage, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeObs, decodeSsr, decodeSystemParams, isSsrMessage, obsEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.cjs';
15
15
  export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxPvtResult, UbxRawNavOptions, UbxRawNavResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxPvt, parseUbxRawNav, parseUbxRawx, ubxFrames } from './ubx.cjs';
16
- export { DfmcCensus, DfmcMessageCb, GeoL5Result, 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
+ export { DfmcCensus, DfmcMessageCb, GeoL5Result, SBAS_L5_MT_NAMES, SBAS_L5_PREAMBLE_UW, SbasMessageCb, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGeoL5Result, SbfGeoNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavicResult, SbfNavigation, SbfParseResult, SbfPvt, SbfPvtResult, SbfReceiverSetup, decodeSbfNavigation, extractSbfNavicSubframe, feedGeoBlock, feedGeoL5Block, feedNavicBlock, isSbasL1Preamble, isSbasL5Correction, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoL5, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfNavic, parseSbfPvt, parseSbfReceiverSetup, sbasL5MessageName, sbasL5MessageType, sbfCrc16, scanSbfFrames } from './sbf.cjs';
17
17
  export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, NovatelPvtResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelPvt, parseNovatelRange } from './novatel.cjs';
18
18
  export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, TrimbleParseResult, parseTrimble, parseTrimbleNav, trimbleFrames } from './trimble.cjs';
19
19
  export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.cjs';
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { RTCM2_MESSAGE_NAMES, Rtcm2Correction, Rtcm2Decoder, Rtcm2Frame, Rtcm2Ob
13
13
  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-BAnBLLB9.js';
14
14
  export { IgsSsrIonoLayer, IgsSsrMessage, MessageTypeStats, ObsEpoch, ObsSatObs, ObsSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, SsrCodeBias, SsrKind, SsrMessage, SsrPhaseBias, SsrSatCorrection, StationMeta, StreamStats, SystemParams, SystemParamsMessage, createStationMeta, createStreamStats, decodeIgsSsr, decodeLegacyObs, decodeMsmFull, decodeObs, decodeSsr, decodeSystemParams, isSsrMessage, obsEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.js';
15
15
  export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxPvtResult, UbxRawNavOptions, UbxRawNavResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxPvt, parseUbxRawNav, parseUbxRawx, ubxFrames } from './ubx.js';
16
- export { DfmcCensus, DfmcMessageCb, GeoL5Result, 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
+ export { DfmcCensus, DfmcMessageCb, GeoL5Result, SBAS_L5_MT_NAMES, SBAS_L5_PREAMBLE_UW, SbasMessageCb, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGeoL5Result, SbfGeoNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavicResult, SbfNavigation, SbfParseResult, SbfPvt, SbfPvtResult, SbfReceiverSetup, decodeSbfNavigation, extractSbfNavicSubframe, feedGeoBlock, feedGeoL5Block, feedNavicBlock, isSbasL1Preamble, isSbasL5Correction, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoL5, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfNavic, parseSbfPvt, parseSbfReceiverSetup, sbasL5MessageName, sbasL5MessageType, sbfCrc16, scanSbfFrames } from './sbf.js';
17
17
  export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, NovatelPvtResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelPvt, parseNovatelRange } from './novatel.js';
18
18
  export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, TrimbleParseResult, parseTrimble, parseTrimbleNav, trimbleFrames } from './trimble.js';
19
19
  export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.js';
package/dist/index.js CHANGED
@@ -77,7 +77,7 @@ import {
77
77
  setRtcm3DebugHandler,
78
78
  updateStationMeta,
79
79
  updateStreamStats
80
- } from "./chunk-XPQ4BU6W.js";
80
+ } from "./chunk-7GNRNKBR.js";
81
81
  import {
82
82
  parseUbxCnav,
83
83
  parseUbxIonoUtc,
@@ -92,8 +92,10 @@ import {
92
92
  SBAS_L5_PREAMBLE_UW,
93
93
  crc16,
94
94
  decodeSbfNavigation,
95
+ extractSbfNavicSubframe,
95
96
  feedGeoBlock,
96
97
  feedGeoL5Block,
98
+ feedNavicBlock,
97
99
  isSbasL1Preamble,
98
100
  isSbasL5Correction,
99
101
  parseSbfAlmanac,
@@ -108,12 +110,13 @@ import {
108
110
  parseSbfIonoUtc,
109
111
  parseSbfMeas,
110
112
  parseSbfNav,
113
+ parseSbfNavic,
111
114
  parseSbfPvt,
112
115
  parseSbfReceiverSetup,
113
116
  sbasL5MessageName,
114
117
  sbasL5MessageType,
115
118
  scanSbfFrames
116
- } from "./chunk-WW3DKCDN.js";
119
+ } from "./chunk-74IVYOQV.js";
117
120
  import "./chunk-3KSDL3CO.js";
118
121
  import {
119
122
  OEM4_HLEN,
@@ -209,7 +212,7 @@ import {
209
212
  sunEcef,
210
213
  toRtkEpoch,
211
214
  wlWavelength
212
- } from "./chunk-TYJNN77C.js";
215
+ } from "./chunk-B2XWO4RP.js";
213
216
  import "./chunk-WQX354KD.js";
214
217
  import {
215
218
  almanacEpochMs,
@@ -542,9 +545,11 @@ export {
542
545
  estimateNetworkFcbs,
543
546
  estimateWidelaneFcb,
544
547
  euclidean3D,
548
+ extractSbfNavicSubframe,
545
549
  extractWidelaneArcs,
546
550
  feedGeoBlock,
547
551
  feedGeoL5Block,
552
+ feedNavicBlock,
548
553
  fetchSourcetable,
549
554
  findSatBias,
550
555
  fixPppPosition,
@@ -664,6 +669,7 @@ export {
664
669
  parseSbfIonoUtc,
665
670
  parseSbfMeas,
666
671
  parseSbfNav,
672
+ parseSbfNavic,
667
673
  parseSbfPvt,
668
674
  parseSbfReceiverSetup,
669
675
  parseSinexBiasDcb,
@@ -2132,6 +2132,10 @@ var SbasProcessor = class {
2132
2132
  tlat = 0;
2133
2133
  degr = null;
2134
2134
  mt27 = null;
2135
+ /** MT28 clock-ephemeris covariance per PRN: the upper-triangular Cholesky
2136
+ * factor E (10 elements [E11,E22,E33,E44,E12,E13,E14,E23,E24,E34]) and its
2137
+ * scale exponent. Keyed by PRN; cleared on a mask change. */
2138
+ mt28 = /* @__PURE__ */ new Map();
2135
2139
  ion = [];
2136
2140
  /** GEO PRN(s) whose messages have been ingested. */
2137
2141
  geoPrns = /* @__PURE__ */ new Set();
@@ -2162,6 +2166,8 @@ var SbasProcessor = class {
2162
2166
  return this.decodeMt10(msg) ? type : -1;
2163
2167
  case 27:
2164
2168
  return this.decodeMt27(msg) ? type : -1;
2169
+ case 28:
2170
+ return this.decodeMt28(msg) ? type : -1;
2165
2171
  case 18:
2166
2172
  return this.decodeIgpMask(msg) ? type : -1;
2167
2173
  case 24:
@@ -2188,6 +2194,7 @@ var SbasProcessor = class {
2188
2194
  return true;
2189
2195
  this.iodp = iodp;
2190
2196
  this.sats = prns.map((prn) => ({ prn }));
2197
+ this.mt28.clear();
2191
2198
  this.satIdx.clear();
2192
2199
  this.sats.forEach((s, k) => {
2193
2200
  if (s.prn) this.satIdx.set(s.prn, k);
@@ -2253,7 +2260,9 @@ var SbasProcessor = class {
2253
2260
  iiono: u(117, 9) || 1,
2254
2261
  cionoRamp: u(126, 10) * 5e-6,
2255
2262
  rssUdre: u(136, 1) === 1,
2256
- rssIono: u(137, 1) === 1
2263
+ rssIono: u(137, 1) === 1,
2264
+ ccovariance: u(138, 7) * 0.1
2265
+ // Table B-49: 0..12.7 m, 0.1 m
2257
2266
  };
2258
2267
  return true;
2259
2268
  }
@@ -2305,6 +2314,51 @@ var SbasProcessor = class {
2305
2314
  }
2306
2315
  return best ?? DELTA_UDRE[s.udreOutside] ?? 1;
2307
2316
  }
2317
+ /** MT28 clock-ephemeris covariance (ICAO Annex 10 Vol I §3.5.4.7 / Table B-51):
2318
+ * two satellites per message, each an upper-triangular Cholesky factor E and a
2319
+ * scale exponent that together define the relative clock-ephemeris covariance
2320
+ * used for a geometry-dependent δUDRE (§3.5.5.6.2.5). Slots are indexed into
2321
+ * the current MT1 mask, so a mismatched IODP is dropped. */
2322
+ decodeMt28(msg) {
2323
+ if (this.iodp !== getBitU(msg, 14, 2)) return false;
2324
+ for (const base of [16, 121]) {
2325
+ const slot = getBitU(msg, base, 6);
2326
+ const prn = this.sats[slot]?.prn;
2327
+ const scaleExp = getBitU(msg, base + 6, 3);
2328
+ const e = [
2329
+ getBitU(msg, base + 9, 9),
2330
+ getBitU(msg, base + 18, 9),
2331
+ getBitU(msg, base + 27, 9),
2332
+ getBitU(msg, base + 36, 9),
2333
+ getBitS(msg, base + 45, 10),
2334
+ getBitS(msg, base + 55, 10),
2335
+ getBitS(msg, base + 65, 10),
2336
+ getBitS(msg, base + 75, 10),
2337
+ getBitS(msg, base + 85, 10),
2338
+ getBitS(msg, base + 95, 10)
2339
+ ];
2340
+ if (prn && e.some((v) => v !== 0)) this.mt28.set(prn, { scaleExp, e });
2341
+ }
2342
+ return true;
2343
+ }
2344
+ /** Geometry-dependent δUDRE multiplier from MT28 (§3.5.5.6.2.5):
2345
+ * δUDRE = √(Iᵀ·C·I) + ε_c, with C = Rᵀ·R, R = E·2^(scaleExp−5),
2346
+ * I = [î_user→sat, 1], ε_c = C_covariance·2^(scaleExp−5). Since C = RᵀR,
2347
+ * Iᵀ·C·I = ‖R·I‖², so we form R·I directly. Null when no MT28 for `prn`. */
2348
+ mt28DeltaUdre(prn, los) {
2349
+ const m = this.mt28.get(prn);
2350
+ if (!m) return null;
2351
+ const sf = 2 ** (m.scaleExp - 5);
2352
+ const [e11, e22, e33, e44, e12, e13, e14, e23, e24, e34] = m.e;
2353
+ const [ix, iy, iz] = los;
2354
+ const v0 = (e11 * ix + e12 * iy + e13 * iz + e14) * sf;
2355
+ const v1 = (e22 * iy + e23 * iz + e24) * sf;
2356
+ const v2 = (e33 * iz + e34) * sf;
2357
+ const v3 = e44 * sf;
2358
+ const iCi = v0 * v0 + v1 * v1 + v2 * v2 + v3 * v3;
2359
+ const ec = (this.degr?.ccovariance ?? 0) * sf;
2360
+ return Math.sqrt(iCi) + ec;
2361
+ }
2308
2362
  decodeMixed(msg, week, tow) {
2309
2363
  if (this.iodp !== getBitU(msg, 110, 2)) return false;
2310
2364
  const blk = getBitU(msg, 112, 2);
@@ -2509,7 +2563,7 @@ var SbasProcessor = class {
2509
2563
  * no valid (unexpired) long-term + fast correction is available. Add `dPos`
2510
2564
  * to the satellite ECEF position and `dClkS` to its clock bias.
2511
2565
  */
2512
- satCorrection(prn, week, tow, userLatRad, userLonRad) {
2566
+ satCorrection(prn, week, tow, userLatRad, userLonRad, losUnitEcef) {
2513
2567
  const idx = this.satIdx.get(prn);
2514
2568
  if (idx === void 0) return null;
2515
2569
  const s = this.sats[idx];
@@ -2531,7 +2585,8 @@ var SbasProcessor = class {
2531
2585
  const tf = now - s.fcorr.t0s + this.tlat;
2532
2586
  if (Math.abs(tf) > MAXSBSAGEF || s.fcorr.udre >= 15) return null;
2533
2587
  const prc = s.fcorr.prc;
2534
- const dudre = userLatRad != null && userLonRad != null ? this.deltaUdre(
2588
+ const mt28 = losUnitEcef ? this.mt28DeltaUdre(prn, losUnitEcef) : null;
2589
+ const dudre = mt28 != null ? mt28 : userLatRad != null && userLonRad != null ? this.deltaUdre(
2535
2590
  userLatRad * 180 / Math.PI,
2536
2591
  userLonRad * 180 / Math.PI
2537
2592
  ) : 1;
@@ -4323,7 +4378,10 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
4323
4378
  used.push(prn);
4324
4379
  azels.push(azel);
4325
4380
  if (sbas) {
4326
- const sc = sbas.satCorrection(prn, gpsWeek, gpsTow, rxLat, rxLon);
4381
+ const dx = sat.x - x, dy = sat.y - y, dz = sat.z - z;
4382
+ const dr = Math.hypot(dx, dy, dz) || 1;
4383
+ const los = [dx / dr, dy / dr, dz / dr];
4384
+ const sc = sbas.satCorrection(prn, gpsWeek, gpsTow, rxLat, rxLon, los);
4327
4385
  const si = sbas.ionoDelay(
4328
4386
  gpsWeek,
4329
4387
  gpsTow,
@@ -668,6 +668,8 @@ interface Degradation {
668
668
  cionoRamp: number;
669
669
  rssUdre: boolean;
670
670
  rssIono: boolean;
671
+ /** Cᶜᵒᵛᵃʳⁱᵃⁿᶜᵉ — the MT28 δUDRE quantization term (m), 0 when no MT28. */
672
+ ccovariance: number;
671
673
  }
672
674
  /** A per-satellite SBAS correction, ready to apply in an SPP solve. */
673
675
  interface SbasSatCorrection {
@@ -715,6 +717,10 @@ declare class SbasProcessor {
715
717
  private tlat;
716
718
  private degr;
717
719
  private mt27;
720
+ /** MT28 clock-ephemeris covariance per PRN: the upper-triangular Cholesky
721
+ * factor E (10 elements [E11,E22,E33,E44,E12,E13,E14,E23,E24,E34]) and its
722
+ * scale exponent. Keyed by PRN; cleared on a mask change. */
723
+ private mt28;
718
724
  private ion;
719
725
  /** GEO PRN(s) whose messages have been ingested. */
720
726
  readonly geoPrns: Set<string>;
@@ -739,6 +745,17 @@ declare class SbasProcessor {
739
745
  * set: the highest-priority containing region wins (ties → lower δUDRE),
740
746
  * else the outside value. 1 when no MT27 has been received. */
741
747
  deltaUdre(latDeg: number, lonDeg: number): number;
748
+ /** MT28 clock-ephemeris covariance (ICAO Annex 10 Vol I §3.5.4.7 / Table B-51):
749
+ * two satellites per message, each an upper-triangular Cholesky factor E and a
750
+ * scale exponent that together define the relative clock-ephemeris covariance
751
+ * used for a geometry-dependent δUDRE (§3.5.5.6.2.5). Slots are indexed into
752
+ * the current MT1 mask, so a mismatched IODP is dropped. */
753
+ private decodeMt28;
754
+ /** Geometry-dependent δUDRE multiplier from MT28 (§3.5.5.6.2.5):
755
+ * δUDRE = √(Iᵀ·C·I) + ε_c, with C = Rᵀ·R, R = E·2^(scaleExp−5),
756
+ * I = [î_user→sat, 1], ε_c = C_covariance·2^(scaleExp−5). Since C = RᵀR,
757
+ * Iᵀ·C·I = ‖R·I‖², so we form R·I directly. Null when no MT28 for `prn`. */
758
+ private mt28DeltaUdre;
742
759
  private decodeMixed;
743
760
  private decodeLongCorrHalf;
744
761
  private decodeLong0;
@@ -782,7 +799,11 @@ declare class SbasProcessor {
782
799
  * no valid (unexpired) long-term + fast correction is available. Add `dPos`
783
800
  * to the satellite ECEF position and `dClkS` to its clock bias.
784
801
  */
785
- satCorrection(prn: string, week: number, tow: number, userLatRad?: number, userLonRad?: number): SbasSatCorrection | null;
802
+ satCorrection(prn: string, week: number, tow: number, userLatRad?: number, userLonRad?: number,
803
+ /** Unit line-of-sight vector user→satellite in ECEF, for the MT28
804
+ * geometry-dependent δUDRE (final protection-level pass). When given and
805
+ * MT28 data exists for the PRN, it supersedes the MT27 region δUDRE. */
806
+ losUnitEcef?: readonly [number, number, number]): SbasSatCorrection | null;
786
807
  /** The last-decoded MT10 degradation factors, or null if none seen. */
787
808
  get degradation(): Readonly<Degradation> | null;
788
809
  /**
@@ -1557,7 +1578,10 @@ interface SbasCorrectionSource {
1557
1578
  satCorrection(prn: string, week: number, tow: number,
1558
1579
  /** User geodetic lat/lon (rad) for the MT27 service-region δUDRE, when
1559
1580
  * known (the final protection-level pass). Omitted during iteration. */
1560
- userLatRad?: number, userLonRad?: number): {
1581
+ userLatRad?: number, userLonRad?: number,
1582
+ /** Unit LOS user→satellite (ECEF) for the MT28 geometry-dependent δUDRE
1583
+ * (final protection-level pass). */
1584
+ losUnitEcef?: readonly [number, number, number]): {
1561
1585
  dPos: [number, number, number];
1562
1586
  dClkS: number;
1563
1587
  varM2: number;
@@ -668,6 +668,8 @@ interface Degradation {
668
668
  cionoRamp: number;
669
669
  rssUdre: boolean;
670
670
  rssIono: boolean;
671
+ /** Cᶜᵒᵛᵃʳⁱᵃⁿᶜᵉ — the MT28 δUDRE quantization term (m), 0 when no MT28. */
672
+ ccovariance: number;
671
673
  }
672
674
  /** A per-satellite SBAS correction, ready to apply in an SPP solve. */
673
675
  interface SbasSatCorrection {
@@ -715,6 +717,10 @@ declare class SbasProcessor {
715
717
  private tlat;
716
718
  private degr;
717
719
  private mt27;
720
+ /** MT28 clock-ephemeris covariance per PRN: the upper-triangular Cholesky
721
+ * factor E (10 elements [E11,E22,E33,E44,E12,E13,E14,E23,E24,E34]) and its
722
+ * scale exponent. Keyed by PRN; cleared on a mask change. */
723
+ private mt28;
718
724
  private ion;
719
725
  /** GEO PRN(s) whose messages have been ingested. */
720
726
  readonly geoPrns: Set<string>;
@@ -739,6 +745,17 @@ declare class SbasProcessor {
739
745
  * set: the highest-priority containing region wins (ties → lower δUDRE),
740
746
  * else the outside value. 1 when no MT27 has been received. */
741
747
  deltaUdre(latDeg: number, lonDeg: number): number;
748
+ /** MT28 clock-ephemeris covariance (ICAO Annex 10 Vol I §3.5.4.7 / Table B-51):
749
+ * two satellites per message, each an upper-triangular Cholesky factor E and a
750
+ * scale exponent that together define the relative clock-ephemeris covariance
751
+ * used for a geometry-dependent δUDRE (§3.5.5.6.2.5). Slots are indexed into
752
+ * the current MT1 mask, so a mismatched IODP is dropped. */
753
+ private decodeMt28;
754
+ /** Geometry-dependent δUDRE multiplier from MT28 (§3.5.5.6.2.5):
755
+ * δUDRE = √(Iᵀ·C·I) + ε_c, with C = Rᵀ·R, R = E·2^(scaleExp−5),
756
+ * I = [î_user→sat, 1], ε_c = C_covariance·2^(scaleExp−5). Since C = RᵀR,
757
+ * Iᵀ·C·I = ‖R·I‖², so we form R·I directly. Null when no MT28 for `prn`. */
758
+ private mt28DeltaUdre;
742
759
  private decodeMixed;
743
760
  private decodeLongCorrHalf;
744
761
  private decodeLong0;
@@ -782,7 +799,11 @@ declare class SbasProcessor {
782
799
  * no valid (unexpired) long-term + fast correction is available. Add `dPos`
783
800
  * to the satellite ECEF position and `dClkS` to its clock bias.
784
801
  */
785
- satCorrection(prn: string, week: number, tow: number, userLatRad?: number, userLonRad?: number): SbasSatCorrection | null;
802
+ satCorrection(prn: string, week: number, tow: number, userLatRad?: number, userLonRad?: number,
803
+ /** Unit line-of-sight vector user→satellite in ECEF, for the MT28
804
+ * geometry-dependent δUDRE (final protection-level pass). When given and
805
+ * MT28 data exists for the PRN, it supersedes the MT27 region δUDRE. */
806
+ losUnitEcef?: readonly [number, number, number]): SbasSatCorrection | null;
786
807
  /** The last-decoded MT10 degradation factors, or null if none seen. */
787
808
  get degradation(): Readonly<Degradation> | null;
788
809
  /**
@@ -1557,7 +1578,10 @@ interface SbasCorrectionSource {
1557
1578
  satCorrection(prn: string, week: number, tow: number,
1558
1579
  /** User geodetic lat/lon (rad) for the MT27 service-region δUDRE, when
1559
1580
  * known (the final protection-level pass). Omitted during iteration. */
1560
- userLatRad?: number, userLonRad?: number): {
1581
+ userLatRad?: number, userLonRad?: number,
1582
+ /** Unit LOS user→satellite (ECEF) for the MT28 geometry-dependent δUDRE
1583
+ * (final protection-level pass). */
1584
+ losUnitEcef?: readonly [number, number, number]): {
1561
1585
  dPos: [number, number, number];
1562
1586
  dClkS: number;
1563
1587
  varM2: number;
@@ -39,7 +39,7 @@ import {
39
39
  sunEcef,
40
40
  toRtkEpoch,
41
41
  wlWavelength
42
- } from "./chunk-TYJNN77C.js";
42
+ } from "./chunk-B2XWO4RP.js";
43
43
  import "./chunk-WQX354KD.js";
44
44
  import "./chunk-JYWYQ7DW.js";
45
45
  import "./chunk-HVXYFUCB.js";
package/dist/rtcm3.cjs CHANGED
@@ -564,6 +564,70 @@ function decodeQzssEphemeris(payload) {
564
564
  fitInterval
565
565
  };
566
566
  }
567
+ function decodeNavicEphemeris(payload) {
568
+ if (payload.length < 60) return null;
569
+ const r = new BitReader(payload);
570
+ r.skip(12);
571
+ const svId = r.readU(6);
572
+ const week = r.readU(10);
573
+ const af0 = r.readS(22) * 2 ** -31;
574
+ const af1 = r.readS(16) * 2 ** -43;
575
+ const af2 = r.readS(8) * 2 ** -55;
576
+ const ura = r.readU(4);
577
+ const toc = r.readU(16) * 16;
578
+ const tgd = r.readS(8) * 2 ** -31;
579
+ const deltaN = r.readS(22) * 2 ** -41 * PI;
580
+ const iode = r.readU(8);
581
+ r.skip(10);
582
+ const l5Health = r.readU(1);
583
+ const sHealth = r.readU(1);
584
+ const cuc = r.readS(15) * 2 ** -28;
585
+ const cus = r.readS(15) * 2 ** -28;
586
+ const cic = r.readS(15) * 2 ** -28;
587
+ const cis = r.readS(15) * 2 ** -28;
588
+ const crc = r.readS(15) * 2 ** -4;
589
+ const crs = r.readS(15) * 2 ** -4;
590
+ const idot = r.readS(14) * 2 ** -43 * PI;
591
+ const m0 = r.readS(32) * 2 ** -31 * PI;
592
+ const toe = r.readU(16) * 16;
593
+ const e = r.readU(32) * 2 ** -33;
594
+ const sqrtA = r.readU(32) * 2 ** -19;
595
+ const omega0 = r.readS(32) * 2 ** -31 * PI;
596
+ const argPerigee = r.readS(32) * 2 ** -31 * PI;
597
+ const omegaDot = r.readS(22) * 2 ** -41 * PI;
598
+ const i0 = r.readS(32) * 2 ** -31 * PI;
599
+ return {
600
+ prn: `I${String(svId).padStart(2, "0")}`,
601
+ constellation: "NavIC",
602
+ health: l5Health << 1 | sHealth,
603
+ lastReceived: Date.now(),
604
+ messageType: 1041,
605
+ week,
606
+ ura,
607
+ toc,
608
+ toe,
609
+ sqrtA,
610
+ eccentricity: e,
611
+ inclination: i0,
612
+ omega0,
613
+ omegaDot,
614
+ argPerigee,
615
+ meanAnomaly: m0,
616
+ deltaN,
617
+ idot,
618
+ crs,
619
+ crc,
620
+ cuc,
621
+ cus,
622
+ cic,
623
+ cis,
624
+ af0,
625
+ af1,
626
+ af2,
627
+ iode,
628
+ tgd
629
+ };
630
+ }
567
631
  function decodeEphemeris(frame) {
568
632
  try {
569
633
  switch (frame.messageType) {
@@ -571,6 +635,8 @@ function decodeEphemeris(frame) {
571
635
  return decodeGpsEphemeris(frame.payload);
572
636
  case 1020:
573
637
  return decodeGlonassEphemeris(frame.payload);
638
+ case 1041:
639
+ return decodeNavicEphemeris(frame.payload);
574
640
  case 1042:
575
641
  return decodeBdsEphemeris(frame.payload);
576
642
  case 1043:
package/dist/rtcm3.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  setRtcm3DebugHandler,
22
22
  updateStationMeta,
23
23
  updateStreamStats
24
- } from "./chunk-XPQ4BU6W.js";
24
+ } from "./chunk-7GNRNKBR.js";
25
25
  import "./chunk-HVXYFUCB.js";
26
26
  import "./chunk-LEEU5OIO.js";
27
27
  import "./chunk-FIEWO4J4.js";