gnss-js 1.19.0 → 1.21.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/orbit.d.cts CHANGED
@@ -1,6 +1,95 @@
1
1
  import { E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris } from './nav-DImXUdbp.cjs';
2
2
  import { E as EphemerisInfo } from './ephemeris-Ohl6NAfw.cjs';
3
3
  export { e as ecefToGeodetic, g as geodeticToEcef } from './ecef-CF0uAysr.cjs';
4
+ import { c as SbfKeplerAlmanac, b as SbfGlonassAlmanac } from './nav-BYmYoh9A.cjs';
5
+
6
+ /**
7
+ * Almanac orbit propagation for GPS/Galileo/BeiDou Kepler almanacs
8
+ * (SbfKeplerAlmanac — absolute elements as normalized by the SBF
9
+ * decoder) — the planner-facing counterpart of `keplerPosition`.
10
+ *
11
+ * Differences from the ephemeris path, both deliberate:
12
+ * - the time offset from the almanac epoch is NOT folded into the
13
+ * ±302 400 s half-week window: almanacs are meant to be propagated
14
+ * days ahead, and the fold would silently wrap a Tuesday query
15
+ * onto the previous Friday;
16
+ * - no harmonic corrections, Δn or IDOT exist in an almanac — the
17
+ * resulting positions are almanac-class (km-level), which is the
18
+ * contract: visibility/elevation planning, not ranging.
19
+ *
20
+ * IS-GPS-200 §20.3.3.5.2.1 (almanac user algorithm), Galileo OS ICD
21
+ * §5.1.10, BDS ICD §5.2.4.15 — the same Kepler solution with the
22
+ * per-system GM/rotation conventions used by `keplerPosition`, and
23
+ * the BDS-GEO doubly-rotated frame per the BDS ICD.
24
+ */
25
+
26
+ interface AlmanacPosition {
27
+ prn: string;
28
+ /** ECEF position in metres (WGS84/GTRF/CGCS2000 per system). */
29
+ x: number;
30
+ y: number;
31
+ z: number;
32
+ /** SV clock offset at t in seconds (af0 + af1·Δt). */
33
+ clockBias: number;
34
+ }
35
+ /** GPS-scale epoch ms of the almanac reference time. */
36
+ declare function almanacEpochMs(alm: SbfKeplerAlmanac): number;
37
+ /**
38
+ * Propagate a Kepler almanac to `timeMs` (GPS-scale epoch ms, the
39
+ * repo-wide convention). Valid for offsets of several days around the
40
+ * almanac epoch; accuracy degrades gracefully (km → tens of km over
41
+ * a week, per the almanac design).
42
+ */
43
+ declare function almanacSatPosition(alm: SbfKeplerAlmanac, timeMs: number): AlmanacPosition;
44
+
45
+ /**
46
+ * GLONASS almanac orbit propagation — the osculating-elements method
47
+ * of the GLONASS ICD (Edition 5.1, 2008), Appendix A.3.2 "Algorithm of
48
+ * calculation of satellite motion parameters using almanac": semi-major
49
+ * axis by successive approximation from the Draconian period, node
50
+ * passage extrapolation with ΔT/ΔT′, first-order C20 (J2) secular and
51
+ * periodic corrections to the osculating elements, Kepler solution,
52
+ * PZ-90 ECEF output.
53
+ *
54
+ * The ICD computes coordinates in an absolute (inertial) frame OXaYaZa
55
+ * offset from Greenwich by true sidereal time S; here the node is
56
+ * carried directly in the Greenwich frame — Ωg = λk + δΩ − ωз·(ti−tλk)
57
+ * — which is algebraically identical (the S0 sidereal terms cancel) and
58
+ * needs no sidereal-time model. Verified against the ICD A.3.2.3 worked
59
+ * example to sub-metre level (see test/orbit-almanac-glo.test.ts).
60
+ *
61
+ * Constants are the ICD's own (km-based; the worked example pins them).
62
+ * ωз is 0.7292115e-4 s⁻¹ per the Russian original and the CDMA-era
63
+ * General Description ICD — the English 5.1 translation misprints it as
64
+ * 0.7392115e-4, which moves the worked example by ~278 km.
65
+ *
66
+ * Time handling follows `almanacSatPosition`: `timeMs` is GPS-scale
67
+ * epoch ms (repo-wide convention) and the offset from the almanac epoch
68
+ * is deliberately NOT folded into a half-week window — almanacs are
69
+ * propagated days ahead. The almanac epoch (instant of the first
70
+ * ascending-node passage tλ) is reconstructed from the GLONASS calendar
71
+ * fields N4/NA/tλ, which are Moscow time (UTC+3 h): the SBF `toaSec`
72
+ * field is a day-boundary reference rounded by the receiver, up to
73
+ * ±12 h away from tλ, and must not be used as the propagation origin.
74
+ */
75
+
76
+ /**
77
+ * GPS-scale epoch ms of the almanac reference instant tλ (the first
78
+ * ascending-node passage within day NA), from the GLONASS calendar
79
+ * fields N4/NA and the Moscow-time seconds of day tλ.
80
+ */
81
+ declare function glonassAlmanacEpochMs(alm: SbfGlonassAlmanac): number;
82
+ /**
83
+ * Propagate a GLONASS almanac to `timeMs` (GPS-scale epoch ms).
84
+ * Returns PZ-90 ECEF metres (PZ-90.11 is aligned with WGS84 to
85
+ * centimetres — no frame transformation is applied, matching the
86
+ * ephemeris path). `clockBias` is −τnA (the RINEX/af0 sign convention
87
+ * used repo-wide: positioning adds +tauN, and tauN = −τn of the ICD).
88
+ *
89
+ * Almanac-class accuracy: sub-km at the reference epoch, a few km
90
+ * after a day, ~10 km-class after several days.
91
+ */
92
+ declare function glonassAlmanacPosition(alm: SbfGlonassAlmanac, timeMs: number): AlmanacPosition;
4
93
 
