gnss-js 1.17.0 → 1.19.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
@@ -4,13 +4,13 @@ export { A as ARC_GAP_FACTOR, B as BAND_LABELS, a as BDS_SATELLITES, b as BdsSat
4
4
  export { Scale, getBdsTime, getDateFromBdsTime, getDateFromDayOfWeek, getDateFromDayOfYear, getDateFromGalTime, getDateFromGloN, getDateFromGpsData, getDateFromGpsTime, getDateFromHourCode, getDateFromJulianDate, getDateFromMJD, getDateFromMJD2000, getDateFromRINEX, getDateFromTai, getDateFromTimeOfDay, getDateFromTt, getDateFromUnixTime, getDateFromUtc, getDayOfWeek, getDayOfYear, getGalTime, getGloN4, getGloNA, getGpsLeap, getGpsTime, getHourCode, getHoursFromTimeDifference, getJulianDate, getLeap, getMJD, getMJD2000, getMinutesFromTimeDifference, getNtpTime, getRINEX, getSecondsFromTimeDifference, getTaiDate, getTimeDifference, getTimeDifferenceFromDays, getTimeDifferenceFromHours, getTimeDifferenceFromMinutes, getTimeDifferenceFromObject, getTimeDifferenceFromSeconds, getTimeOfDay, getTimeOfWeek, getTotalDaysFromTimeDifference, getTtDate, getUnixTime, getUtcDate, getWeekNumber, getWeekOfYear } from './time.cjs';
5
5
  export { deg2dms, deg2rad, euclidean3D, geodeticToGeohash, geodeticToMaidenhead, geodeticToUtm, greatCircleMidpoint, horizonDistance, rad2deg, rhumbLine, vincenty } from './coordinates.cjs';
6
6
  export { c as clampUnit, e as ecefToGeodetic, g as geodeticToEcef, a as getAer, b as getEnuDifference } from './ecef-CF0uAysr.cjs';
7
- export { CompactEpoch, CrxField, DiffState, EMPTY_WARNINGS, IonexGrid, RinexWarning, RinexWarnings, Sp3File, Sp3Sample, WarningAccumulator, WarningSeverity, createGzipLineSink, crxDecompress, crxRepair, fmtF, hdrLine, padL, padR, parseCrxDataLine, parseIonex, parseSp3, sp3Position, stationHeaderLines, writeModernObsBlob, writeRinex2ObsBlob, writeRinex4ObsBlob, writeRinexNav, writeRinexObsBlob } from './rinex.cjs';
7
+ export { CompactEpoch, CrxField, DiffState, EMPTY_WARNINGS, IonexGrid, Nav4Input, RinexWarning, RinexWarnings, Sp3File, Sp3Sample, WarningAccumulator, WarningSeverity, createGzipLineSink, crxDecompress, crxRepair, fmtD, fmtF, hdrLine, padL, padR, parseCrxDataLine, parseIonex, parseSp3, sp3Position, stationHeaderLines, writeModernObsBlob, writeRinex2ObsBlob, writeRinex4ObsBlob, writeRinexNav, writeRinexNav4, writeRinexObsBlob } from './rinex.cjs';
8
8
  export { E as EpochSummary, P as ParseOptions, R as RinexHeader, a as RinexResult, b as RinexStats, S as SYSTEM_ORDER, c as SatObsCallback, p as parseRinexStream, s as systemCmp, d as systemName } from './parser-JPjjFgeP.cjs';
9
- export { E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris, N as NavHeader, a as NavResult, p as parseNavFile } from './nav-BAI1a9vK.cjs';
9
+ export { C as CnavEphemeris, E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris, N as NavHeader, a as NavResult, R as RinexCnavEphemeris, p as parseNavFile } from './nav-DImXUdbp.cjs';
10
10
  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';
11
11
  export { MessageTypeStats, MsmEpoch, MsmSatObs, MsmSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, StationMeta, StreamStats, createStationMeta, createStreamStats, decodeMsmFull, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.cjs';
12
- export { UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawxEpoch, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames } from './ubx.cjs';
13
- export { SbfAlmanac, SbfAlmanacResult, SbfGlonassAlmanac, SbfIonoUtcResult, SbfKeplerAlmanac, SbfMeasEpoch, SbfMeasurement, SbfNavResult, SbfParseResult, parseSbfAlmanac, parseSbfIonoUtc, parseSbfMeas, parseSbfNav, sbfCrc16, scanSbfFrames } from './sbf.cjs';
12
+ export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames } from './ubx.cjs';
13
+ export { SbfAlmanac, SbfAlmanacResult, SbfCnavEphemeris, SbfCnavResult, SbfGlonassAlmanac, SbfIonoUtcResult, SbfKeplerAlmanac, SbfMeasEpoch, SbfMeasurement, SbfNavResult, SbfParseResult, parseSbfAlmanac, parseSbfCnav, parseSbfIonoUtc, parseSbfMeas, parseSbfNav, sbfCrc16, scanSbfFrames } from './sbf.cjs';
14
14
  export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange } from './novatel.cjs';
