gnss-js 1.35.0 → 1.37.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
@@ -11,13 +11,13 @@ export { C as ClkFile, I as IonexGrid, S as Sp3File, a as Sp3Sample, c as clkBia
11
11
  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';
12
12
  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
13
  export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawNavOptions, UbxRawNavResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawNav, parseUbxRawx, ubxFrames } from './ubx.cjs';
14
- export { HasMessage, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGloNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfParseResult, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGloNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, sbfCrc16, scanSbfFrames } from './sbf.cjs';
14
+ export { HasMessage, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavigation, SbfParseResult, decodeSbfNavigation, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, sbfCrc16, scanSbfFrames } from './sbf.cjs';
15
15
  export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange } from './novatel.cjs';
16
16
  export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, TrimbleParseResult, parseTrimble, parseTrimbleNav, trimbleFrames } from './trimble.cjs';
17
17
  export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.cjs';
18
18
  export { AllPositionsData, AlmanacPosition, DopValues, EpochSkyData, SatAzEl, SatPoint, SatPosition, VisibilityPass, VisibilityResult, almanacEpochMs, almanacSatPosition, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassAlmanacEpochMs, glonassAlmanacPosition, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris } from './orbit.cjs';
19
19
  export { Helmert14, REFERENCE_FRAMES, ReferenceFrame, applyHelmert, dateToEpoch, transformFrame } from './frames.cjs';
20
- export { AntennaOffset, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, DgnssOptions, DgnssSolution, EphemerisSource, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEpoch, PppEpochContext, PppEpochResult, PppOptions, PppSatObs, PppSolution, RawObservation, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, SatGeom, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.cjs';
20
+ export { AntennaOffset, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, SatGeom, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.cjs';
21
21
  export { NtripCaster, NtripConnectionInfo, NtripNetwork, NtripStream, NtripStreamConnection, NtripVersion, Sourcetable, SourcetableEntry, connectToMountpoint, fetchSourcetable, parseSourcetable } from './ntrip.cjs';
22
22
  export { CompleteSatSignal, CompleteSignalStats, CompletenessAccumulator, CompletenessResult, CycleSlipAccumulator, CycleSlipEvent, CycleSlipResult, CycleSlipSignalStats, IonoAccumulator, IonoDcbResult, IonoPoint, IonoRatePoint, IonoRateSeries, IonoResult, IonoSeries, MultipathAccumulator, MultipathPoint, MultipathResult, MultipathSeries, MultipathSignalStat, QualityResult, SatDcbMap, analyzeQuality, applyIonoDcb, computeIonoRate, detrendIonoArcs, parseSinexBiasDcb } from './analysis.cjs';
23
23
  export { AntennaEntry, AntexFile, FrequencyData, frequencyLabel, parseAntex } from './antex.cjs';
package/dist/index.d.ts CHANGED
@@ -11,13 +11,13 @@ export { C as ClkFile, I as IonexGrid, S as Sp3File, a as Sp3Sample, c as clkBia
11
11
  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';
12
12
  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
13
  export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawNavOptions, UbxRawNavResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawNav, parseUbxRawx, ubxFrames } from './ubx.js';
14
- export { HasMessage, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGloNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfParseResult, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGloNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, sbfCrc16, scanSbfFrames } from './sbf.js';
14
+ export { HasMessage, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavigation, SbfParseResult, decodeSbfNavigation, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, sbfCrc16, scanSbfFrames } from './sbf.js';
15
15
  export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange } from './novatel.js';
16
16
  export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, TrimbleParseResult, parseTrimble, parseTrimbleNav, trimbleFrames } from './trimble.js';
17
17
  export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.js';
18
18
  export { AllPositionsData, AlmanacPosition, DopValues, EpochSkyData, SatAzEl, SatPoint, SatPosition, VisibilityPass, VisibilityResult, almanacEpochMs, almanacSatPosition, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassAlmanacEpochMs, glonassAlmanacPosition, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris } from './orbit.js';
19
19
  export { Helmert14, REFERENCE_FRAMES, ReferenceFrame, applyHelmert, dateToEpoch, transformFrame } from './frames.js';
