gnss-js 1.4.1 → 1.5.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.
package/dist/index.js CHANGED
@@ -8,8 +8,10 @@ import {
8
8
  CycleSlipAccumulator,
9
9
  IonoAccumulator,
10
10
  MultipathAccumulator,
11
- analyzeQuality
12
- } from "./chunk-UQ7D53R2.js";
11
+ analyzeQuality,
12
+ applyIonoDcb,
13
+ parseSinexBiasDcb
14
+ } from "./chunk-GDGHTC3E.js";
13
15
  import {
14
16
  frequencyLabel,
15
17
  parseAntex
@@ -98,7 +100,7 @@ import {
98
100
  ionoFree,
99
101
  satClockCorrection,
100
102
  solveSpp
101
- } from "./chunk-PX7TPPTQ.js";
103
+ } from "./chunk-SOJNWF5T.js";
102
104
  import {
103
105
  computeAllPositions,
104
106
  computeDop,
@@ -111,7 +113,7 @@ import {
111
113
  keplerPosition,
112
114
  navTimesFromEph,
113
115
  selectEphemeris
114
- } from "./chunk-PQYBTE42.js";
116
+ } from "./chunk-CD5YSYCG.js";
115
117
  import {
116
118
  getBdsTime,
117
119
  getDateFromBdsTime,
@@ -197,7 +199,7 @@ import {
197
199
  setRtcm3DebugHandler,
198
200
  updateStationMeta,
199
201
  updateStreamStats
200
- } from "./chunk-65CQINSB.js";
202
+ } from "./chunk-FGRC3PB3.js";
201
203
  import {
202
204
  DAYS_MJD2000_MJD,
203
205
  DAYS_MJD_JULIAN,
@@ -332,6 +334,7 @@ export {
332
334
  WarningAccumulator,
333
335
  analyzeQuality,
334
336
  applyHelmert,
337
+ applyIonoDcb,
335
338
  buildGloChannelMap,
336
339
  buildObsIndices,
337
340
  clampUnit,
@@ -434,6 +437,7 @@ export {
434
437
  parseNavFile,
435
438
  parseNmeaFile,
436
439
  parseRinexStream,
440
+ parseSinexBiasDcb,
437
441
  parseSourcetable,
438
442
  phiAltBOC,
439
443
  phiBOCc,
package/dist/orbit.cjs CHANGED
@@ -372,20 +372,10 @@ function invert4x4(m) {
372
372
  return result;
373
373
  }
374
374
  function selectEphemeris(ephemerides, prn, timeMs) {
375
- let best = null;
376
- let bestDt = Infinity;
377
- for (const eph of ephemerides) {
378
- if (eph.prn !== prn) continue;
379
- const ephTime = eph.tocDate.getTime();
380
- const dt = Math.abs(timeMs - ephTime);
381
- const maxAge = eph.system === "R" || eph.system === "S" ? 18e5 : 4 * 36e5;
382
- if (dt > maxAge) continue;
383
- if (dt < bestDt) {
384
- bestDt = dt;
385
- best = eph;
386
- }
387
- }
388
- return best;
375
+ return selectBest(
376
+ ephemerides.filter((e) => e.prn === prn),
377
+ timeMs
378
+ );
389
379
  }
390
380
  function computeSatPosition(eph, timeMs) {
391
381
  if (eph.system === "R" || eph.system === "S") {
@@ -478,8 +468,9 @@ function selectBest(ephs, timeMs) {
478
468
  return best;
479
469
  }
480
470
  var GPS_EPOCH_MS = START_GPS_TIME.getTime();
471
+ var MS_PER_WEEK = 7 * 864e5;
481
472
  var BDS_EPOCH_MS = START_BDS_TIME.getTime();
482
- var GAL_EPOCH_MS = GPS_EPOCH_MS;
473
+ var GAL_EPOCH_MS = GPS_EPOCH_MS + 1024 * MS_PER_WEEK;
483
474
  function ephInfoToEphemeris(info) {
484
475
  const sys = info.prn.charAt(0);
485
476
  if (sys === "R") {
@@ -523,6 +514,7 @@ function ephInfoToEphemeris(info) {
523
514
  return null;
524
515
  }
525
516
  let epochMs;
517
+ let week = info.week;
526
518
  const tocSec = info.toc ?? info.toe;
527
519
  if (sys === "C") {
528
520
  epochMs = BDS_EPOCH_MS;
@@ -530,8 +522,10 @@ function ephInfoToEphemeris(info) {
530
522
  epochMs = GAL_EPOCH_MS;
531
523
  } else {
532
524
  epochMs = GPS_EPOCH_MS;
525
+ const weeksNow = (info.lastReceived - GPS_EPOCH_MS) / MS_PER_WEEK;
526
+ week += 1024 * Math.round((weeksNow - week) / 1024);
533
527
  }
534
- const tocDate = new Date(epochMs + info.week * 7 * 864e5 + tocSec * 1e3);
528
+ const tocDate = new Date(epochMs + week * MS_PER_WEEK + tocSec * 1e3);
535
529
  return {
536
530
  system: sys,
537
531
  prn: info.prn,
@@ -557,7 +551,7 @@ function ephInfoToEphemeris(info) {
557
551
  omega: info.argPerigee,
558
552
  omegaDot: info.omegaDot ?? 0,
559
553
  idot: info.idot ?? 0,
560
- week: info.week,
554
+ week,
561
555
  svHealth: info.health,
562
556
  tgd: 0
563
557
  };
package/dist/orbit.d.cts CHANGED
@@ -131,7 +131,7 @@ interface VisibilityPass {
131
131
  interface VisibilityResult {
132
132
  /** Sample epochs (Unix ms). */
133
133
  times: number[];
134
- /** Elevation (radians) per PRN per epoch; null when below −0.05 rad / no eph. */
134
+ /** Elevation (radians) per PRN per epoch; null when no valid ephemeris. */
135
135
  elevation: Record<string, (number | null)[]>;
136
136
  /** Number of satellites at or above the mask, per epoch. */
137
137
  visibleCount: number[];
package/dist/orbit.d.ts CHANGED
@@ -131,7 +131,7 @@ interface VisibilityPass {
131
131
  interface VisibilityResult {
132
132
  /** Sample epochs (Unix ms). */
133
133
  times: number[];
134
- /** Elevation (radians) per PRN per epoch; null when below −0.05 rad / no eph. */
134
+ /** Elevation (radians) per PRN per epoch; null when no valid ephemeris. */
135
135
  elevation: Record<string, (number | null)[]>;
136
136
  /** Number of satellites at or above the mask, per epoch. */
137
137
  visibleCount: number[];
package/dist/orbit.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  keplerPosition,
11
11
  navTimesFromEph,
12
12
  selectEphemeris
13
- } from "./chunk-PQYBTE42.js";
13
+ } from "./chunk-CD5YSYCG.js";
14
14
  import "./chunk-HVXYFUCB.js";
15
15
  import {
16
16
  ecefToGeodetic,
@@ -367,7 +367,9 @@ function computeSatPosition(eph, timeMs) {
367
367
  return keplerPosition(eph, tow);
368
368
  }
369
369
  var GPS_EPOCH_MS = START_GPS_TIME.getTime();
370
+ var MS_PER_WEEK = 7 * 864e5;
370
371
  var BDS_EPOCH_MS = START_BDS_TIME.getTime();
372
+ var GAL_EPOCH_MS = GPS_EPOCH_MS + 1024 * MS_PER_WEEK;
371
373
 
372
374
  // src/positioning/index.ts
373
375
  var GM_GPS2 = 3986005e8;
@@ -2,8 +2,8 @@ import {
2
2
  ionoFree,
3
3
  satClockCorrection,
4
4
  solveSpp
5
- } from "./chunk-PX7TPPTQ.js";
6
- import "./chunk-PQYBTE42.js";
5
+ } from "./chunk-SOJNWF5T.js";
6
+ import "./chunk-CD5YSYCG.js";
7
7
  import "./chunk-HVXYFUCB.js";
8
8
  import "./chunk-37QNKGTC.js";
9
9
  import "./chunk-6FAL6P4G.js";
package/dist/rtcm3.cjs CHANGED
@@ -1406,6 +1406,11 @@ function rtcm3Constellation(msgType) {
1406
1406
  if (msgType >= 1111 && msgType <= 1117) return "QZSS";
1407
1407
  if (msgType >= 1121 && msgType <= 1127) return "BeiDou";
1408
1408
  if (msgType >= 1131 && msgType <= 1137) return "NavIC";
1409
+ if (msgType >= 1015 && msgType <= 1017) return "GPS";
1410
+ if (msgType === 1030) return "GPS";
1411
+ if (msgType === 1031) return "GLONASS";
1412
+ if (msgType >= 1057 && msgType <= 1062) return "GPS";
1413
+ if (msgType >= 1063 && msgType <= 1068) return "GLONASS";
1409
1414
  if (msgType === 1230) return "GLONASS";
1410
1415
  return null;
1411
1416
  }
@@ -1445,7 +1450,6 @@ function updateStreamStats(stats, frames, rawBytes) {
1445
1450
  entry.totalBytes += frame.length + 6;
1446
1451
  const msmEpoch = decodeMsmFull(frame);
1447
1452
  if (msmEpoch) {
1448
- const now2 = Date.now();
1449
1453
  for (const obs of msmEpoch.observations) {
1450
1454
  const signals = [];
1451
1455
  let bestCn0 = 0;
@@ -1460,7 +1464,7 @@ function updateStreamStats(stats, frames, rawBytes) {
1460
1464
  prn: obs.prn,
1461
1465
  system: obs.system,
1462
1466
  cn0: bestCn0,
1463
- lastSeen: now2,
1467
+ lastSeen: now,
1464
1468
  signals
1465
1469
  });
1466
1470
  }
package/dist/rtcm3.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  setRtcm3DebugHandler,
16
16
  updateStationMeta,
17
17
  updateStreamStats
18
- } from "./chunk-65CQINSB.js";
18
+ } from "./chunk-FGRC3PB3.js";
19
19
  import "./chunk-LEEU5OIO.js";
20
20
  import "./chunk-FIEWO4J4.js";
21
21
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gnss-js",
3
- "version": "1.4.1",
3
+ "version": "1.5.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,
@@ -106,10 +106,10 @@
106
106
  "positioning"
107
107
  ],
108
108
  "author": "Miguel González <work@miguel.es>",
109
- "license": "AGPL-3.0-only",
109
+ "license": "AGPL-3.0-only OR LicenseRef-Commercial",
110
110
  "repository": {
111
111
  "type": "git",
112
- "url": "https://github.com/MiguelPuntoEs/gnss-js"
112
+ "url": "git+https://github.com/MiguelPuntoEs/gnss-js.git"
113
113
  },
114
114
  "homepage": "https://github.com/MiguelPuntoEs/gnss-js#readme",
115
115
  "bugs": {