15
15
  export { AllPositionsData, DopValues, EpochSkyData, SatAzEl, SatPoint, SatPosition, VisibilityPass, VisibilityResult, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris } from './orbit.cjs';
16
16
  export { Helmert14, REFERENCE_FRAMES, ReferenceFrame, applyHelmert, dateToEpoch, transformFrame } from './frames.cjs';
package/dist/index.d.ts CHANGED
@@ -4,13 +4,13 @@ export { A as ARC_GAP_FACTOR, B as BAND_LABELS, a as BDS_SATELLITES, b as BdsSat
4
4
  export { Scale, getBdsTime, getDateFromBdsTime, getDateFromDayOfWeek, getDateFromDayOfYear, getDateFromGalTime, getDateFromGloN, getDateFromGpsData, getDateFromGpsTime, getDateFromHourCode, getDateFromJulianDate, getDateFromMJD, getDateFromMJD2000, getDateFromRINEX, getDateFromTai, getDateFromTimeOfDay, getDateFromTt, getDateFromUnixTime, getDateFromUtc, getDayOfWeek, getDayOfYear, getGalTime, getGloN4, getGloNA, getGpsLeap, getGpsTime, getHourCode, getHoursFromTimeDifference, getJulianDate, getLeap, getMJD, getMJD2000, getMinutesFromTimeDifference, getNtpTime, getRINEX, getSecondsFromTimeDifference, getTaiDate, getTimeDifference, getTimeDifferenceFromDays, getTimeDifferenceFromHours, getTimeDifferenceFromMinutes, getTimeDifferenceFromObject, getTimeDifferenceFromSeconds, getTimeOfDay, getTimeOfWeek, getTotalDaysFromTimeDifference, getTtDate, getUnixTime, getUtcDate, getWeekNumber, getWeekOfYear } from './time.js';
5
5
  export { deg2dms, deg2rad, euclidean3D, geodeticToGeohash, geodeticToMaidenhead, geodeticToUtm, greatCircleMidpoint, horizonDistance, rad2deg, rhumbLine, vincenty } from './coordinates.js';
6
6
  export { c as clampUnit, e as ecefToGeodetic, g as geodeticToEcef, a as getAer, b as getEnuDifference } from './ecef-CF0uAysr.js';
7
- export { CompactEpoch, CrxField, DiffState, EMPTY_WARNINGS, IonexGrid, RinexWarning, RinexWarnings, Sp3File, Sp3Sample, WarningAccumulator, WarningSeverity, createGzipLineSink, crxDecompress, crxRepair, fmtF, hdrLine, padL, padR, parseCrxDataLine, parseIonex, parseSp3, sp3Position, stationHeaderLines, writeModernObsBlob, writeRinex2ObsBlob, writeRinex4ObsBlob, writeRinexNav, writeRinexObsBlob } from './rinex.js';
7
+ export { CompactEpoch, CrxField, DiffState, EMPTY_WARNINGS, IonexGrid, Nav4Input, RinexWarning, RinexWarnings, Sp3File, Sp3Sample, WarningAccumulator, WarningSeverity, createGzipLineSink, crxDecompress, crxRepair, fmtD, fmtF, hdrLine, padL, padR, parseCrxDataLine, parseIonex, parseSp3, sp3Position, stationHeaderLines, writeModernObsBlob, writeRinex2ObsBlob, writeRinex4ObsBlob, writeRinexNav, writeRinexNav4, writeRinexObsBlob } from './rinex.js';
8
8
  export { E as EpochSummary, P as ParseOptions, R as RinexHeader, a as RinexResult, b as RinexStats, S as SYSTEM_ORDER, c as SatObsCallback, p as parseRinexStream, s as systemCmp, d as systemName } from './parser-JPjjFgeP.js';
9
- export { E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris, N as NavHeader, a as NavResult, p as parseNavFile } from './nav-BAI1a9vK.js';
9
+ export { C as CnavEphemeris, E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris, N as NavHeader, a as NavResult, R as RinexCnavEphemeris, p as parseNavFile } from './nav-DImXUdbp.js';
10
10
  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';
11
11
  export { MessageTypeStats, MsmEpoch, MsmSatObs, MsmSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, StationMeta, StreamStats, createStationMeta, createStreamStats, decodeMsmFull, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.js';
12
- export { UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawxEpoch, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames } from './ubx.js';
13
- export { SbfAlmanac, SbfAlmanacResult, SbfGlonassAlmanac, SbfIonoUtcResult, SbfKeplerAlmanac, SbfMeasEpoch, SbfMeasurement, SbfNavResult, SbfParseResult, parseSbfAlmanac, parseSbfIonoUtc, parseSbfMeas, parseSbfNav, sbfCrc16, scanSbfFrames } from './sbf.js';
12
+ export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames } from './ubx.js';
13
+ export { SbfAlmanac, SbfAlmanacResult, SbfCnavEphemeris, SbfCnavResult, SbfGlonassAlmanac, SbfIonoUtcResult, SbfKeplerAlmanac, SbfMeasEpoch, SbfMeasurement, SbfNavResult, SbfParseResult, parseSbfAlmanac, parseSbfCnav, parseSbfIonoUtc, parseSbfMeas, parseSbfNav, sbfCrc16, scanSbfFrames } from './sbf.js';
14
14
  export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange } from './novatel.js';