20
- export { AntennaOffset, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, DgnssOptions, DgnssSolution, EphemerisSource, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEpoch, PppEpochContext, PppEpochResult, PppOptions, PppSatObs, PppSolution, RawObservation, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, SatGeom, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.js';
20
+ export { AntennaOffset, ArFixedSat, ArOptions, ArResult, ArSat, CorrectionResult, DgnssOptions, DgnssSolution, EphemerisSource, FixedPositionResult, IONO_L1_M_PER_TECU, KlobucharCoeffs, LambdaResult, NetworkFcbResult, NetworkFcbSummary, NlArc, NlFcbResult, PppAntennaModel, PppArc, PppCorrectionConfig, PppCorrections, PppEpoch, PppEpochContext, PppEpochResult, PppFixState, PppOptions, PppSatObs, PppSolution, RawObservation, RtkEpochMeasurements, RtkFloatEngine, RtkFloatOptions, RtkFloatSolution, RtkMeasurement, SatGeom, SppOptions, SppSolution, TropoMapping, WlArc, WlFcbOptions, WlFcbResult, WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength } from './positioning.js';
21
21
  export { NtripCaster, NtripConnectionInfo, NtripNetwork, NtripStream, NtripStreamConnection, NtripVersion, Sourcetable, SourcetableEntry, connectToMountpoint, fetchSourcetable, parseSourcetable } from './ntrip.js';
22
22
  export { CompleteSatSignal, CompleteSignalStats, CompletenessAccumulator, CompletenessResult, CycleSlipAccumulator, CycleSlipEvent, CycleSlipResult, CycleSlipSignalStats, IonoAccumulator, IonoDcbResult, IonoPoint, IonoRatePoint, IonoRateSeries, IonoResult, IonoSeries, MultipathAccumulator, MultipathPoint, MultipathResult, MultipathSeries, MultipathSignalStat, QualityResult, SatDcbMap, analyzeQuality, applyIonoDcb, computeIonoRate, detrendIonoArcs, parseSinexBiasDcb } from './analysis.js';
23
23
  export { AntennaEntry, AntexFile, FrequencyData, frequencyLabel, parseAntex } from './antex.js';
package/dist/index.js CHANGED
@@ -50,28 +50,30 @@ import {
50
50
  parseUbxRawNav,
51
51
  parseUbxRawx,
52
52
  ubxFrames
53
- } from "./chunk-FEOMYZEU.js";
53
+ } from "./chunk-ZQDLYLQA.js";
54
54
  import {
55
55
  crc16,
56
+ decodeSbfNavigation,
56
57
  parseSbfAlmanac,
57
58
  parseSbfBdsNav,
58
59
  parseSbfCnav,
59
60
  parseSbfGalNav,
60
61
  parseSbfGloNav,
62
+ parseSbfGpsNav,
61
63
  parseSbfHas,
62
64
  parseSbfIonoUtc,
63
65
  parseSbfMeas,
64
66
  parseSbfNav,
65
67
  scanSbfFrames
66
- } from "./chunk-AFEDNWXI.js";
67
- import "./chunk-5AUK42AL.js";
68
+ } from "./chunk-24TKGUTY.js";
69
+ import "./chunk-FA2UTLEQ.js";
68
70
  import {
69
71
  OEM4_HLEN,
70
72
  crc32,
71
73
  oem4Frames,
72
74
  parseNovatelNav,
73
75
  parseNovatelRange
74
- } from "./chunk-F4CM6Q4F.js";
76
+ } from "./chunk-5X4AG4MK.js";
75
77
  import {
76
78
  parseTrimble,
77
79
  parseTrimbleNav,
@@ -85,7 +87,7 @@ import {
85
87
  decodeBinexEph,
86
88
  getBnxi,
87
89
  parseBinex
88
- } from "./chunk-OK4GGNOO.js";
90
+ } from "./chunk-D25WNE43.js";
89
91
  import {
90
92
  connectToMountpoint,
91
93
  fetchSourcetable,
@@ -150,6 +152,7 @@ import {
150
152
  estimateNetworkFcbs,
151
153
  estimateWidelaneFcb,
152
154
  extractWidelaneArcs,
155
+ fixPppPosition,
153
156
  gimSlantIonoDelayL1,
154
157
  gimVerticalTec,
155
158
  gmst,
@@ -169,7 +172,7 @@ import {
169
172
  sunEcef,
170
173
  toRtkEpoch,
171
174
  wlWavelength
172
- } from "./chunk-BLGBMRX7.js";
175
+ } from "./chunk-3FG4XVCB.js";
173
176
  import {
174
177
  almanacEpochMs,
175
178
  almanacSatPosition,
@@ -227,9 +230,9 @@ import {
227
230
  writeRinexNav,
228
231
  writeRinexNav4,
229
232
  writeRinexObsBlob
230
- } from "./chunk-5RNDQQ6J.js";
231
- import "./chunk-726LQBGM.js";
232
- import "./chunk-IQ5OIMQD.js";
233
+ } from "./chunk-6SWJTN6H.js";
234
+ import "./chunk-YUW33VXK.js";
235
+ import "./chunk-V2D5KUKH.js";
233
236
  import {
234
237
  SYSTEM_ORDER,
235
238
  crxDecompress,
@@ -469,6 +472,7 @@ export {
469
472
  decodeBinexEph,
470
473
  decodeEphemeris,
471
474
  decodeMsmFull,
475
+ decodeSbfNavigation,
472
476
  deg2dms,
473
477
  deg2rad,
474
478
  detrendIonoArcs,
@@ -483,6 +487,7 @@ export {
483
487
  extractWidelaneArcs,
484
488
  fetchSourcetable,
485
489
  findSatBias,
490
+ fixPppPosition,
486
491
  fmtD,
487
492
  fmtF,
488
493
  formatUTCTime,
@@ -586,6 +591,7 @@ export {
586
591
  parseSbfCnav,
587
592
  parseSbfGalNav,
588
593
  parseSbfGloNav,
594
+ parseSbfGpsNav,
589
595
  parseSbfHas,
590
596
  parseSbfIonoUtc,
591
597
  parseSbfMeas,
package/dist/novatel.js CHANGED
@@ -4,9 +4,9 @@ import {
4
4
  oem4Frames,
5
5
  parseNovatelNav,
6
6
  parseNovatelRange
7
- } from "./chunk-F4CM6Q4F.js";
8
- import "./chunk-726LQBGM.js";
9
- import "./chunk-IQ5OIMQD.js";
7
+ } from "./chunk-5X4AG4MK.js";
8
+ import "./chunk-YUW33VXK.js";
9
+ import "./chunk-V2D5KUKH.js";
10
10
  import "./chunk-HVXYFUCB.js";
11
11
  import "./chunk-LEEU5OIO.js";
12
12
  export {
@@ -28,6 +28,7 @@ __export(positioning_exports, {
28
28
  estimateNetworkFcbs: () => estimateNetworkFcbs,
29
29
  estimateWidelaneFcb: () => estimateWidelaneFcb,
30
30
  extractWidelaneArcs: () => extractWidelaneArcs,
31
+ fixPppPosition: () => fixPppPosition,
31
32
  gimSlantIonoDelayL1: () => gimSlantIonoDelayL1,
32
33
  gimVerticalTec: () => gimVerticalTec,
33
34
  gmst: () => gmst,
@@ -2485,6 +2486,28 @@ function solvePpp(epochs, sp3, opts) {
2485
2486
  phaseResRms: nPhaseRes > 0 ? Math.sqrt(sumPhaseResSq / nPhaseRes) : 0
2486
2487
  });
2487
2488
  }
2489
+ let finalState;
2490
+ if (opts.exposeState) {
2491
+ const ambs = [];
2492
+ for (const [prn, index] of ambIdx) {
2493
+ const s = arcSnap.get(prn);
2494
+ if (!s || s.nEpochs < 10) continue;
2495
+ ambs.push({
2496
+ prn,
2497
+ index,
2498
+ aIF: x[index],
2499
+ mwCyc: mwState.get(prn)?.mean ?? s.mwCyc,
2500
+ f1: s.f1,
2501
+ f2: s.f2,
2502
+ elevDeg: s.elevSum / s.nEpochs
2503
+ });
2504
+ }
2505
+ finalState = {
2506
+ position: [x[IDX_X], x[IDX_Y], x[IDX_Z]],
2507
+ covariance: P.map((row) => row.slice()),
2508
+ ambiguities: ambs
2509
+ };
2510
+ }
2488
2511
  for (const prn of [...arcSnap.keys()]) flushArc(prn);
2489
2512
  const finalPos = [x[IDX_X], x[IDX_Y], x[IDX_Z]];
2490
2513
  const llh = ecefToGeodetic(finalPos[0], finalPos[1], finalPos[2]);
@@ -2501,7 +2524,8 @@ function solvePpp(epochs, sp3, opts) {
2501
2524
  epochsUsed: epochs.length,
2502
2525
  convergenceSec,
2503
2526
  finalError3d,
2504
- arcs
2527
+ arcs,
2528
+ finalState
2505
2529
  };
2506
2530
  }
2507
2531
 
@@ -2594,6 +2618,117 @@ function resolvePppAmbiguities(sats, Qaif, opts = {}) {
2594
2618
  rejectedWl
2595
2619
  };
2596
2620
  }
2621
+ function solveSpd(A, b) {
2622
+ const n = b.length;
2623
+ const L = Array.from({ length: n }, () => new Array(n).fill(0));
2624
+ for (let i = 0; i < n; i++) {
2625
+ for (let j = 0; j <= i; j++) {
2626
+ let s = A[i][j];
2627
+ for (let k = 0; k < j; k++) s -= L[i][k] * L[j][k];
2628
+ if (i === j) {
2629
+ if (s <= 0) return null;
2630
+ L[i][j] = Math.sqrt(s);
2631
+ } else {
2632
+ L[i][j] = s / L[j][j];
2633
+ }
2634
+ }
2635
+ }
2636
+ const y = new Array(n).fill(0);
2637
+ for (let i = 0; i < n; i++) {
2638
+ let s = b[i];
2639
+ for (let k = 0; k < i; k++) s -= L[i][k] * y[k];
2640
+ y[i] = s / L[i][i];
2641
+ }
2642
+ const x = new Array(n).fill(0);
2643
+ for (let i = n - 1; i >= 0; i--) {
2644
+ let s = y[i];
2645
+ for (let k = i + 1; k < n; k++) s -= L[k][i] * x[k];
2646
+ x[i] = s / L[i][i];
2647
+ }
2648
+ return x;
2649
+ }
2650
+ function fixPppPosition(state, fcb, opts = {}) {
2651
+ const floatPos = state.position;
2652
+ const noFix = {
2653
+ fixed: false,
2654
+ position: floatPos,
2655
+ floatPosition: floatPos,
2656
+ shift: [0, 0, 0],
2657
+ nFixed: 0,
2658
+ ratio: 0,
2659
+ refPrn: null
2660
+ };
2661
+ const amb = state.ambiguities;
2662
+ if (amb.length < 3) return noFix;
2663
+ const sats = amb.map((a) => ({
2664
+ prn: a.prn,
2665
+ aIF: a.aIF,
2666
+ mwCyc: a.mwCyc,
2667
+ f1: a.f1,
2668
+ f2: a.f2,
2669
+ wlBiasCyc: fcb.satWlFcb.get(a.prn) ?? 0,
2670
+ nlBiasCyc: fcb.satNlFcb.get(a.prn) ?? 0,
2671
+ elevDeg: a.elevDeg
2672
+ }));
2673
+ const n = sats.length;
2674
+ const Qaif = new Float64Array(n * n);
2675
+ for (let i = 0; i < n; i++)
2676
+ for (let j = 0; j < n; j++)
2677
+ Qaif[i * n + j] = state.covariance[amb[i].index][amb[j].index];
2678
+ const res = resolvePppAmbiguities(sats, Qaif, opts);
2679
+ if (!res.fixed || res.refPrn === null) {
2680
+ return { ...noFix, ratio: res.ratio, refPrn: res.refPrn };
2681
+ }
2682
+ const idxOfPrn = new Map(amb.map((a) => [a.prn, a.index]));
2683
+ const floatOfPrn = new Map(amb.map((a) => [a.prn, a.aIF]));
2684
+ const kept = res.sats.filter((s) => idxOfPrn.has(s.prn));
2685
+ const refPos = kept.findIndex((s) => s.prn === res.refPrn);
2686
+ if (refPos < 0 || kept.length < 2) {
2687
+ return { ...noFix, ratio: res.ratio, refPrn: res.refPrn };
2688
+ }
2689
+ const ambIdx = kept.map((s) => idxOfPrn.get(s.prn));
2690
+ const aFloat = kept.map((s) => floatOfPrn.get(s.prn));
2691
+ const aFixed = kept.map((s) => s.aIF);
2692
+ const others = kept.map((_, i) => i).filter((i) => i !== refPos);
2693
+ const m = others.length;
2694
+ const P = state.covariance;
2695
+ const qAA = (i, j) => P[ambIdx[i]][ambIdx[j]];
2696
+ const qXA = (r, i) => P[r][ambIdx[i]];
2697
+ const Qzz = Array.from({ length: m }, () => new Array(m).fill(0));
2698
+ const z = new Array(m).fill(0);
2699
+ for (let a = 0; a < m; a++) {
2700
+ const ia = others[a];
2701
+ z[a] = aFloat[ia] - aFloat[refPos] - (aFixed[ia] - aFixed[refPos]);
2702
+ for (let b = 0; b < m; b++) {
2703
+ const ib = others[b];
2704
+ Qzz[a][b] = qAA(ia, ib) - qAA(ia, refPos) - qAA(refPos, ib) + qAA(refPos, refPos);
2705
+ }
2706
+ }
2707
+ const Qxz = [0, 1, 2].map(
2708
+ (r) => others.map((ia) => qXA(r, ia) - qXA(r, refPos))
2709
+ );
2710
+ const y = solveSpd(Qzz, z);
2711
+ if (!y) return { ...noFix, ratio: res.ratio, refPrn: res.refPrn };
2712
+ const shift = [0, 0, 0];
2713
+ for (let r = 0; r < 3; r++) {
2714
+ let s = 0;
2715
+ for (let a = 0; a < m; a++) s += Qxz[r][a] * y[a];
2716
+ shift[r] = -s;
2717
+ }
2718
+ return {
2719
+ fixed: true,
2720
+ position: [
2721
+ floatPos[0] + shift[0],
2722
+ floatPos[1] + shift[1],
2723
+ floatPos[2] + shift[2]
2724
+ ],
2725
+ floatPosition: floatPos,
2726
+ shift,
2727
+ nFixed: m,
2728
+ ratio: res.ratio,
2729
+ refPrn: res.refPrn
2730
+ };
2731
+ }
2597
2732
 
2598
2733
  // src/positioning/ppp-fcb.ts
2599
2734
  function extractWidelaneArcs(station, epochs, opts = {}) {
@@ -3018,6 +3153,7 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
3018
3153
  estimateNetworkFcbs,
3019
3154
  estimateWidelaneFcb,
3020
3155
  extractWidelaneArcs,
3156
+ fixPppPosition,
3021
3157
  gimSlantIonoDelayL1,
3022
3158
  gimVerticalTec,
3023
3159
  gmst,
@@ -631,6 +631,9 @@ interface PppOptions {
631
631
  ztdProcessNoise?: number;
632
632
  /** Model + estimate the troposphere. Default true. */
633
633
  troposphere?: boolean;
634
+ /** Expose the final EKF state (position + ambiguities + covariance) in the
635
+ * solution for ambiguity-resolved positioning. Default false. */
636
+ exposeState?: boolean;
634
637
  /** High-rate precise satellite clocks (RINEX CLOCK, typically 30 s). When
635
638
  * given, satellite clock offsets come from this by linear interpolation
636
639
  * instead of the SP3 5-minute clocks — the dominant PPP accuracy term.
@@ -669,6 +672,31 @@ interface PppSolution {
669
672
  /** Per-arc converged float ambiguities — one per continuous satellite
670
673
  * tracking arc — the raw material for ambiguity resolution (PPP-AR). */
671
674
  arcs: PppArc[];
675
+ /** Final EKF state (position + active ambiguities + full covariance) for
676
+ * ambiguity-resolved (fixed) positioning. Present only when
677
+ * `PppOptions.exposeState` is set. */
678
+ finalState?: PppFixState;
679
+ }
680
+ /** Final float state exposed for PPP-AR position fixing (`fixPppPosition`). */
681
+ interface PppFixState {
682
+ /** Float position (m); rows 0–2 of the covariance. */
683
+ position: [number, number, number];
684
+ /** Full EKF covariance (n×n). State order: X,Y,Z,ZWD, clocks…, ambiguities. */
685
+ covariance: number[][];
686
+ /** Active ambiguities at the final epoch. */
687
+ ambiguities: {
688
+ prn: string;
689
+ /** Row/column of this ambiguity in `covariance`. */
690
+ index: number;
691
+ /** Float ionosphere-free ambiguity (m). */
692
+ aIF: number;
693
+ /** Arc-averaged Melbourne–Wübbena wide-lane (cycles). */
694
+ mwCyc: number;
695
+ f1: number;
696
+ f2: number;
697
+ /** Mean satellite elevation over the arc (deg). */
698
+ elevDeg: number;
699
+ }[];
672
700
  }
673
701
  /** A converged carrier-phase arc: the float ionosphere-free ambiguity plus
674
702
  * the wide-lane, for integer resolution / FCB estimation. */
@@ -759,6 +787,7 @@ declare function solidEarthTide(rcv: [number, number, number], sun: [number, num
759
787
  * The relation between the IF ambiguity (metres) and the integers is
760
788
  * A_IF = λ_NL·N1 + λ_NL·(f2/(f1−f2))·N_WL, λ_NL = c/(f1+f2).
761
789
  */
790
+
762
791
  /** Wide-lane wavelength c/(f1−f2) (m). */
763
792
  declare function wlWavelength(f1: number, f2: number): number;
764
793
  /** Narrow-lane wavelength c/(f1+f2) (m). */
@@ -812,6 +841,38 @@ interface ArResult {
812
841
  * confident fix (keep the float solution).
813
842
  */
814
843
  declare function resolvePppAmbiguities(sats: ArSat[], Qaif: Float64Array, opts?: ArOptions): ArResult;
844
+ interface FixedPositionResult {
845
+ /** Whether the narrow-lane fix passed the ratio test. */
846
+ fixed: boolean;
847
+ /** Ambiguity-fixed position (m); equals `floatPosition` when not fixed. */
848
+ position: [number, number, number];
849
+ /** The input float position (m). */
850
+ floatPosition: [number, number, number];
851
+ /** Displacement fixed − float (m), ENU-agnostic ECEF. */
852
+ shift: [number, number, number];
853
+ /** Satellites whose ambiguities were fixed (excl. the SD reference). */
854
+ nFixed: number;
855
+ ratio: number;
856
+ refPrn: string | null;
857
+ }
858
+ /**
859
+ * Ambiguity-fixed (PPP-AR) position from a float `solvePpp` final state and
860
+ * the satellite fractional-cycle biases (from `estimateNetworkFcbs`).
861
+ *
862
+ * Resolves the integers (`resolvePppAmbiguities`), then **conditions the
863
+ * float position on the fixed between-satellite ambiguities** — the standard
864
+ * constrained solution
865
+ * x_fixed = x_float − Q_xz · Q_zz⁻¹ · (z_float − ẑ),
866
+ * where z = D·a are the single-differenced ambiguities (D removes the
867
+ * reference satellite, cancelling the receiver term), Q_zz = D·Q_aa·Dᵀ and
868
+ * Q_xz = Q_xa·Dᵀ come from the EKF covariance. Only satellite-to-satellite
869
+ * integers constrain the position; the reference (and the receiver clock it
870
+ * absorbs) stays free. Returns the float position unchanged if the fix fails.
871
+ */
872
+ declare function fixPppPosition(state: PppFixState, fcb: {
873
+ satWlFcb: Map<string, number>;
874
+ satNlFcb: Map<string, number>;
875
+ }, opts?: ArOptions): FixedPositionResult;
815
876
 
816
877
  /**
817
878
  * Wide-lane fractional-cycle bias (FCB) estimation for PPP-AR — the
@@ -1056,4 +1117,4 @@ declare function ionoFree(p1: number, p2: number, f1: number, f2: number): numbe
1056
1117
  */
1057
1118
  declare function solveSpp(pseudoranges: Map<string, number>, ephemerides: Map<string, Ephemeris>, timeMs: number, opts?: SppOptions): SppSolution | null;
1058
1119
 
1059
- export { type AntennaOffset, type ArFixedSat, type ArOptions, type ArResult, type ArSat, type CorrectionResult, type DgnssOptions, type DgnssSolution, type EphemerisSource, IONO_L1_M_PER_TECU, type KlobucharCoeffs, type LambdaResult, type NetworkFcbResult, type NetworkFcbSummary, type NlArc, type NlFcbResult, type PppAntennaModel, type PppArc, type PppCorrectionConfig, type PppCorrections, type PppEpoch, type PppEpochContext, type PppEpochResult, type PppOptions, type PppSatObs, type PppSolution, type RawObservation, type RtkEpochMeasurements, RtkFloatEngine, type RtkFloatOptions, type RtkFloatSolution, type RtkMeasurement, type SatGeom, type SppOptions, type SppSolution, type TropoMapping, type WlArc, type WlFcbOptions, type WlFcbResult, type WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
1120
+ export { type AntennaOffset, type ArFixedSat, type ArOptions, type ArResult, type ArSat, type CorrectionResult, type DgnssOptions, type DgnssSolution, type EphemerisSource, type FixedPositionResult, IONO_L1_M_PER_TECU, type KlobucharCoeffs, type LambdaResult, type NetworkFcbResult, type NetworkFcbSummary, type NlArc, type NlFcbResult, type PppAntennaModel, type PppArc, type PppCorrectionConfig, type PppCorrections, type PppEpoch, type PppEpochContext, type PppEpochResult, type PppFixState, type PppOptions, type PppSatObs, type PppSolution, type RawObservation, type RtkEpochMeasurements, RtkFloatEngine, type RtkFloatOptions, type RtkFloatSolution, type RtkMeasurement, type SatGeom, type SppOptions, type SppSolution, type TropoMapping, type WlArc, type WlFcbOptions, type WlFcbResult, type WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
@@ -631,6 +631,9 @@ interface PppOptions {
631
631
  ztdProcessNoise?: number;
632
632
  /** Model + estimate the troposphere. Default true. */
633
633
  troposphere?: boolean;
634
+ /** Expose the final EKF state (position + ambiguities + covariance) in the
635
+ * solution for ambiguity-resolved positioning. Default false. */
636
+ exposeState?: boolean;
634
637
  /** High-rate precise satellite clocks (RINEX CLOCK, typically 30 s). When
635
638
  * given, satellite clock offsets come from this by linear interpolation
636
639
  * instead of the SP3 5-minute clocks — the dominant PPP accuracy term.
@@ -669,6 +672,31 @@ interface PppSolution {
669
672
  /** Per-arc converged float ambiguities — one per continuous satellite
670
673
  * tracking arc — the raw material for ambiguity resolution (PPP-AR). */
671
674
  arcs: PppArc[];
675
+ /** Final EKF state (position + active ambiguities + full covariance) for
676
+ * ambiguity-resolved (fixed) positioning. Present only when
677
+ * `PppOptions.exposeState` is set. */
678
+ finalState?: PppFixState;
679
+ }
680
+ /** Final float state exposed for PPP-AR position fixing (`fixPppPosition`). */
681
+ interface PppFixState {
682
+ /** Float position (m); rows 0–2 of the covariance. */
683
+ position: [number, number, number];
684
+ /** Full EKF covariance (n×n). State order: X,Y,Z,ZWD, clocks…, ambiguities. */
685
+ covariance: number[][];
686
+ /** Active ambiguities at the final epoch. */
687
+ ambiguities: {
688
+ prn: string;
689
+ /** Row/column of this ambiguity in `covariance`. */
690
+ index: number;
691
+ /** Float ionosphere-free ambiguity (m). */
692
+ aIF: number;
693
+ /** Arc-averaged Melbourne–Wübbena wide-lane (cycles). */
694
+ mwCyc: number;
695
+ f1: number;
696
+ f2: number;
697
+ /** Mean satellite elevation over the arc (deg). */
698
+ elevDeg: number;
699
+ }[];
672
700
  }
673
701
  /** A converged carrier-phase arc: the float ionosphere-free ambiguity plus
674
702
  * the wide-lane, for integer resolution / FCB estimation. */
@@ -759,6 +787,7 @@ declare function solidEarthTide(rcv: [number, number, number], sun: [number, num
759
787
  * The relation between the IF ambiguity (metres) and the integers is
760
788
  * A_IF = λ_NL·N1 + λ_NL·(f2/(f1−f2))·N_WL, λ_NL = c/(f1+f2).
761
789
  */
790
+
762
791
  /** Wide-lane wavelength c/(f1−f2) (m). */
763
792
  declare function wlWavelength(f1: number, f2: number): number;
764
793
  /** Narrow-lane wavelength c/(f1+f2) (m). */
@@ -812,6 +841,38 @@ interface ArResult {
812
841
  * confident fix (keep the float solution).
813
842
  */
814
843
  declare function resolvePppAmbiguities(sats: ArSat[], Qaif: Float64Array, opts?: ArOptions): ArResult;
844
+ interface FixedPositionResult {
845
+ /** Whether the narrow-lane fix passed the ratio test. */
846
+ fixed: boolean;
847
+ /** Ambiguity-fixed position (m); equals `floatPosition` when not fixed. */
848
+ position: [number, number, number];
849
+ /** The input float position (m). */
850
+ floatPosition: [number, number, number];
851
+ /** Displacement fixed − float (m), ENU-agnostic ECEF. */
852
+ shift: [number, number, number];
853
+ /** Satellites whose ambiguities were fixed (excl. the SD reference). */
854
+ nFixed: number;
855
+ ratio: number;
856
+ refPrn: string | null;
857
+ }
858
+ /**
859
+ * Ambiguity-fixed (PPP-AR) position from a float `solvePpp` final state and
860
+ * the satellite fractional-cycle biases (from `estimateNetworkFcbs`).
861
+ *
862
+ * Resolves the integers (`resolvePppAmbiguities`), then **conditions the
863
+ * float position on the fixed between-satellite ambiguities** — the standard
864
+ * constrained solution
865
+ * x_fixed = x_float − Q_xz · Q_zz⁻¹ · (z_float − ẑ),
866
+ * where z = D·a are the single-differenced ambiguities (D removes the
867
+ * reference satellite, cancelling the receiver term), Q_zz = D·Q_aa·Dᵀ and
868
+ * Q_xz = Q_xa·Dᵀ come from the EKF covariance. Only satellite-to-satellite
869
+ * integers constrain the position; the reference (and the receiver clock it
870
+ * absorbs) stays free. Returns the float position unchanged if the fix fails.
871
+ */
872
+ declare function fixPppPosition(state: PppFixState, fcb: {
873
+ satWlFcb: Map<string, number>;
874
+ satNlFcb: Map<string, number>;
875
+ }, opts?: ArOptions): FixedPositionResult;
815
876
 
816
877
  /**
817
878
  * Wide-lane fractional-cycle bias (FCB) estimation for PPP-AR — the
@@ -1056,4 +1117,4 @@ declare function ionoFree(p1: number, p2: number, f1: number, f2: number): numbe
1056
1117
  */
1057
1118
  declare function solveSpp(pseudoranges: Map<string, number>, ephemerides: Map<string, Ephemeris>, timeMs: number, opts?: SppOptions): SppSolution | null;
1058
1119
 
1059
- export { type AntennaOffset, type ArFixedSat, type ArOptions, type ArResult, type ArSat, type CorrectionResult, type DgnssOptions, type DgnssSolution, type EphemerisSource, IONO_L1_M_PER_TECU, type KlobucharCoeffs, type LambdaResult, type NetworkFcbResult, type NetworkFcbSummary, type NlArc, type NlFcbResult, type PppAntennaModel, type PppArc, type PppCorrectionConfig, type PppCorrections, type PppEpoch, type PppEpochContext, type PppEpochResult, type PppOptions, type PppSatObs, type PppSolution, type RawObservation, type RtkEpochMeasurements, RtkFloatEngine, type RtkFloatOptions, type RtkFloatSolution, type RtkMeasurement, type SatGeom, type SppOptions, type SppSolution, type TropoMapping, type WlArc, type WlFcbOptions, type WlFcbResult, type WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
1120
+ export { type AntennaOffset, type ArFixedSat, type ArOptions, type ArResult, type ArSat, type CorrectionResult, type DgnssOptions, type DgnssSolution, type EphemerisSource, type FixedPositionResult, IONO_L1_M_PER_TECU, type KlobucharCoeffs, type LambdaResult, type NetworkFcbResult, type NetworkFcbSummary, type NlArc, type NlFcbResult, type PppAntennaModel, type PppArc, type PppCorrectionConfig, type PppCorrections, type PppEpoch, type PppEpochContext, type PppEpochResult, type PppFixState, type PppOptions, type PppSatObs, type PppSolution, type RawObservation, type RtkEpochMeasurements, RtkFloatEngine, type RtkFloatOptions, type RtkFloatSolution, type RtkMeasurement, type SatGeom, type SppOptions, type SppSolution, type TropoMapping, type WlArc, type WlFcbOptions, type WlFcbResult, type WlObs, buildPppAntenna, createPppCorrections, estimateNarrowlaneFcb, estimateNetworkFcbs, estimateWidelaneFcb, extractWidelaneArcs, fixPppPosition, gimSlantIonoDelayL1, gimVerticalTec, gmst, ionoFree, klobucharDelay, lambdaReduction, lambdaSearch, moonEcef, niellMapping, nlWavelength, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
@@ -7,6 +7,7 @@ import {
7
7
  estimateNetworkFcbs,
8
8
  estimateWidelaneFcb,
9
9
  extractWidelaneArcs,
10
+ fixPppPosition,
10
11
  gimSlantIonoDelayL1,
11
12
  gimVerticalTec,
12
13
  gmst,
@@ -26,7 +27,7 @@ import {
26
27
  sunEcef,
27
28
  toRtkEpoch,
28
29
  wlWavelength
29
- } from "./chunk-BLGBMRX7.js";
30
+ } from "./chunk-3FG4XVCB.js";
30
31
  import "./chunk-MHGNKSSH.js";
31
32
  import "./chunk-37QNKGTC.js";
32
33
  import "./chunk-6FAL6P4G.js";
@@ -43,6 +44,7 @@ export {
43
44
  estimateNetworkFcbs,
44
45
  estimateWidelaneFcb,
45
46
  extractWidelaneArcs,
47
+ fixPppPosition,
46
48
  gimSlantIonoDelayL1,
47
49
  gimVerticalTec,
48
50
  gmst,
package/dist/rinex.js CHANGED
@@ -20,9 +20,9 @@ import {
20
20
  writeRinexNav,
21
21
  writeRinexNav4,
22
22
  writeRinexObsBlob
23
- } from "./chunk-5RNDQQ6J.js";
24
- import "./chunk-726LQBGM.js";
25
- import "./chunk-IQ5OIMQD.js";
23
+ } from "./chunk-6SWJTN6H.js";
24
+ import "./chunk-YUW33VXK.js";
25
+ import "./chunk-V2D5KUKH.js";
26
26
  import {
27
27
  SYSTEM_ORDER,
28
28
  crxDecompress,