gnss-js 1.44.0 → 1.45.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/{chunk-3FG4XVCB.js → chunk-XYCECWWS.js} +69 -0
- package/dist/index.cjs +70 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -14
- package/dist/positioning.cjs +70 -0
- package/dist/positioning.d.cts +62 -1
- package/dist/positioning.d.ts +62 -1
- package/dist/positioning.js +4 -1
- package/package.json +1 -1
|
@@ -1100,6 +1100,74 @@ var RtkFloatEngine = class {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
};
|
|
1102
1102
|
|
|
1103
|
+
// src/positioning/rtk-postprocess.ts
|
|
1104
|
+
var epochsOf = (o) => Array.isArray(o) ? o : o.epochs;
|
|
1105
|
+
function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
1106
|
+
const tol = opts.pairToleranceMs ?? 500;
|
|
1107
|
+
const round = (ms) => Math.round(ms / 1e3) * 1e3;
|
|
1108
|
+
const baseByT = /* @__PURE__ */ new Map();
|
|
1109
|
+
for (const e of epochsOf(base)) baseByT.set(round(e.timeMs), e);
|
|
1110
|
+
const engine = new RtkFloatEngine(baseEcef, ephemerides, opts);
|
|
1111
|
+
const [bLat, bLon] = ecefToGeodetic(baseEcef[0], baseEcef[1], baseEcef[2]);
|
|
1112
|
+
const [sLat, cLat, sLon, cLon] = [
|
|
1113
|
+
Math.sin(bLat),
|
|
1114
|
+
Math.cos(bLat),
|
|
1115
|
+
Math.sin(bLon),
|
|
1116
|
+
Math.cos(bLon)
|
|
1117
|
+
];
|
|
1118
|
+
const enuOf = (p) => {
|
|
1119
|
+
const dx = p[0] - baseEcef[0];
|
|
1120
|
+
const dy = p[1] - baseEcef[1];
|
|
1121
|
+
const dz = p[2] - baseEcef[2];
|
|
1122
|
+
return [
|
|
1123
|
+
-sLon * dx + cLon * dy,
|
|
1124
|
+
-sLat * cLon * dx - sLat * sLon * dy + cLat * dz,
|
|
1125
|
+
cLat * cLon * dx + cLat * sLon * dy + sLat * dz
|
|
1126
|
+
];
|
|
1127
|
+
};
|
|
1128
|
+
const track = [];
|
|
1129
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1130
|
+
let solved = 0;
|
|
1131
|
+
let unmatched = 0;
|
|
1132
|
+
let fixed = 0;
|
|
1133
|
+
const sorted = [...epochsOf(rover)].sort((a, b) => a.timeMs - b.timeMs);
|
|
1134
|
+
for (const rEp of sorted) {
|
|
1135
|
+
if (seen.has(rEp.timeMs)) continue;
|
|
1136
|
+
seen.add(rEp.timeMs);
|
|
1137
|
+
const bEp = baseByT.get(round(rEp.timeMs));
|
|
1138
|
+
if (!bEp || Math.abs(bEp.timeMs - rEp.timeMs) > tol) {
|
|
1139
|
+
unmatched++;
|
|
1140
|
+
continue;
|
|
1141
|
+
}
|
|
1142
|
+
const sol = engine.process(
|
|
1143
|
+
toRtkEpoch(rEp.meas),
|
|
1144
|
+
toRtkEpoch(bEp.meas),
|
|
1145
|
+
rEp.timeMs
|
|
1146
|
+
);
|
|
1147
|
+
if (!sol) continue;
|
|
1148
|
+
solved++;
|
|
1149
|
+
if (sol.status === "fixed") fixed++;
|
|
1150
|
+
const [lat, lon, height] = ecefToGeodetic(
|
|
1151
|
+
sol.position[0],
|
|
1152
|
+
sol.position[1],
|
|
1153
|
+
sol.position[2]
|
|
1154
|
+
);
|
|
1155
|
+
track.push({
|
|
1156
|
+
timeMs: rEp.timeMs,
|
|
1157
|
+
position: sol.position,
|
|
1158
|
+
lat,
|
|
1159
|
+
lon,
|
|
1160
|
+
height,
|
|
1161
|
+
enu: enuOf(sol.position),
|
|
1162
|
+
status: sol.status,
|
|
1163
|
+
ratio: sol.ratio,
|
|
1164
|
+
nSats: sol.nSats,
|
|
1165
|
+
nFixed: sol.nFixed
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
return { track, solved, unmatched, fixRate: solved ? fixed / solved : 0 };
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1103
1171
|
// src/positioning/ppp-tropo.ts
|
|
1104
1172
|
var HYD_AVG_A = [
|
|
1105
1173
|
0.0012769934,
|
|
@@ -2627,6 +2695,7 @@ export {
|
|
|
2627
2695
|
toRtkEpoch,
|
|
2628
2696
|
solveDgnss,
|
|
2629
2697
|
RtkFloatEngine,
|
|
2698
|
+
postProcessRtk,
|
|
2630
2699
|
niellMapping,
|
|
2631
2700
|
gmst,
|
|
2632
2701
|
sunEcef,
|
package/dist/index.cjs
CHANGED
|
@@ -283,6 +283,7 @@ __export(src_exports, {
|
|
|
283
283
|
phiBOCc: () => phiBOCc,
|
|
284
284
|
phiBOCs: () => phiBOCs,
|
|
285
285
|
phiBPSK: () => phiBPSK,
|
|
286
|
+
postProcessRtk: () => postProcessRtk,
|
|
286
287
|
rad2deg: () => rad2deg,
|
|
287
288
|
rangeRate: () => rangeRate,
|
|
288
289
|
readString: () => readString,
|
|
@@ -13032,6 +13033,74 @@ var RtkFloatEngine = class {
|
|
|
13032
13033
|
}
|
|
13033
13034
|
};
|
|
13034
13035
|
|
|
13036
|
+
// src/positioning/rtk-postprocess.ts
|
|
13037
|
+
var epochsOf = (o) => Array.isArray(o) ? o : o.epochs;
|
|
13038
|
+
function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
13039
|
+
const tol = opts.pairToleranceMs ?? 500;
|
|
13040
|
+
const round = (ms) => Math.round(ms / 1e3) * 1e3;
|
|
13041
|
+
const baseByT = /* @__PURE__ */ new Map();
|
|
13042
|
+
for (const e of epochsOf(base)) baseByT.set(round(e.timeMs), e);
|
|
13043
|
+
const engine = new RtkFloatEngine(baseEcef, ephemerides, opts);
|
|
13044
|
+
const [bLat, bLon] = ecefToGeodetic(baseEcef[0], baseEcef[1], baseEcef[2]);
|
|
13045
|
+
const [sLat, cLat, sLon, cLon] = [
|
|
13046
|
+
Math.sin(bLat),
|
|
13047
|
+
Math.cos(bLat),
|
|
13048
|
+
Math.sin(bLon),
|
|
13049
|
+
Math.cos(bLon)
|
|
13050
|
+
];
|
|
13051
|
+
const enuOf = (p) => {
|
|
13052
|
+
const dx = p[0] - baseEcef[0];
|
|
13053
|
+
const dy = p[1] - baseEcef[1];
|
|
13054
|
+
const dz = p[2] - baseEcef[2];
|
|
13055
|
+
return [
|
|
13056
|
+
-sLon * dx + cLon * dy,
|
|
13057
|
+
-sLat * cLon * dx - sLat * sLon * dy + cLat * dz,
|
|
13058
|
+
cLat * cLon * dx + cLat * sLon * dy + sLat * dz
|
|
13059
|
+
];
|
|
13060
|
+
};
|
|
13061
|
+
const track = [];
|
|
13062
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13063
|
+
let solved = 0;
|
|
13064
|
+
let unmatched = 0;
|
|
13065
|
+
let fixed = 0;
|
|
13066
|
+
const sorted = [...epochsOf(rover)].sort((a, b) => a.timeMs - b.timeMs);
|
|
13067
|
+
for (const rEp of sorted) {
|
|
13068
|
+
if (seen.has(rEp.timeMs)) continue;
|
|
13069
|
+
seen.add(rEp.timeMs);
|
|
13070
|
+
const bEp = baseByT.get(round(rEp.timeMs));
|
|
13071
|
+
if (!bEp || Math.abs(bEp.timeMs - rEp.timeMs) > tol) {
|
|
13072
|
+
unmatched++;
|
|
13073
|
+
continue;
|
|
13074
|
+
}
|
|
13075
|
+
const sol = engine.process(
|
|
13076
|
+
toRtkEpoch(rEp.meas),
|
|
13077
|
+
toRtkEpoch(bEp.meas),
|
|
13078
|
+
rEp.timeMs
|
|
13079
|
+
);
|
|
13080
|
+
if (!sol) continue;
|
|
13081
|
+
solved++;
|
|
13082
|
+
if (sol.status === "fixed") fixed++;
|
|
13083
|
+
const [lat, lon, height] = ecefToGeodetic(
|
|
13084
|
+
sol.position[0],
|
|
13085
|
+
sol.position[1],
|
|
13086
|
+
sol.position[2]
|
|
13087
|
+
);
|
|
13088
|
+
track.push({
|
|
13089
|
+
timeMs: rEp.timeMs,
|
|
13090
|
+
position: sol.position,
|
|
13091
|
+
lat,
|
|
13092
|
+
lon,
|
|
13093
|
+
height,
|
|
13094
|
+
enu: enuOf(sol.position),
|
|
13095
|
+
status: sol.status,
|
|
13096
|
+
ratio: sol.ratio,
|
|
13097
|
+
nSats: sol.nSats,
|
|
13098
|
+
nFixed: sol.nFixed
|
|
13099
|
+
});
|
|
13100
|
+
}
|
|
13101
|
+
return { track, solved, unmatched, fixRate: solved ? fixed / solved : 0 };
|
|
13102
|
+
}
|
|
13103
|
+
|
|
13035
13104
|
// src/positioning/ppp-tropo.ts
|
|
13036
13105
|
var HYD_AVG_A = [
|
|
13037
13106
|
0.0012769934,
|
|
@@ -17072,6 +17141,7 @@ function computePsdDb(centerMHz, halfSpanChips, numPoints, psdFn, f0 = 1023e3, f
|
|
|
17072
17141
|
phiBOCc,
|
|
17073
17142
|
phiBOCs,
|
|
17074
17143
|
phiBPSK,
|
|
17144
|
+
postProcessRtk,
|
|
17075
17145
|
rad2deg,
|
|
17076
17146
|
rangeRate,
|
|
17077
17147
|
readString,
|
package/dist/index.d.cts
CHANGED
|
@@ -17,7 +17,7 @@ export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, Trimb
|
|
|
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, 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';
|
|
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, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkTrackPoint, 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, postProcessRtk, 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
|
@@ -17,7 +17,7 @@ export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, Trimb
|
|
|
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, 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';
|
|
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, RtkObsEpoch, RtkObsInput, RtkPostProcessOptions, RtkPostProcessResult, RtkTrackPoint, 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, postProcessRtk, 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
|
@@ -128,19 +128,6 @@ import {
|
|
|
128
128
|
getTimeOfDay,
|
|
129
129
|
getWeekOfYear
|
|
130
130
|
} from "./chunk-L5OUUNLT.js";
|
|
131
|
-
import {
|
|
132
|
-
deg2dms,
|
|
133
|
-
deg2rad,
|
|
134
|
-
euclidean3D,
|
|
135
|
-
geodeticToGeohash,
|
|
136
|
-
geodeticToMaidenhead,
|
|
137
|
-
geodeticToUtm,
|
|
138
|
-
greatCircleMidpoint,
|
|
139
|
-
horizonDistance,
|
|
140
|
-
rad2deg,
|
|
141
|
-
rhumbLine,
|
|
142
|
-
vincenty
|
|
143
|
-
} from "./chunk-MIIM4LDY.js";
|
|
144
131
|
import {
|
|
145
132
|
REFERENCE_FRAMES,
|
|
146
133
|
applyHelmert,
|
|
@@ -167,6 +154,7 @@ import {
|
|
|
167
154
|
moonEcef,
|
|
168
155
|
niellMapping,
|
|
169
156
|
nlWavelength,
|
|
157
|
+
postProcessRtk,
|
|
170
158
|
resolvePppAmbiguities,
|
|
171
159
|
satClockCorrection,
|
|
172
160
|
solidEarthTide,
|
|
@@ -176,7 +164,7 @@ import {
|
|
|
176
164
|
sunEcef,
|
|
177
165
|
toRtkEpoch,
|
|
178
166
|
wlWavelength
|
|
179
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-XYCECWWS.js";
|
|
180
168
|
import {
|
|
181
169
|
almanacEpochMs,
|
|
182
170
|
almanacSatPosition,
|
|
@@ -198,6 +186,19 @@ import {
|
|
|
198
186
|
rangeRate,
|
|
199
187
|
selectEphemeris
|
|
200
188
|
} from "./chunk-MHGNKSSH.js";
|
|
189
|
+
import {
|
|
190
|
+
deg2dms,
|
|
191
|
+
deg2rad,
|
|
192
|
+
euclidean3D,
|
|
193
|
+
geodeticToGeohash,
|
|
194
|
+
geodeticToMaidenhead,
|
|
195
|
+
geodeticToUtm,
|
|
196
|
+
greatCircleMidpoint,
|
|
197
|
+
horizonDistance,
|
|
198
|
+
rad2deg,
|
|
199
|
+
rhumbLine,
|
|
200
|
+
vincenty
|
|
201
|
+
} from "./chunk-MIIM4LDY.js";
|
|
201
202
|
import {
|
|
202
203
|
clampUnit,
|
|
203
204
|
ecefToGeodetic,
|
|
@@ -617,6 +618,7 @@ export {
|
|
|
617
618
|
phiBOCc,
|
|
618
619
|
phiBOCs,
|
|
619
620
|
phiBPSK,
|
|
621
|
+
postProcessRtk,
|
|
620
622
|
rad2deg,
|
|
621
623
|
rangeRate,
|
|
622
624
|
readString,
|
package/dist/positioning.cjs
CHANGED
|
@@ -39,6 +39,7 @@ __export(positioning_exports, {
|
|
|
39
39
|
moonEcef: () => moonEcef,
|
|
40
40
|
niellMapping: () => niellMapping,
|
|
41
41
|
nlWavelength: () => nlWavelength,
|
|
42
|
+
postProcessRtk: () => postProcessRtk,
|
|
42
43
|
resolvePppAmbiguities: () => resolvePppAmbiguities,
|
|
43
44
|
satClockCorrection: () => satClockCorrection,
|
|
44
45
|
solidEarthTide: () => solidEarthTide,
|
|
@@ -1555,6 +1556,74 @@ var RtkFloatEngine = class {
|
|
|
1555
1556
|
}
|
|
1556
1557
|
};
|
|
1557
1558
|
|
|
1559
|
+
// src/positioning/rtk-postprocess.ts
|
|
1560
|
+
var epochsOf = (o) => Array.isArray(o) ? o : o.epochs;
|
|
1561
|
+
function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
1562
|
+
const tol = opts.pairToleranceMs ?? 500;
|
|
1563
|
+
const round = (ms) => Math.round(ms / 1e3) * 1e3;
|
|
1564
|
+
const baseByT = /* @__PURE__ */ new Map();
|
|
1565
|
+
for (const e of epochsOf(base)) baseByT.set(round(e.timeMs), e);
|
|
1566
|
+
const engine = new RtkFloatEngine(baseEcef, ephemerides, opts);
|
|
1567
|
+
const [bLat, bLon] = ecefToGeodetic(baseEcef[0], baseEcef[1], baseEcef[2]);
|
|
1568
|
+
const [sLat, cLat, sLon, cLon] = [
|
|
1569
|
+
Math.sin(bLat),
|
|
1570
|
+
Math.cos(bLat),
|
|
1571
|
+
Math.sin(bLon),
|
|
1572
|
+
Math.cos(bLon)
|
|
1573
|
+
];
|
|
1574
|
+
const enuOf = (p) => {
|
|
1575
|
+
const dx = p[0] - baseEcef[0];
|
|
1576
|
+
const dy = p[1] - baseEcef[1];
|
|
1577
|
+
const dz = p[2] - baseEcef[2];
|
|
1578
|
+
return [
|
|
1579
|
+
-sLon * dx + cLon * dy,
|
|
1580
|
+
-sLat * cLon * dx - sLat * sLon * dy + cLat * dz,
|
|
1581
|
+
cLat * cLon * dx + cLat * sLon * dy + sLat * dz
|
|
1582
|
+
];
|
|
1583
|
+
};
|
|
1584
|
+
const track = [];
|
|
1585
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1586
|
+
let solved = 0;
|
|
1587
|
+
let unmatched = 0;
|
|
1588
|
+
let fixed = 0;
|
|
1589
|
+
const sorted = [...epochsOf(rover)].sort((a, b) => a.timeMs - b.timeMs);
|
|
1590
|
+
for (const rEp of sorted) {
|
|
1591
|
+
if (seen.has(rEp.timeMs)) continue;
|
|
1592
|
+
seen.add(rEp.timeMs);
|
|
1593
|
+
const bEp = baseByT.get(round(rEp.timeMs));
|
|
1594
|
+
if (!bEp || Math.abs(bEp.timeMs - rEp.timeMs) > tol) {
|
|
1595
|
+
unmatched++;
|
|
1596
|
+
continue;
|
|
1597
|
+
}
|
|
1598
|
+
const sol = engine.process(
|
|
1599
|
+
toRtkEpoch(rEp.meas),
|
|
1600
|
+
toRtkEpoch(bEp.meas),
|
|
1601
|
+
rEp.timeMs
|
|
1602
|
+
);
|
|
1603
|
+
if (!sol) continue;
|
|
1604
|
+
solved++;
|
|
1605
|
+
if (sol.status === "fixed") fixed++;
|
|
1606
|
+
const [lat, lon, height] = ecefToGeodetic(
|
|
1607
|
+
sol.position[0],
|
|
1608
|
+
sol.position[1],
|
|
1609
|
+
sol.position[2]
|
|
1610
|
+
);
|
|
1611
|
+
track.push({
|
|
1612
|
+
timeMs: rEp.timeMs,
|
|
1613
|
+
position: sol.position,
|
|
1614
|
+
lat,
|
|
1615
|
+
lon,
|
|
1616
|
+
height,
|
|
1617
|
+
enu: enuOf(sol.position),
|
|
1618
|
+
status: sol.status,
|
|
1619
|
+
ratio: sol.ratio,
|
|
1620
|
+
nSats: sol.nSats,
|
|
1621
|
+
nFixed: sol.nFixed
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
return { track, solved, unmatched, fixRate: solved ? fixed / solved : 0 };
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1558
1627
|
// src/rinex/sp3.ts
|
|
1559
1628
|
function sp3Position(sp3, prn, tMs, order = 9) {
|
|
1560
1629
|
const samples = sp3.satellites[prn];
|
|
@@ -3164,6 +3233,7 @@ function solveSpp(pseudoranges, ephemerides, timeMs, opts = {}) {
|
|
|
3164
3233
|
moonEcef,
|
|
3165
3234
|
niellMapping,
|
|
3166
3235
|
nlWavelength,
|
|
3236
|
+
postProcessRtk,
|
|
3167
3237
|
resolvePppAmbiguities,
|
|
3168
3238
|
satClockCorrection,
|
|
3169
3239
|
solidEarthTide,
|
package/dist/positioning.d.cts
CHANGED
|
@@ -399,6 +399,67 @@ declare class RtkFloatEngine {
|
|
|
399
399
|
process(rover: RtkEpochMeasurements, base: RtkEpochMeasurements, timeMs: number): RtkFloatSolution | null;
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
+
/** One observation epoch (base or rover) — the shape the receiver/RINEX
|
|
403
|
+
* parsers already produce (`parseNovatelRange().epochs`, etc.). */
|
|
404
|
+
interface RtkObsEpoch {
|
|
405
|
+
/** Epoch, GPS-scale milliseconds. */
|
|
406
|
+
timeMs: number;
|
|
407
|
+
meas: readonly RawObservation[];
|
|
408
|
+
}
|
|
409
|
+
/** Either a bare epoch array or a `{ epochs }` parser result. */
|
|
410
|
+
type RtkObsInput = readonly RtkObsEpoch[] | {
|
|
411
|
+
readonly epochs: readonly RtkObsEpoch[];
|
|
412
|
+
};
|
|
413
|
+
interface RtkTrackPoint {
|
|
414
|
+
/** Epoch, GPS-scale milliseconds. */
|
|
415
|
+
timeMs: number;
|
|
416
|
+
/** Rover position ECEF (m) — ambiguity-fixed when `status === 'fixed'`. */
|
|
417
|
+
position: [number, number, number];
|
|
418
|
+
/** Geodetic latitude, longitude (radians) and ellipsoidal height (m). */
|
|
419
|
+
lat: number;
|
|
420
|
+
lon: number;
|
|
421
|
+
height: number;
|
|
422
|
+
/** Rover − base baseline in the base's local ENU frame (m). */
|
|
423
|
+
enu: [number, number, number];
|
|
424
|
+
/** 'fixed' (integer AR passed), 'float', or 'dgnss' (code-only). */
|
|
425
|
+
status: 'fixed' | 'float' | 'dgnss';
|
|
426
|
+
/** LAMBDA validation ratio, when a fix was attempted. */
|
|
427
|
+
ratio?: number;
|
|
428
|
+
/** Satellites contributing this epoch. */
|
|
429
|
+
nSats: number;
|
|
430
|
+
/** Integer-fixed ambiguities, when fixed. */
|
|
431
|
+
nFixed?: number;
|
|
432
|
+
}
|
|
433
|
+
interface RtkPostProcessOptions extends RtkFloatOptions {
|
|
434
|
+
/**
|
|
435
|
+
* Maximum |base − rover| epoch-time difference to accept a pair (ms).
|
|
436
|
+
* Default 500. Base and rover are matched by rounded second, so this
|
|
437
|
+
* mainly rejects a base gap rather than sub-second offsets.
|
|
438
|
+
*/
|
|
439
|
+
pairToleranceMs?: number;
|
|
440
|
+
}
|
|
441
|
+
interface RtkPostProcessResult {
|
|
442
|
+
/** Solved rover epochs in time order. */
|
|
443
|
+
track: RtkTrackPoint[];
|
|
444
|
+
/** Rover epochs paired with a base epoch and solved. */
|
|
445
|
+
solved: number;
|
|
446
|
+
/** Rover epochs with no base epoch within tolerance. */
|
|
447
|
+
unmatched: number;
|
|
448
|
+
/** Fraction of solved epochs with an integer-fixed solution (0–1). */
|
|
449
|
+
fixRate: number;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Post-process a base/rover observation pair into an RTK track.
|
|
453
|
+
*
|
|
454
|
+
* @param base base-station observation epochs (needs a known position)
|
|
455
|
+
* @param rover rover observation epochs
|
|
456
|
+
* @param ephemerides broadcast (or precise) ephemerides covering the window
|
|
457
|
+
* @param baseEcef surveyed base position, ECEF metres
|
|
458
|
+
* @param opts engine options (`mode`, `elevationMaskDeg`,
|
|
459
|
+
* `ambiguityResolution`, …) plus `pairToleranceMs`
|
|
460
|
+
*/
|
|
461
|
+
declare function postProcessRtk(base: RtkObsInput, rover: RtkObsInput, ephemerides: EphemerisSource, baseEcef: readonly [number, number, number], opts?: RtkPostProcessOptions): RtkPostProcessResult;
|
|
462
|
+
|
|
402
463
|
/**
|
|
403
464
|
* Integer ambiguity resolution: LAMBDA decorrelation + MLAMBDA
|
|
404
465
|
* integer least-squares search.
|
|
@@ -1117,4 +1178,4 @@ declare function ionoFree(p1: number, p2: number, f1: number, f2: number): numbe
|
|
|
1117
1178
|
*/
|
|
1118
1179
|
declare function solveSpp(pseudoranges: Map<string, number>, ephemerides: Map<string, Ephemeris>, timeMs: number, opts?: SppOptions): SppSolution | null;
|
|
1119
1180
|
|
|
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 };
|
|
1181
|
+
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 RtkObsEpoch, type RtkObsInput, type RtkPostProcessOptions, type RtkPostProcessResult, type RtkTrackPoint, 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, postProcessRtk, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
|
package/dist/positioning.d.ts
CHANGED
|
@@ -399,6 +399,67 @@ declare class RtkFloatEngine {
|
|
|
399
399
|
process(rover: RtkEpochMeasurements, base: RtkEpochMeasurements, timeMs: number): RtkFloatSolution | null;
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
+
/** One observation epoch (base or rover) — the shape the receiver/RINEX
|
|
403
|
+
* parsers already produce (`parseNovatelRange().epochs`, etc.). */
|
|
404
|
+
interface RtkObsEpoch {
|
|
405
|
+
/** Epoch, GPS-scale milliseconds. */
|
|
406
|
+
timeMs: number;
|
|
407
|
+
meas: readonly RawObservation[];
|
|
408
|
+
}
|
|
409
|
+
/** Either a bare epoch array or a `{ epochs }` parser result. */
|
|
410
|
+
type RtkObsInput = readonly RtkObsEpoch[] | {
|
|
411
|
+
readonly epochs: readonly RtkObsEpoch[];
|
|
412
|
+
};
|
|
413
|
+
interface RtkTrackPoint {
|
|
414
|
+
/** Epoch, GPS-scale milliseconds. */
|
|
415
|
+
timeMs: number;
|
|
416
|
+
/** Rover position ECEF (m) — ambiguity-fixed when `status === 'fixed'`. */
|
|
417
|
+
position: [number, number, number];
|
|
418
|
+
/** Geodetic latitude, longitude (radians) and ellipsoidal height (m). */
|
|
419
|
+
lat: number;
|
|
420
|
+
lon: number;
|
|
421
|
+
height: number;
|
|
422
|
+
/** Rover − base baseline in the base's local ENU frame (m). */
|
|
423
|
+
enu: [number, number, number];
|
|
424
|
+
/** 'fixed' (integer AR passed), 'float', or 'dgnss' (code-only). */
|
|
425
|
+
status: 'fixed' | 'float' | 'dgnss';
|
|
426
|
+
/** LAMBDA validation ratio, when a fix was attempted. */
|
|
427
|
+
ratio?: number;
|
|
428
|
+
/** Satellites contributing this epoch. */
|
|
429
|
+
nSats: number;
|
|
430
|
+
/** Integer-fixed ambiguities, when fixed. */
|
|
431
|
+
nFixed?: number;
|
|
432
|
+
}
|
|
433
|
+
interface RtkPostProcessOptions extends RtkFloatOptions {
|
|
434
|
+
/**
|
|
435
|
+
* Maximum |base − rover| epoch-time difference to accept a pair (ms).
|
|
436
|
+
* Default 500. Base and rover are matched by rounded second, so this
|
|
437
|
+
* mainly rejects a base gap rather than sub-second offsets.
|
|
438
|
+
*/
|
|
439
|
+
pairToleranceMs?: number;
|
|
440
|
+
}
|
|
441
|
+
interface RtkPostProcessResult {
|
|
442
|
+
/** Solved rover epochs in time order. */
|
|
443
|
+
track: RtkTrackPoint[];
|
|
444
|
+
/** Rover epochs paired with a base epoch and solved. */
|
|
445
|
+
solved: number;
|
|
446
|
+
/** Rover epochs with no base epoch within tolerance. */
|
|
447
|
+
unmatched: number;
|
|
448
|
+
/** Fraction of solved epochs with an integer-fixed solution (0–1). */
|
|
449
|
+
fixRate: number;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Post-process a base/rover observation pair into an RTK track.
|
|
453
|
+
*
|
|
454
|
+
* @param base base-station observation epochs (needs a known position)
|
|
455
|
+
* @param rover rover observation epochs
|
|
456
|
+
* @param ephemerides broadcast (or precise) ephemerides covering the window
|
|
457
|
+
* @param baseEcef surveyed base position, ECEF metres
|
|
458
|
+
* @param opts engine options (`mode`, `elevationMaskDeg`,
|
|
459
|
+
* `ambiguityResolution`, …) plus `pairToleranceMs`
|
|
460
|
+
*/
|
|
461
|
+
declare function postProcessRtk(base: RtkObsInput, rover: RtkObsInput, ephemerides: EphemerisSource, baseEcef: readonly [number, number, number], opts?: RtkPostProcessOptions): RtkPostProcessResult;
|
|
462
|
+
|
|
402
463
|
/**
|
|
403
464
|
* Integer ambiguity resolution: LAMBDA decorrelation + MLAMBDA
|
|
404
465
|
* integer least-squares search.
|
|
@@ -1117,4 +1178,4 @@ declare function ionoFree(p1: number, p2: number, f1: number, f2: number): numbe
|
|
|
1117
1178
|
*/
|
|
1118
1179
|
declare function solveSpp(pseudoranges: Map<string, number>, ephemerides: Map<string, Ephemeris>, timeMs: number, opts?: SppOptions): SppSolution | null;
|
|
1119
1180
|
|
|
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 };
|
|
1181
|
+
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 RtkObsEpoch, type RtkObsInput, type RtkPostProcessOptions, type RtkPostProcessResult, type RtkTrackPoint, 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, postProcessRtk, resolvePppAmbiguities, satClockCorrection, solidEarthTide, solveDgnss, solvePpp, solveSpp, sunEcef, toRtkEpoch, wlWavelength };
|
package/dist/positioning.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
moonEcef,
|
|
19
19
|
niellMapping,
|
|
20
20
|
nlWavelength,
|
|
21
|
+
postProcessRtk,
|
|
21
22
|
resolvePppAmbiguities,
|
|
22
23
|
satClockCorrection,
|
|
23
24
|
solidEarthTide,
|
|
@@ -27,8 +28,9 @@ import {
|
|
|
27
28
|
sunEcef,
|
|
28
29
|
toRtkEpoch,
|
|
29
30
|
wlWavelength
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XYCECWWS.js";
|
|
31
32
|
import "./chunk-MHGNKSSH.js";
|
|
33
|
+
import "./chunk-MIIM4LDY.js";
|
|
32
34
|
import "./chunk-37QNKGTC.js";
|
|
33
35
|
import "./chunk-6FAL6P4G.js";
|
|
34
36
|
import "./chunk-GPEP67TG.js";
|
|
@@ -55,6 +57,7 @@ export {
|
|
|
55
57
|
moonEcef,
|
|
56
58
|
niellMapping,
|
|
57
59
|
nlWavelength,
|
|
60
|
+
postProcessRtk,
|
|
58
61
|
resolvePppAmbiguities,
|
|
59
62
|
satClockCorrection,
|
|
60
63
|
solidEarthTide,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gnss-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0",
|
|
4
4
|
"description": "Comprehensive GNSS library for JavaScript — time scales, coordinates, RINEX parsing, RTCM3 decoding, orbit computation, and signal analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|