5
94
  /**
6
95
  * Satellite orbit computation from broadcast ephemerides.
@@ -193,4 +282,4 @@ declare function computeVisibility(ephemerides: Ephemeris[], rxPos: [number, num
193
282
  */
194
283
  declare function computeVisibilityFromPositions(all: AllPositionsData, elevationMaskDeg?: number | number[]): VisibilityResult;
195
284
 
196
- export { type AllPositionsData, type DopValues, type EpochSkyData, type SatAzEl, type SatPoint, type SatPosition, type VisibilityPass, type VisibilityResult, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris };
285
+ export { type AllPositionsData, type AlmanacPosition, type DopValues, type EpochSkyData, type SatAzEl, type SatPoint, type SatPosition, type VisibilityPass, type VisibilityResult, almanacEpochMs, almanacSatPosition, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassAlmanacEpochMs, glonassAlmanacPosition, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris };
package/dist/orbit.d.ts CHANGED
@@ -1,6 +1,95 @@
1
1
  import { E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris } from './nav-DImXUdbp.js';
2
2
  import { E as EphemerisInfo } from './ephemeris-Ohl6NAfw.js';
3
3
  export { e as ecefToGeodetic, g as geodeticToEcef } from './ecef-CF0uAysr.js';
4
+ import { c as SbfKeplerAlmanac, b as SbfGlonassAlmanac } from './nav-CN8rxL4h.js';
5
+
6
+ /**
7
+ * Almanac orbit propagation for GPS/Galileo/BeiDou Kepler almanacs
8
+ * (SbfKeplerAlmanac — absolute elements as normalized by the SBF
9
+ * decoder) — the planner-facing counterpart of `keplerPosition`.
10
+ *
11
+ * Differences from the ephemeris path, both deliberate:
12
+ * - the time offset from the almanac epoch is NOT folded into the
13
+ * ±302 400 s half-week window: almanacs are meant to be propagated
14
+ * days ahead, and the fold would silently wrap a Tuesday query
15
+ * onto the previous Friday;
16
+ * - no harmonic corrections, Δn or IDOT exist in an almanac — the
17
+ * resulting positions are almanac-class (km-level), which is the
18
+ * contract: visibility/elevation planning, not ranging.
19
+ *
20
+ * IS-GPS-200 §20.3.3.5.2.1 (almanac user algorithm), Galileo OS ICD
21
+ * §5.1.10, BDS ICD §5.2.4.15 — the same Kepler solution with the
22
+ * per-system GM/rotation conventions used by `keplerPosition`, and
23
+ * the BDS-GEO doubly-rotated frame per the BDS ICD.
24
+ */
25
+
26
+ interface AlmanacPosition {
27
+ prn: string;
28
+ /** ECEF position in metres (WGS84/GTRF/CGCS2000 per system). */
29
+ x: number;
30
+ y: number;
31
+ z: number;
32
+ /** SV clock offset at t in seconds (af0 + af1·Δt). */
33
+ clockBias: number;
34
+ }
35
+ /** GPS-scale epoch ms of the almanac reference time. */
36
+ declare function almanacEpochMs(alm: SbfKeplerAlmanac): number;
37
+ /**
38
+ * Propagate a Kepler almanac to `timeMs` (GPS-scale epoch ms, the
39
+ * repo-wide convention). Valid for offsets of several days around the
40
+ * almanac epoch; accuracy degrades gracefully (km → tens of km over
41
+ * a week, per the almanac design).
42
+ */
43
+ declare function almanacSatPosition(alm: SbfKeplerAlmanac, timeMs: number): AlmanacPosition;
44
+
45
+ /**
46
+ * GLONASS almanac orbit propagation — the osculating-elements method
47
+ * of the GLONASS ICD (Edition 5.1, 2008), Appendix A.3.2 "Algorithm of
48
+ * calculation of satellite motion parameters using almanac": semi-major
49
+ * axis by successive approximation from the Draconian period, node
50
+ * passage extrapolation with ΔT/ΔT′, first-order C20 (J2) secular and
51
+ * periodic corrections to the osculating elements, Kepler solution,
52
+ * PZ-90 ECEF output.
53
+ *
54
+ * The ICD computes coordinates in an absolute (inertial) frame OXaYaZa
55
+ * offset from Greenwich by true sidereal time S; here the node is
56
+ * carried directly in the Greenwich frame — Ωg = λk + δΩ − ωз·(ti−tλk)
57
+ * — which is algebraically identical (the S0 sidereal terms cancel) and
58
+ * needs no sidereal-time model. Verified against the ICD A.3.2.3 worked
59
+ * example to sub-metre level (see test/orbit-almanac-glo.test.ts).
60
+ *
61
+ * Constants are the ICD's own (km-based; the worked example pins them).
62
+ * ωз is 0.7292115e-4 s⁻¹ per the Russian original and the CDMA-era
63
+ * General Description ICD — the English 5.1 translation misprints it as
64
+ * 0.7392115e-4, which moves the worked example by ~278 km.
65
+ *
66
+ * Time handling follows `almanacSatPosition`: `timeMs` is GPS-scale
67
+ * epoch ms (repo-wide convention) and the offset from the almanac epoch
68
+ * is deliberately NOT folded into a half-week window — almanacs are
69
+ * propagated days ahead. The almanac epoch (instant of the first
70
+ * ascending-node passage tλ) is reconstructed from the GLONASS calendar
71
+ * fields N4/NA/tλ, which are Moscow time (UTC+3 h): the SBF `toaSec`
72
+ * field is a day-boundary reference rounded by the receiver, up to
73
+ * ±12 h away from tλ, and must not be used as the propagation origin.
74
+ */
75
+
76
+ /**
77
+ * GPS-scale epoch ms of the almanac reference instant tλ (the first
78
+ * ascending-node passage within day NA), from the GLONASS calendar
79
+ * fields N4/NA and the Moscow-time seconds of day tλ.
80
+ */
81
+ declare function glonassAlmanacEpochMs(alm: SbfGlonassAlmanac): number;
82
+ /**
83
+ * Propagate a GLONASS almanac to `timeMs` (GPS-scale epoch ms).
84
+ * Returns PZ-90 ECEF metres (PZ-90.11 is aligned with WGS84 to
85
+ * centimetres — no frame transformation is applied, matching the
86
+ * ephemeris path). `clockBias` is −τnA (the RINEX/af0 sign convention
87
+ * used repo-wide: positioning adds +tauN, and tauN = −τn of the ICD).
88
+ *
89
+ * Almanac-class accuracy: sub-km at the reference epoch, a few km
90
+ * after a day, ~10 km-class after several days.
91
+ */
92
+ declare function glonassAlmanacPosition(alm: SbfGlonassAlmanac, timeMs: number): AlmanacPosition;
4
93
 