15
15
  export { AllPositionsData, DopValues, EpochSkyData, SatAzEl, SatPoint, SatPosition, VisibilityPass, VisibilityResult, computeAllPositions, computeDop, computeLiveSkyPositions, computeSatPosition, computeVisibility, computeVisibilityFromPositions, dopplerHz, ecefToAzEl, ephInfoToEphemeris, glonassPosition, keplerPosition, maskRadForAzimuth, navTimesFromEph, rangeRate, selectEphemeris } from './orbit.js';
16
16
  export { Helmert14, REFERENCE_FRAMES, ReferenceFrame, applyHelmert, dateToEpoch, transformFrame } from './frames.js';
package/dist/index.js CHANGED
@@ -34,27 +34,28 @@ import {
34
34
  phiBPSK
35
35
  } from "./chunk-2K3FCJBX.js";
36
36
  import {
37
+ parseUbxCnav,
37
38
  parseUbxIonoUtc,
38
39
  parseUbxNav,
39
40
  parseUbxRawx,
40
41
  ubxFrames
41
- } from "./chunk-IG5CDNDS.js";
42
+ } from "./chunk-JW2ICDR7.js";
42
43
  import {
43
44
  crc16,
44
45
  parseSbfAlmanac,
46
+ parseSbfCnav,
45
47
  parseSbfIonoUtc,
46
48
  parseSbfMeas,
47
49
  parseSbfNav,
48
50
  scanSbfFrames
49
- } from "./chunk-ZNCQNHNI.js";
51
+ } from "./chunk-5S5HMAKW.js";
50
52
  import {
51
53
  OEM4_HLEN,
52
54
  crc32,
53
55
  oem4Frames,
54
56
  parseNovatelNav,
55
57
  parseNovatelRange
56
- } from "./chunk-7QR2KPDU.js";
57
- import "./chunk-REYOYF7O.js";
58
+ } from "./chunk-2IM5VXNI.js";
58
59
  import {
59
60
  connectToMountpoint,
60
61
  fetchSourcetable,
@@ -161,6 +162,7 @@ import {
161
162
  EMPTY_WARNINGS,
162
163
  WarningAccumulator,
163
164
  createGzipLineSink,
165
+ fmtD,
164
166
  fmtF,
165
167
  hdrLine,
166
168
  padL,
@@ -174,8 +176,11 @@ import {
174
176
  writeRinex2ObsBlob,
175
177
  writeRinex4ObsBlob,
176
178
  writeRinexNav,
179
+ writeRinexNav4,
177
180
  writeRinexObsBlob
178
- } from "./chunk-HXF7XVW7.js";
181
+ } from "./chunk-K73SERD5.js";
182
+ import "./chunk-6NCMACDO.js";
183
+ import "./chunk-IQ5OIMQD.js";
179
184
  import {
180
185
  SYSTEM_ORDER,
181
186
  crxDecompress,
@@ -405,6 +410,7 @@ export {
405
410
  ephInfoToEphemeris,
406
411
  euclidean3D,
407
412
  fetchSourcetable,
413
+ fmtD,
408
414
  fmtF,
409
415
  formatUTCTime,
410
416
  frequencyLabel,
@@ -489,12 +495,14 @@ export {
489
495
  parseNovatelRange,
490
496
  parseRinexStream,
491
497
  parseSbfAlmanac,
498
+ parseSbfCnav,
492
499
  parseSbfIonoUtc,
493
500
  parseSbfMeas,
494
501
  parseSbfNav,
495
502
  parseSinexBiasDcb,
496
503
  parseSourcetable,
497
504
  parseSp3,
505
+ parseUbxCnav,
498
506
  parseUbxIonoUtc,
499
507
  parseUbxNav,
500
508
  parseUbxRawx,
@@ -530,5 +538,6 @@ export {
530
538
  writeRinex2ObsBlob,
531
539
  writeRinex4ObsBlob,
532
540
  writeRinexNav,
541
+ writeRinexNav4,
533
542
  writeRinexObsBlob
534
543
  };
@@ -0,0 +1,223 @@
1
+ /**
2
+ * A complete GPS CNAV ephemeris + clock data set assembled from one
3
+ * MT10, one MT11 and one MT3x message (IS-GPS-200 §30.3.3.1: the three
4
+ * message types together carry the CEI data set; toe/toc equality
5
+ * marks messages of the same set).
6
+ *
7
+ * Units are SI/radians: semicircle fields are scaled by GPS_PI, the
8
+ * MT10 ΔA reference (26 559 710 m) and the MT11 Ω̇ reference
9
+ * (−2.6×10⁻⁹ semicircles/s) are folded into `a` and `omegaDot`, with
10
+ * the raw deltas also kept. Epoch Dates are GPS-scale (repo
11
+ * convention: GPS seconds mapped onto the JS epoch without leap
12
+ * seconds), and `toe`/`toc` are seconds of `week`/`weekToc`.
13
+ */
14
+ interface CnavEphemeris {
15
+ system: 'G';
16
+ /** RINEX PRN, e.g. "G07". */
17
+ prn: string;
18
+ /** Full GPS week from the MT10 WN field (13 bits, no rollover). */
19
+ week: number;
20
+ /** L1/L2/L5 signal-health bits from MT10 (bit 2 = L1, 0 = L5). */
21
+ health: number;
22
+ /** Elevation-dependent (ED) URA index, signed (MT10). */
23
+ uraEd: number;
24
+ /** Non-elevation-dependent URA indices: bias/drift/drift-rate (MT3x). */
25
+ uraNed0: number;
26
+ uraNed1: number;
27
+ uraNed2: number;
28
+ /** Data-predict time of week in s (MT10). */
29
+ top: number;
30
+ /** Time of ephemeris in seconds of the GPS week of `toeDate`. */
31
+ toe: number;
32
+ /** Time of ephemeris as a GPS-scale Date. */
33
+ toeDate: Date;
34
+ /** Semi-major axis at toe in m (reference + ΔA). */
35
+ a: number;
36
+ /** MT10 ΔA: semi-major axis difference from 26 559 710 m, in m. */
37
+ deltaA: number;
38
+ /** Rate of semi-major axis in m/s. */
39
+ aDot: number;
40
+ /** Mean motion difference from computed value in rad/s. */
41
+ deltaN0: number;
42
+ /** Rate of the mean motion difference in rad/s². */
43
+ deltaN0Dot: number;
44
+ /** Mean anomaly at reference time in rad. */
45
+ m0: number;
46
+ /** Eccentricity (dimensionless). */
47
+ e: number;
48
+ /** Argument of perigee in rad. */
49
+ omega: number;
50
+ /** Longitude of ascending node at the weekly epoch in rad. */
51
+ omega0: number;
52
+ /** Inclination at reference time in rad. */
53
+ i0: number;
54
+ /** Rate of right ascension in rad/s (reference Ω̇ + ΔΩ̇). */
55
+ omegaDot: number;
56
+ /** MT11 ΔΩ̇: delta from −2.6×10⁻⁹ semicircles/s, in rad/s. */
57
+ deltaOmegaDot: number;
58
+ /** Rate of inclination in rad/s. */
59
+ i0Dot: number;
60
+ /** Harmonic correction terms (rad / m). */
61
+ cis: number;
62
+ cic: number;
63
+ crs: number;
64
+ crc: number;
65
+ cus: number;
66
+ cuc: number;
67
+ /** Clock epoch in seconds of the GPS week of `tocDate`. */
68
+ toc: number;
69
+ /** Clock epoch as a GPS-scale Date. */
70
+ tocDate: Date;
71
+ /** SV clock bias (s), drift (s/s), drift rate (s/s²). */
72
+ af0: number;
73
+ af1: number;
74
+ af2: number;
75
+ /** Message type (30-37) that supplied the clock block. */
76
+ clockMsgType: number;
77
+ /** L1 C/A group delay in s (MT30), null when unavailable/not seen. */
78
+ tgd: number | null;
79
+ /** Inter-signal corrections in s (MT30), null when unavailable. */
80
+ iscL1ca: number | null;
81
+ iscL2c: number | null;
82
+ iscL5i5: number | null;
83
+ iscL5q5: number | null;
84
+ /** Klobuchar iono coefficients from MT30, when one was seen. */
85
+ ionoAlpha?: number[];
86
+ ionoBeta?: number[];
87
+ /** Data-predict week from MT30 (WN_OP, 8 bits, unresolved). */
88
+ wnOp?: number;
89
+ /** Integrity-status and L2C-phasing flags from MT10. */
90
+ integrityFlag: boolean;
91
+ l2cPhasing: boolean;
92
+ /** Transmit time of the MT10 message (s of week, start of next msg). */
93
+ tow: number;
94
+ }
95
+
96
+ /**
97
+ * RINEX 3.x/4.x navigation file parser.
98
+ * Parses GPS, Galileo, BeiDou (Keplerian), and GLONASS (state vector)
99
+ * ephemerides, plus GPS/QZSS CNAV records from RINEX 4 files.
100
+ */
101
+
102
+ interface NavHeader {
103
+ version: number;
104
+ type: string;
105
+ leapSeconds: number | null;
106
+ ionoCorrections: Record<string, number[]>;
107
+ }
108
+ /** GPS / Galileo / BeiDou / QZSS / NavIC Keplerian ephemeris. */
109
+ interface KeplerEphemeris {
110
+ system: 'G' | 'E' | 'C' | 'J' | 'I';
111
+ /** Satellite PRN, e.g. "G14". */
112
+ prn: string;
113
+ /** Epoch of clock in seconds of GPS week. */
114
+ toc: number;
115
+ /** Epoch of clock as a Date. */
116
+ tocDate: Date;
117
+ /** SV clock bias in seconds. */
118
+ af0: number;
119
+ /** SV clock drift in s/s. */
120
+ af1: number;
121
+ /** SV clock drift rate in s/s². */
122
+ af2: number;
123
+ /** Issue of data (ephemeris). */
124
+ iode: number;
125
+ /** Amplitude of sine correction to orbit radius in meters. */
126
+ crs: number;
127
+ /** Mean motion difference in rad/s. */
128
+ deltaN: number;
129
+ /** Mean anomaly at reference time in radians. */
130
+ m0: number;
131
+ /** Amplitude of cosine correction to argument of latitude in radians. */
132
+ cuc: number;
133
+ /** Eccentricity (dimensionless). */
134
+ e: number;
135
+ /** Amplitude of sine correction to argument of latitude in radians. */
136
+ cus: number;
137
+ /** Square root of semi-major axis in m^(1/2). */
138
+ sqrtA: number;
139
+ /** Time of ephemeris in seconds of GPS week. */
140
+ toe: number;
141
+ /** Amplitude of cosine correction to inclination in radians. */
142
+ cic: number;
143
+ /** Right ascension of ascending node at reference time in radians. */
144
+ omega0: number;
145
+ /** Amplitude of sine correction to inclination in radians. */
146
+ cis: number;
147
+ /** Inclination at reference time in radians. */
148
+ i0: number;
149
+ /** Amplitude of cosine correction to orbit radius in meters. */
150
+ crc: number;
151
+ /** Argument of perigee in radians. */
152
+ omega: number;
153
+ /** Rate of right ascension in rad/s. */
154
+ omegaDot: number;
155
+ /** Rate of inclination in rad/s. */
156
+ idot: number;
157
+ /** GPS week number. */
158
+ week: number;
159
+ /** SV health flag. */
160
+ svHealth: number;
161
+ /** Total group delay in seconds. */
162
+ tgd: number;
163
+ }
164
+ /** GLONASS / SBAS state-vector ephemeris. Positions in km, velocities in km/s, accelerations in km/s². */
165
+ interface GlonassEphemeris {
166
+ system: 'R' | 'S';
167
+ prn: string;
168
+ tocDate: Date;
169
+ /** Clock bias (seconds). */
170
+ tauN: number;
171
+ /** Relative frequency bias (dimensionless). */
172
+ gammaN: number;
173
+ /** Message frame time (seconds of UTC day). */
174
+ messageFrameTime: number;
175
+ /** X position in km (PZ-90). */
176
+ x: number;
177
+ /** X velocity in km/s. */
178
+ xDot: number;
179
+ /** X acceleration in km/s² (luni-solar). */
180
+ xAcc: number;
181
+ /** Y position in km (PZ-90). */
182
+ y: number;
183
+ /** Y velocity in km/s. */
184
+ yDot: number;
185
+ /** Y acceleration in km/s² (luni-solar). */
186
+ yAcc: number;
187
+ /** Z position in km (PZ-90). */
188
+ z: number;
189
+ /** Z velocity in km/s. */
190
+ zDot: number;
191
+ /** Z acceleration in km/s² (luni-solar). */
192
+ zAcc: number;
193
+ /** Health flag (0 = healthy). */
194
+ health: number;
195
+ /** GLONASS frequency channel number (-7 to +6). */
196
+ freqNum: number;
197
+ }
198
+ type Ephemeris = KeplerEphemeris | GlonassEphemeris;
199
+ /**
200
+ * A GPS or QZSS CNAV ephemeris read from a RINEX 4 `> EPH ... CNAV`
201
+ * record (RINEX 4.01 Tables A10/A18). Same shape as the
202
+ * `CnavEphemeris` assembled from raw navigation bits, except that
203
+ * QZSS records are allowed.
204
+ *
205
+ * Fields the RINEX record does not carry are defaulted: `clockMsgType`
206
+ * is 0 (the record does not say which MT3x supplied the clock), and
207
+ * `integrityFlag`/`l2cPhasing` are false. `tow` holds the record's
208
+ * transmission time of message (t_tm) and `wnOp` the ambiguity-resolved
209
+ * data-predict week from the file. `toe` equals `toc` (RINEX 4.01
210
+ * Table A10 note 2: per IS-GPS-705 20.3.4.4 only Toc is provided).
211
+ */
212
+ type RinexCnavEphemeris = Omit<CnavEphemeris, 'system'> & {
213
+ system: 'G' | 'J';
214
+ };
215
+ interface NavResult {
216
+ header: NavHeader;
217
+ ephemerides: Ephemeris[];
218
+ /** GPS/QZSS CNAV ephemerides (RINEX 4 only), present when any were read. */
219
+ cnav?: RinexCnavEphemeris[];
220
+ }
221
+ declare function parseNavFile(text: string): NavResult;
222
+
223
+ export { type CnavEphemeris as C, type Ephemeris as E, type GlonassEphemeris as G, type KeplerEphemeris as K, type NavHeader as N, type RinexCnavEphemeris as R, type NavResult as a, parseNavFile as p };
@@ -0,0 +1,223 @@
1
+ /**
2
+ * A complete GPS CNAV ephemeris + clock data set assembled from one
3
+ * MT10, one MT11 and one MT3x message (IS-GPS-200 §30.3.3.1: the three
4
+ * message types together carry the CEI data set; toe/toc equality
5
+ * marks messages of the same set).
6
+ *
7
+ * Units are SI/radians: semicircle fields are scaled by GPS_PI, the
8
+ * MT10 ΔA reference (26 559 710 m) and the MT11 Ω̇ reference
9
+ * (−2.6×10⁻⁹ semicircles/s) are folded into `a` and `omegaDot`, with
10
+ * the raw deltas also kept. Epoch Dates are GPS-scale (repo
11
+ * convention: GPS seconds mapped onto the JS epoch without leap
12
+ * seconds), and `toe`/`toc` are seconds of `week`/`weekToc`.
13
+ */
14
+ interface CnavEphemeris {
15
+ system: 'G';
16
+ /** RINEX PRN, e.g. "G07". */
17
+ prn: string;
18
+ /** Full GPS week from the MT10 WN field (13 bits, no rollover). */
19
+ week: number;
20
+ /** L1/L2/L5 signal-health bits from MT10 (bit 2 = L1, 0 = L5). */
21
+ health: number;
22
+ /** Elevation-dependent (ED) URA index, signed (MT10). */
23
+ uraEd: number;
24
+ /** Non-elevation-dependent URA indices: bias/drift/drift-rate (MT3x). */
25
+ uraNed0: number;
26
+ uraNed1: number;
27
+ uraNed2: number;
28
+ /** Data-predict time of week in s (MT10). */
29
+ top: number;
30
+ /** Time of ephemeris in seconds of the GPS week of `toeDate`. */
31
+ toe: number;
32
+ /** Time of ephemeris as a GPS-scale Date. */
33
+ toeDate: Date;
34
+ /** Semi-major axis at toe in m (reference + ΔA). */
35
+ a: number;
36
+ /** MT10 ΔA: semi-major axis difference from 26 559 710 m, in m. */
37
+ deltaA: number;
38
+ /** Rate of semi-major axis in m/s. */
39
+ aDot: number;
40
+ /** Mean motion difference from computed value in rad/s. */
41
+ deltaN0: number;
42
+ /** Rate of the mean motion difference in rad/s². */
43
+ deltaN0Dot: number;
44
+ /** Mean anomaly at reference time in rad. */
45
+ m0: number;
46
+ /** Eccentricity (dimensionless). */
47
+ e: number;
48
+ /** Argument of perigee in rad. */
49
+ omega: number;
50
+ /** Longitude of ascending node at the weekly epoch in rad. */
51
+ omega0: number;
52
+ /** Inclination at reference time in rad. */
53
+ i0: number;
54
+ /** Rate of right ascension in rad/s (reference Ω̇ + ΔΩ̇). */
55
+ omegaDot: number;
56
+ /** MT11 ΔΩ̇: delta from −2.6×10⁻⁹ semicircles/s, in rad/s. */
57
+ deltaOmegaDot: number;
58
+ /** Rate of inclination in rad/s. */
59
+ i0Dot: number;
60
+ /** Harmonic correction terms (rad / m). */
61
+ cis: number;
62
+ cic: number;
63
+ crs: number;
64
+ crc: number;
65
+ cus: number;
66
+ cuc: number;
67
+ /** Clock epoch in seconds of the GPS week of `tocDate`. */
68
+ toc: number;
69
+ /** Clock epoch as a GPS-scale Date. */
70
+ tocDate: Date;
71
+ /** SV clock bias (s), drift (s/s), drift rate (s/s²). */
72
+ af0: number;
73
+ af1: number;
74
+ af2: number;
75
+ /** Message type (30-37) that supplied the clock block. */
76
+ clockMsgType: number;
77
+ /** L1 C/A group delay in s (MT30), null when unavailable/not seen. */
78
+ tgd: number | null;
79
+ /** Inter-signal corrections in s (MT30), null when unavailable. */
80
+ iscL1ca: number | null;
81
+ iscL2c: number | null;
82
+ iscL5i5: number | null;
83
+ iscL5q5: number | null;
84
+ /** Klobuchar iono coefficients from MT30, when one was seen. */
85
+ ionoAlpha?: number[];
86
+ ionoBeta?: number[];
87
+ /** Data-predict week from MT30 (WN_OP, 8 bits, unresolved). */
88
+ wnOp?: number;
89
+ /** Integrity-status and L2C-phasing flags from MT10. */
90
+ integrityFlag: boolean;
91
+ l2cPhasing: boolean;
92
+ /** Transmit time of the MT10 message (s of week, start of next msg). */
93
+ tow: number;
94
+ }
95
+
96
+ /**
97
+ * RINEX 3.x/4.x navigation file parser.
98
+ * Parses GPS, Galileo, BeiDou (Keplerian), and GLONASS (state vector)
99
+ * ephemerides, plus GPS/QZSS CNAV records from RINEX 4 files.
100
+ */
101
+
102
+ interface NavHeader {
103
+ version: number;
104
+ type: string;
105
+ leapSeconds: number | null;
106
+ ionoCorrections: Record<string, number[]>;
107
+ }
108
+ /** GPS / Galileo / BeiDou / QZSS / NavIC Keplerian ephemeris. */
109
+ interface KeplerEphemeris {
110
+ system: 'G' | 'E' | 'C' | 'J' | 'I';
111
+ /** Satellite PRN, e.g. "G14". */
112
+ prn: string;
113
+ /** Epoch of clock in seconds of GPS week. */
114
+ toc: number;
115
+ /** Epoch of clock as a Date. */
116
+ tocDate: Date;
117
+ /** SV clock bias in seconds. */
118
+ af0: number;
119
+ /** SV clock drift in s/s. */
120
+ af1: number;
121
+ /** SV clock drift rate in s/s². */
122
+ af2: number;
123
+ /** Issue of data (ephemeris). */
124
+ iode: number;
125
+ /** Amplitude of sine correction to orbit radius in meters. */
126
+ crs: number;
127
+ /** Mean motion difference in rad/s. */
128
+ deltaN: number;
129
+ /** Mean anomaly at reference time in radians. */
130
+ m0: number;
131
+ /** Amplitude of cosine correction to argument of latitude in radians. */
132
+ cuc: number;
133
+ /** Eccentricity (dimensionless). */
134
+ e: number;
135
+ /** Amplitude of sine correction to argument of latitude in radians. */
136
+ cus: number;
137
+ /** Square root of semi-major axis in m^(1/2). */
138
+ sqrtA: number;
139
+ /** Time of ephemeris in seconds of GPS week. */
140
+ toe: number;
141
+ /** Amplitude of cosine correction to inclination in radians. */
142
+ cic: number;
143
+ /** Right ascension of ascending node at reference time in radians. */
144
+ omega0: number;
145
+ /** Amplitude of sine correction to inclination in radians. */
146
+ cis: number;
147
+ /** Inclination at reference time in radians. */
148
+ i0: number;
149
+ /** Amplitude of cosine correction to orbit radius in meters. */
150
+ crc: number;
151
+ /** Argument of perigee in radians. */
152
+ omega: number;
153
+ /** Rate of right ascension in rad/s. */
154
+ omegaDot: number;
155
+ /** Rate of inclination in rad/s. */
156
+ idot: number;
157
+ /** GPS week number. */
158
+ week: number;
159
+ /** SV health flag. */
160
+ svHealth: number;
161
+ /** Total group delay in seconds. */
162
+ tgd: number;
163
+ }
164
+ /** GLONASS / SBAS state-vector ephemeris. Positions in km, velocities in km/s, accelerations in km/s². */
165
+ interface GlonassEphemeris {
166
+ system: 'R' | 'S';
167
+ prn: string;
168
+ tocDate: Date;
169
+ /** Clock bias (seconds). */
170
+ tauN: number;
171
+ /** Relative frequency bias (dimensionless). */
172
+ gammaN: number;
173
+ /** Message frame time (seconds of UTC day). */
174
+ messageFrameTime: number;
175
+ /** X position in km (PZ-90). */
176
+ x: number;
177
+ /** X velocity in km/s. */
178
+ xDot: number;
179
+ /** X acceleration in km/s² (luni-solar). */
180
+ xAcc: number;
181
+ /** Y position in km (PZ-90). */
182
+ y: number;
183
+ /** Y velocity in km/s. */
184
+ yDot: number;
185
+ /** Y acceleration in km/s² (luni-solar). */
186
+ yAcc: number;
187
+ /** Z position in km (PZ-90). */
188
+ z: number;
189
+ /** Z velocity in km/s. */
190
+ zDot: number;
191
+ /** Z acceleration in km/s² (luni-solar). */
192
+ zAcc: number;
193
+ /** Health flag (0 = healthy). */
194
+ health: number;
195
+ /** GLONASS frequency channel number (-7 to +6). */
196
+ freqNum: number;
197
+ }
198
+ type Ephemeris = KeplerEphemeris | GlonassEphemeris;
199
+ /**
200
+ * A GPS or QZSS CNAV ephemeris read from a RINEX 4 `> EPH ... CNAV`
201
+ * record (RINEX 4.01 Tables A10/A18). Same shape as the
202
+ * `CnavEphemeris` assembled from raw navigation bits, except that
203
+ * QZSS records are allowed.
204
+ *
205
+ * Fields the RINEX record does not carry are defaulted: `clockMsgType`
206
+ * is 0 (the record does not say which MT3x supplied the clock), and
207
+ * `integrityFlag`/`l2cPhasing` are false. `tow` holds the record's
208
+ * transmission time of message (t_tm) and `wnOp` the ambiguity-resolved
209
+ * data-predict week from the file. `toe` equals `toc` (RINEX 4.01
210
+ * Table A10 note 2: per IS-GPS-705 20.3.4.4 only Toc is provided).
211
+ */
212
+ type RinexCnavEphemeris = Omit<CnavEphemeris, 'system'> & {
213
+ system: 'G' | 'J';
214
+ };
215
+ interface NavResult {
216
+ header: NavHeader;
217
+ ephemerides: Ephemeris[];
218
+ /** GPS/QZSS CNAV ephemerides (RINEX 4 only), present when any were read. */
219
+ cnav?: RinexCnavEphemeris[];
220
+ }
221
+ declare function parseNavFile(text: string): NavResult;
222
+
223
+ export { type CnavEphemeris as C, type Ephemeris as E, type GlonassEphemeris as G, type KeplerEphemeris as K, type NavHeader as N, type RinexCnavEphemeris as R, type NavResult as a, parseNavFile as p };
package/dist/novatel.cjs CHANGED
@@ -295,6 +295,7 @@ var ID_RAWEPHEM = 41;
295
295
  var ID_GLOEPHEMERIS = 723;
296
296
  var ID_GALEPHEMERIS = 1122;
297
297
  var ID_QZSSEPHEMERIS = 1336;
298
+ var ID_GPSEPHEM = 7;
298
299
  var ID_BDSEPHEMERIS = 1696;
299
300
  var GPS_EPOCH_MS2 = Date.UTC(1980, 0, 6);
300
301
  var BDT_EPOCH_MS = Date.UTC(2006, 0, 1);
@@ -449,9 +450,10 @@ function decodeBdsEphemeris(view, p) {
449
450
  // TGD1 (B1) — RINEX slot
450
451
  };
451
452
  }
452
- function decodeQzssEphemeris(view, p) {
453
+ function decodeGpsQzssEphemeris(view, p, sys) {
453
454
  const prn = view.getUint32(p, true);
454
- if (prn < 193 || prn > 202) return null;
455
+ if (sys === "G" && (prn < 1 || prn > 32)) return null;
456
+ if (sys === "J" && (prn < 193 || prn > 202)) return null;
455
457
  const health = view.getUint32(p + 12, true) & 63;
456
458
  const iode1 = view.getUint32(p + 16, true);
457
459
  const week = view.getUint32(p + 24, true);
@@ -460,8 +462,8 @@ function decodeQzssEphemeris(view, p) {
460
462
  const tocs = view.getFloat64(p + 164, true);
461
463
  const tocDate = new Date(nearWeekMs(toeMs, tocs));
462
464
  return {
463
- system: "J",
464
- prn: `J${String(prn - 192).padStart(2, "0")}`,
465
+ system: sys,
466
+ prn: `${sys}${String(sys === "J" ? prn - 192 : prn).padStart(2, "0")}`,
465
467
  toc: sowOf(tocDate.getTime()),
466
468
  tocDate,
467
469
  af0: view.getFloat64(p + 180, true),
@@ -519,8 +521,11 @@ function parseNovatelNav(data) {
519
521
  } else if (frame.id === ID_BDSEPHEMERIS && frame.msgLen >= 196) {
520
522
  const eph = decodeBdsEphemeris(view, frame.payload);
521
523
  if (eph) pushKepler(eph.prn, eph);
524
+ } else if (frame.id === ID_GPSEPHEM && frame.msgLen >= 204) {
525
+ const eph = decodeGpsQzssEphemeris(view, frame.payload, "G");
526
+ if (eph) pushKepler(eph.prn, eph);
522
527
  } else if (frame.id === ID_QZSSEPHEMERIS && frame.msgLen >= 204) {
523
- const eph = decodeQzssEphemeris(view, frame.payload);
528
+ const eph = decodeGpsQzssEphemeris(view, frame.payload, "J");
524
529
  if (eph) pushKepler(eph.prn, eph);
525
530
  } else if (frame.id === ID_IONUTC && frame.msgLen >= 108) {
526
531
  const p = frame.payload;
@@ -1,4 +1,4 @@
1
- import { E as Ephemeris } from './nav-BAI1a9vK.cjs';
1
+ import { E as Ephemeris } from './nav-DImXUdbp.cjs';
2
2
 
3
3
  /**
4
4
  * NovAtel OEM4/6/7 binary framing shared by the measurement and
package/dist/novatel.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as Ephemeris } from './nav-BAI1a9vK.js';
1
+ import { E as Ephemeris } from './nav-DImXUdbp.js';
2
2
 
3
3
  /**
4
4
  * NovAtel OEM4/6/7 binary framing shared by the measurement and
package/dist/novatel.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  oem4Frames,
5
5
  parseNovatelNav,
6
6
  parseNovatelRange
7
- } from "./chunk-7QR2KPDU.js";
8
- import "./chunk-REYOYF7O.js";
7
+ } from "./chunk-2IM5VXNI.js";
8
+ import "./chunk-IQ5OIMQD.js";
9
9
  import "./chunk-HVXYFUCB.js";
10
10
  import "./chunk-LEEU5OIO.js";
11
11
  export {
package/dist/orbit.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris } from './nav-BAI1a9vK.cjs';
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
4
 
package/dist/orbit.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris } from './nav-BAI1a9vK.js';
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
4
 
@@ -1,4 +1,4 @@
1
- import { E as Ephemeris } from './nav-BAI1a9vK.cjs';
1
+ 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';