gnss-js 1.18.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,9 +4,9 @@ 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
12
  export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames } from './ubx.cjs';
@@ -20,4 +20,3 @@ export { CompleteSatSignal, CompleteSignalStats, CompletenessAccumulator, Comple
20
20
  export { AntennaEntry, AntexFile, FrequencyData, frequencyLabel, parseAntex } from './antex.cjs';
21
21
  export { NmeaFix, NmeaStats, NmeaTrack, computeStats, nmeaCoordToDecimal, parseNmeaFile, verifyChecksum } from './nmea.cjs';
22
22
  export { BAND_PRESETS, BandPreset, CONSTELLATIONS, ConstellationRow, DELTA_GLO_L1, DELTA_GLO_L2, FREQ_BDS_B1A, FREQ_BDS_B1C, FREQ_BDS_B1I, FREQ_BDS_B2I, FREQ_BDS_B3A, FREQ_BDS_B3I, FREQ_GAL_E1, FREQ_GAL_E5, FREQ_GAL_E5a, FREQ_GAL_E5b, FREQ_GAL_E6, FREQ_GLO_L1, FREQ_GLO_L1OC, FREQ_GLO_L2, FREQ_GLO_L2OC, FREQ_GLO_L3OC, FREQ_GPS_L1, FREQ_GPS_L2, FREQ_GPS_L5, FREQ_NAVIC_L5, FREQ_QZS_L1, FREQ_QZS_L2, FREQ_QZS_L5, FREQ_QZS_L6, Modulation, SignalDef, computePsdDb, phiAltBOC, phiBOCc, phiBOCs, phiBPSK } from './signals.cjs';
23
- export { C as CnavEphemeris } from './cnav-CRns0ECn.cjs';
package/dist/index.d.ts CHANGED
@@ -4,9 +4,9 @@ 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
12
  export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames } from './ubx.js';
@@ -20,4 +20,3 @@ export { CompleteSatSignal, CompleteSignalStats, CompletenessAccumulator, Comple
20
20
  export { AntennaEntry, AntexFile, FrequencyData, frequencyLabel, parseAntex } from './antex.js';
21
21
  export { NmeaFix, NmeaStats, NmeaTrack, computeStats, nmeaCoordToDecimal, parseNmeaFile, verifyChecksum } from './nmea.js';
22
22
  export { BAND_PRESETS, BandPreset, CONSTELLATIONS, ConstellationRow, DELTA_GLO_L1, DELTA_GLO_L2, FREQ_BDS_B1A, FREQ_BDS_B1C, FREQ_BDS_B1I, FREQ_BDS_B2I, FREQ_BDS_B3A, FREQ_BDS_B3I, FREQ_GAL_E1, FREQ_GAL_E5, FREQ_GAL_E5a, FREQ_GAL_E5b, FREQ_GAL_E6, FREQ_GLO_L1, FREQ_GLO_L1OC, FREQ_GLO_L2, FREQ_GLO_L2OC, FREQ_GLO_L3OC, FREQ_GPS_L1, FREQ_GPS_L2, FREQ_GPS_L5, FREQ_NAVIC_L5, FREQ_QZS_L1, FREQ_QZS_L2, FREQ_QZS_L5, FREQ_QZS_L6, Modulation, SignalDef, computePsdDb, phiAltBOC, phiBOCc, phiBOCs, phiBPSK } from './signals.js';
23
- export { C as CnavEphemeris } from './cnav-CRns0ECn.js';
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  parseUbxNav,
40
40
  parseUbxRawx,
41
41
  ubxFrames
42
- } from "./chunk-FEGLXNWA.js";
42
+ } from "./chunk-JW2ICDR7.js";
43
43
  import {
44
44
  crc16,
45
45
  parseSbfAlmanac,
@@ -48,8 +48,7 @@ import {
48
48
  parseSbfMeas,
49
49
  parseSbfNav,
50
50
  scanSbfFrames
51
- } from "./chunk-CG7SF45F.js";
52
- import "./chunk-Y5IWUPJQ.js";
51
+ } from "./chunk-5S5HMAKW.js";
53
52
  import {
54
53
  OEM4_HLEN,
55
54
  crc32,
@@ -57,7 +56,6 @@ import {
57
56
  parseNovatelNav,
58
57
  parseNovatelRange
59
58
  } from "./chunk-2IM5VXNI.js";
60
- import "./chunk-IQ5OIMQD.js";
61
59
  import {
62
60
  connectToMountpoint,
63
61
  fetchSourcetable,
@@ -164,6 +162,7 @@ import {
164
162
  EMPTY_WARNINGS,
165
163
  WarningAccumulator,
166
164
  createGzipLineSink,
165
+ fmtD,
167
166
  fmtF,
168
167
  hdrLine,
169
168
  padL,
@@ -177,8 +176,11 @@ import {
177
176
  writeRinex2ObsBlob,
178
177
  writeRinex4ObsBlob,
179
178
  writeRinexNav,
179
+ writeRinexNav4,
180
180
  writeRinexObsBlob
181
- } from "./chunk-HXF7XVW7.js";
181
+ } from "./chunk-K73SERD5.js";
182
+ import "./chunk-6NCMACDO.js";
183
+ import "./chunk-IQ5OIMQD.js";
182
184
  import {
183
185
  SYSTEM_ORDER,
184
186
  crxDecompress,
@@ -408,6 +410,7 @@ export {
408
410
  ephInfoToEphemeris,
409
411
  euclidean3D,
410
412
  fetchSourcetable,
413
+ fmtD,
411
414
  fmtF,
412
415
  formatUTCTime,
413
416
  frequencyLabel,
@@ -535,5 +538,6 @@ export {
535
538
  writeRinex2ObsBlob,
536
539
  writeRinex4ObsBlob,
537
540
  writeRinexNav,
541
+ writeRinexNav4,
538
542
  writeRinexObsBlob
539
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 };
@@ -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/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';
@@ -1,4 +1,4 @@
1
- import { E as Ephemeris } from './nav-BAI1a9vK.js';
1
+ 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';