gnss-js 1.32.0 → 1.32.1

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.
@@ -1788,8 +1788,6 @@ function solvePpp(epochs, sp3, opts) {
1788
1788
  P[ci][ci] = CLK_VAR;
1789
1789
  }
1790
1790
  let nSats = 0;
1791
- let sumPhaseResSq = 0;
1792
- let nPhaseRes = 0;
1793
1791
  for (const v of vis) {
1794
1792
  const ci = clockOf(v.prn[0]);
1795
1793
  const common = v.range + x[ci] - v.satClkM + v.tropoFixed + zwd0 * v.mw;
@@ -1840,15 +1838,37 @@ function solvePpp(epochs, sp3, opts) {
1840
1838
  h[ci] = 1;
1841
1839
  h[IDX_ZWD] = v.mw;
1842
1840
  h[ai] = 1;
1843
- if (ekfUpdateScalar(x, P, h, innov, rPhase, 4)) {
1844
- sumPhaseResSq += innov * innov;
1845
- nPhaseRes++;
1846
- }
1841
+ ekfUpdateScalar(x, P, h, innov, rPhase, 4);
1847
1842
  }
1848
1843
  }
1849
1844
  lastSeen.set(v.prn, ei);
1850
1845
  nSats++;
1851
1846
  }
1847
+ let sumPhaseResSq = 0;
1848
+ let nPhaseRes = 0;
1849
+ {
1850
+ const bySysRes = /* @__PURE__ */ new Map();
1851
+ for (const v of vis) {
1852
+ const ai = ambIdx.get(v.prn);
1853
+ if (ai === void 0) continue;
1854
+ const sys = v.prn[0];
1855
+ const ci = clockOf(sys);
1856
+ const commonPh = v.range + x[ci] - v.satClkM + v.tropoFixed + x[IDX_ZWD] * v.mw;
1857
+ const innov = v.lIf - (commonPh + v.windupM + x[ai]);
1858
+ if (Math.abs(innov) >= 0.15) continue;
1859
+ const arr = bySysRes.get(sys);
1860
+ if (arr) arr.push(innov);
1861
+ else bySysRes.set(sys, [innov]);
1862
+ }
1863
+ for (const res of bySysRes.values()) {
1864
+ const mean = res.reduce((a, b) => a + b, 0) / res.length;
1865
+ for (const r of res) {
1866
+ const d = r - mean;
1867
+ sumPhaseResSq += d * d;
1868
+ nPhaseRes++;
1869
+ }
1870
+ }
1871
+ }
1852
1872
  for (const [prn, seen] of [...lastSeen]) {
1853
1873
  if (ei - seen > 20) {
1854
1874
  const idx = ambIdx.get(prn);
package/dist/index.cjs CHANGED
@@ -13184,8 +13184,6 @@ function solvePpp(epochs, sp3, opts) {
13184
13184
  P[ci][ci] = CLK_VAR;
13185
13185
  }
13186
13186
  let nSats = 0;
13187
- let sumPhaseResSq = 0;
13188
- let nPhaseRes = 0;
13189
13187
  for (const v of vis) {
13190
13188
  const ci = clockOf(v.prn[0]);
13191
13189
  const common = v.range + x[ci] - v.satClkM + v.tropoFixed + zwd0 * v.mw;
@@ -13236,15 +13234,37 @@ function solvePpp(epochs, sp3, opts) {
13236
13234
  h[ci] = 1;
13237
13235
  h[IDX_ZWD] = v.mw;
13238
13236
  h[ai] = 1;
13239
- if (ekfUpdateScalar(x, P, h, innov, rPhase, 4)) {
13240
- sumPhaseResSq += innov * innov;
13241
- nPhaseRes++;
13242
- }
13237
+ ekfUpdateScalar(x, P, h, innov, rPhase, 4);
13243
13238
  }
13244
13239
  }
13245
13240
  lastSeen.set(v.prn, ei);
13246
13241
  nSats++;
13247
13242
  }
13243
+ let sumPhaseResSq = 0;
13244
+ let nPhaseRes = 0;
13245
+ {
13246
+ const bySysRes = /* @__PURE__ */ new Map();
13247
+ for (const v of vis) {
13248
+ const ai = ambIdx.get(v.prn);
13249
+ if (ai === void 0) continue;
13250
+ const sys = v.prn[0];
13251
+ const ci = clockOf(sys);
13252
+ const commonPh = v.range + x[ci] - v.satClkM + v.tropoFixed + x[IDX_ZWD] * v.mw;
13253
+ const innov = v.lIf - (commonPh + v.windupM + x[ai]);
13254
+ if (Math.abs(innov) >= 0.15) continue;
13255
+ const arr = bySysRes.get(sys);
13256
+ if (arr) arr.push(innov);
13257
+ else bySysRes.set(sys, [innov]);
13258
+ }
13259
+ for (const res of bySysRes.values()) {
13260
+ const mean = res.reduce((a, b) => a + b, 0) / res.length;
13261
+ for (const r of res) {
13262
+ const d = r - mean;
13263
+ sumPhaseResSq += d * d;
13264
+ nPhaseRes++;
13265
+ }
13266
+ }
13267
+ }
13248
13268
  for (const [prn, seen] of [...lastSeen]) {
13249
13269
  if (ei - seen > 20) {
13250
13270
  const idx = ambIdx.get(prn);
package/dist/index.js CHANGED
@@ -167,7 +167,7 @@ import {
167
167
  sunEcef,
168
168
  toRtkEpoch,
169
169
  wlWavelength
170
- } from "./chunk-HOH27N42.js";
170
+ } from "./chunk-KD2KJGLQ.js";
171
171
  import {
172
172
  almanacEpochMs,
173
173
  almanacSatPosition,
@@ -2312,8 +2312,6 @@ function solvePpp(epochs, sp3, opts) {
2312
2312
  P[ci][ci] = CLK_VAR;
2313
2313
  }
2314
2314
  let nSats = 0;
2315
- let sumPhaseResSq = 0;
2316
- let nPhaseRes = 0;
2317
2315
  for (const v of vis) {
2318
2316
  const ci = clockOf(v.prn[0]);
2319
2317
  const common = v.range + x[ci] - v.satClkM + v.tropoFixed + zwd0 * v.mw;
@@ -2364,15 +2362,37 @@ function solvePpp(epochs, sp3, opts) {
2364
2362
  h[ci] = 1;
2365
2363
  h[IDX_ZWD] = v.mw;
2366
2364
  h[ai] = 1;
2367
- if (ekfUpdateScalar(x, P, h, innov, rPhase, 4)) {
2368
- sumPhaseResSq += innov * innov;
2369
- nPhaseRes++;
2370
- }
2365
+ ekfUpdateScalar(x, P, h, innov, rPhase, 4);
2371
2366
  }
2372
2367
  }
2373
2368
  lastSeen.set(v.prn, ei);
2374
2369
  nSats++;
2375
2370
  }
2371
+ let sumPhaseResSq = 0;
2372
+ let nPhaseRes = 0;
2373
+ {
2374
+ const bySysRes = /* @__PURE__ */ new Map();
2375
+ for (const v of vis) {
2376
+ const ai = ambIdx.get(v.prn);
2377
+ if (ai === void 0) continue;
2378
+ const sys = v.prn[0];
2379
+ const ci = clockOf(sys);
2380
+ const commonPh = v.range + x[ci] - v.satClkM + v.tropoFixed + x[IDX_ZWD] * v.mw;
2381
+ const innov = v.lIf - (commonPh + v.windupM + x[ai]);
2382
+ if (Math.abs(innov) >= 0.15) continue;
2383
+ const arr = bySysRes.get(sys);
2384
+ if (arr) arr.push(innov);
2385
+ else bySysRes.set(sys, [innov]);
2386
+ }
2387
+ for (const res of bySysRes.values()) {
2388
+ const mean = res.reduce((a, b) => a + b, 0) / res.length;
2389
+ for (const r of res) {
2390
+ const d = r - mean;
2391
+ sumPhaseResSq += d * d;
2392
+ nPhaseRes++;
2393
+ }
2394
+ }
2395
+ }
2376
2396
  for (const [prn, seen] of [...lastSeen]) {
2377
2397
  if (ei - seen > 20) {
2378
2398
  const idx = ambIdx.get(prn);
@@ -24,7 +24,7 @@ import {
24
24
  sunEcef,
25
25
  toRtkEpoch,
26
26
  wlWavelength
27
- } from "./chunk-HOH27N42.js";
27
+ } from "./chunk-KD2KJGLQ.js";
28
28
  import "./chunk-MHGNKSSH.js";
29
29
  import "./chunk-37QNKGTC.js";
30
30
  import "./chunk-6FAL6P4G.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gnss-js",
3
- "version": "1.32.0",
3
+ "version": "1.32.1",
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,