5
94
  /**
6
95
  * Satellite orbit computation from broadcast ephemerides.
@@ -193,4 +282,4 @@ declare function computeVisibility(ephemerides: Ephemeris[], rxPos: [number, num
193
282
  */
194
283
  declare function computeVisibilityFromPositions(all: AllPositionsData, elevationMaskDeg?: number | number[]): VisibilityResult;
195
284
 
196
- export { type AllPositionsData, type DopValues, type EpochSkyData, type SatAzEl, type SatPoint, type SatPosition, type VisibilityPass, type VisibilityResult, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris };
285
+ export { type AllPositionsData, type AlmanacPosition, type DopValues, type EpochSkyData, type SatAzEl, type SatPoint, type SatPosition, type VisibilityPass, type VisibilityResult, almanacEpochMs, almanacSatPosition, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassAlmanacEpochMs, glonassAlmanacPosition, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris };
package/dist/orbit.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import {
2
+ almanacEpochMs,
3
+ almanacSatPosition,
2
4
  computeAllPositions,
3
5
  computeDop,
4
6
  computeLiveSkyPositions,
@@ -8,13 +10,15 @@ import {
8
10
  dopplerHz,
9
11
  ecefToAzEl,
10
12
  ephInfoToEphemeris,
13
+ glonassAlmanacEpochMs,
14
+ glonassAlmanacPosition,
11
15
  glonassPosition,
12
16
  keplerPosition,
13
17
  maskRadForAzimuth,
14
18
  navTimesFromEph,
15
19
  rangeRate,
16
20
  selectEphemeris
17
- } from "./chunk-OMVL3X7V.js";
21
+ } from "./chunk-JNFV5BYB.js";
18
22
  import {
19
23
  ecefToGeodetic,
20
24
  geodeticToEcef
@@ -24,6 +28,8 @@ import "./chunk-HVXYFUCB.js";
24
28
  import "./chunk-LEEU5OIO.js";
25
29
  import "./chunk-FIEWO4J4.js";
26
30
  export {
31
+ almanacEpochMs,
32
+ almanacSatPosition,
27
33
  computeAllPositions,
28
34
  computeDop,
29
35
  computeLiveSkyPositions,
@@ -35,6 +41,8 @@ export {
35
41
  ecefToGeodetic,
36
42
  ephInfoToEphemeris,
37
43
  geodeticToEcef,
44
+ glonassAlmanacEpochMs,
45
+ glonassAlmanacPosition,
38
46
  glonassPosition,
39
47
  keplerPosition,
40
48
  maskRadForAzimuth,
@@ -2,6 +2,7 @@ import { E as Ephemeris } from './nav-DImXUdbp.cjs';
2
2
  import { DopValues } from './orbit.cjs';
3
3
  import './ephemeris-Ohl6NAfw.cjs';
4
4
  import './ecef-CF0uAysr.cjs';
5
+ import './nav-BYmYoh9A.cjs';
5
6
 
6
7
  /**
7
8
  * Klobuchar broadcast ionospheric model (IS-GPS-200, 20.3.3.5.2.5).
@@ -2,6 +2,7 @@ import { E as Ephemeris } from './nav-DImXUdbp.js';
2
2
  import { DopValues } from './orbit.js';
3
3
  import './ephemeris-Ohl6NAfw.js';
4
4
  import './ecef-CF0uAysr.js';
5
+ import './nav-CN8rxL4h.js';
5
6
 
6
7
  /**
7
8
  * Klobuchar broadcast ionospheric model (IS-GPS-200, 20.3.3.5.2.5).
@@ -3,8 +3,8 @@ import {
3
3
  klobucharDelay,
4
4
  satClockCorrection,
5
5
  solveSpp
6
- } from "./chunk-QXZZNXE3.js";
7
- import "./chunk-OMVL3X7V.js";
6
+ } from "./chunk-B5LU4746.js";
7
+ import "./chunk-JNFV5BYB.js";
8
8
  import "./chunk-37QNKGTC.js";
9
9
  import "./chunk-6FAL6P4G.js";
10
10
  import "./chunk-HVXYFUCB.js";
package/dist/rinex.js CHANGED
@@ -18,9 +18,8 @@ import {
18
18
  writeRinexNav,
19
19
  writeRinexNav4,
20
20
  writeRinexObsBlob
21
- } from "./chunk-K73SERD5.js";
22
- import "./chunk-6NCMACDO.js";
23
- import "./chunk-IQ5OIMQD.js";
21
+ } from "./chunk-NOQAAUGY.js";
22
+ import "./chunk-WZDFZ76K.js";
24
23
  import {
25
24
  SYSTEM_ORDER,
26
25
  crxDecompress,