gnss-js 0.1.2 → 1.0.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/LICENSE +23 -0
- package/README.md +171 -5
- package/dist/analysis.cjs +1488 -0
- package/dist/analysis.d.cts +211 -0
- package/dist/analysis.d.ts +211 -0
- package/dist/analysis.js +14 -0
- package/dist/antex.cjs +239 -0
- package/dist/antex.d.cts +77 -0
- package/dist/antex.d.ts +77 -0
- package/dist/antex.js +8 -0
- package/dist/chunk-37QNKGTC.js +65 -0
- package/dist/chunk-4YN353Q7.js +440 -0
- package/dist/chunk-5CMSYIYM.js +214 -0
- package/dist/chunk-5S5MONFK.js +0 -0
- package/dist/chunk-6FAL6P4G.js +12 -0
- package/dist/chunk-7NOFXKET.js +433 -0
- package/dist/chunk-BJHTBYNG.js +154 -0
- package/dist/chunk-HBLU2EJ4.js +802 -0
- package/dist/chunk-HKN3PUGN.js +800 -0
- package/dist/chunk-LEEU5OIO.js +75 -0
- package/dist/chunk-LWNTWBHB.js +268 -0
- package/dist/chunk-MIIM4LDY.js +239 -0
- package/dist/chunk-SO3POWWR.js +502 -0
- package/dist/chunk-W4YMQKWH.js +622 -0
- package/dist/chunk-WP2JFDLA.js +1475 -0
- package/dist/chunk-YDMYO3YK.js +220 -0
- package/dist/constants.cjs +423 -0
- package/dist/constants.d.cts +14 -0
- package/dist/constants.d.ts +14 -0
- package/dist/constants.js +103 -0
- package/dist/coordinates.cjs +337 -0
- package/dist/coordinates.d.cts +81 -0
- package/dist/coordinates.d.ts +81 -0
- package/dist/coordinates.js +39 -0
- package/dist/ecef-CF0uAysr.d.cts +40 -0
- package/dist/ecef-CF0uAysr.d.ts +40 -0
- package/dist/ephemeris-C10stHhM.d.cts +114 -0
- package/dist/ephemeris-C10stHhM.d.ts +114 -0
- package/dist/gnss-BT6ulR17.d.cts +56 -0
- package/dist/gnss-C-tgoYNa.d.ts +56 -0
- package/dist/index.cjs +5940 -78
- package/dist/index.d.cts +17 -96
- package/dist/index.d.ts +17 -96
- package/dist/index.js +352 -415
- package/dist/nav-BAI1a9vK.d.cts +108 -0
- package/dist/nav-BAI1a9vK.d.ts +108 -0
- package/dist/nmea.cjs +247 -0
- package/dist/nmea.d.cts +37 -0
- package/dist/nmea.d.ts +37 -0
- package/dist/nmea.js +12 -0
- package/dist/ntrip.cjs +180 -0
- package/dist/ntrip.d.cts +98 -0
- package/dist/ntrip.d.ts +98 -0
- package/dist/ntrip.js +10 -0
- package/dist/orbit.cjs +511 -0
- package/dist/orbit.d.cts +117 -0
- package/dist/orbit.d.ts +117 -0
- package/dist/orbit.js +29 -0
- package/dist/parser-JPjjFgeP.d.cts +73 -0
- package/dist/parser-JPjjFgeP.d.ts +73 -0
- package/dist/rinex.cjs +1469 -0
- package/dist/rinex.d.cts +116 -0
- package/dist/rinex.d.ts +116 -0
- package/dist/rinex.js +37 -0
- package/dist/rtcm3.cjs +1512 -0
- package/dist/rtcm3.d.cts +143 -0
- package/dist/rtcm3.d.ts +143 -0
- package/dist/rtcm3.js +31 -0
- package/dist/signals.cjs +858 -0
- package/dist/signals.d.cts +93 -0
- package/dist/signals.d.ts +93 -0
- package/dist/signals.js +70 -0
- package/dist/time-DnI1VpE8.d.cts +33 -0
- package/dist/time-DnI1VpE8.d.ts +33 -0
- package/dist/time.cjs +585 -0
- package/dist/time.d.cts +307 -0
- package/dist/time.d.ts +307 -0
- package/dist/time.js +154 -0
- package/package.json +112 -14
- package/.prettierrc +0 -5
- package/jest.config.ts +0 -9
- package/test/functions.test.ts +0 -63
- package/test/gnss-scales.test.ts +0 -95
- package/test/julian.test.ts +0 -145
- package/test/rinex.test.ts +0 -11
- package/test/test.ts +0 -10
- package/test/utc.test.ts +0 -25
package/dist/rinex.d.cts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { R as RinexHeader } from './parser-JPjjFgeP.cjs';
|
|
2
|
+
export { E as EpochSummary, P as ParseOptions, 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';
|
|
3
|
+
import { a as NavResult } from './nav-BAI1a9vK.cjs';
|
|
4
|
+
export { E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris, N as NavHeader, p as parseNavFile } from './nav-BAI1a9vK.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Compact RINEX (Hatanaka / CRX) decompression utilities.
|
|
8
|
+
* Extracted from rinex.ts for separation of concerns.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Per-observation Hatanaka state.
|
|
12
|
+
* accum[0] = reconstructed value, accum[k] = kth-order accumulator.
|
|
13
|
+
*/
|
|
14
|
+
interface DiffState {
|
|
15
|
+
accum: number[];
|
|
16
|
+
order: number;
|
|
17
|
+
arcOrder: number;
|
|
18
|
+
}
|
|
19
|
+
interface CrxField {
|
|
20
|
+
empty: boolean;
|
|
21
|
+
init: boolean;
|
|
22
|
+
arcOrder: number;
|
|
23
|
+
value: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Text-differencing repair function (matches crx2rnx repair()).
|
|
27
|
+
* Applies diff to old string in-place semantics:
|
|
28
|
+
* space = no change, '&' = replace with space, other = replace with char.
|
|
29
|
+
*/
|
|
30
|
+
declare function crxRepair(old: string, diff: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Parse a CRX satellite data line into ntype fields + trailing flag string.
|
|
33
|
+
* Mimics getdiff() from crx2rnx.c: each space is a field separator,
|
|
34
|
+
* so consecutive spaces produce empty (missing) fields.
|
|
35
|
+
*/
|
|
36
|
+
declare function parseCrxDataLine(line: string, ntype: number): {
|
|
37
|
+
fields: CrxField[];
|
|
38
|
+
flagStr: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Apply Hatanaka decompression for one observation.
|
|
42
|
+
* On init: set accum[0] = value, order = 0.
|
|
43
|
+
* On continue: ramp up order toward arcOrder, store diff at current order,
|
|
44
|
+
* then cascade accum[k-1] += accum[k] for k = order down to 1.
|
|
45
|
+
*/
|
|
46
|
+
declare function crxDecompress(prev: DiffState | null, field: CrxField): {
|
|
47
|
+
state: DiffState;
|
|
48
|
+
result: number;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Shared RINEX formatting helpers.
|
|
53
|
+
*
|
|
54
|
+
* Used by any module that needs to produce RINEX-formatted text
|
|
55
|
+
* (observation writers, navigation writers, etc.).
|
|
56
|
+
*/
|
|
57
|
+
/** Pad/truncate string to exact width, left-aligned. */
|
|
58
|
+
declare function padL(s: string, w: number): string;
|
|
59
|
+
/** Pad/truncate string to exact width, right-aligned. */
|
|
60
|
+
declare function padR(s: string, w: number): string;
|
|
61
|
+
/** Format a float with given width and decimals, right-aligned. */
|
|
62
|
+
declare function fmtF(val: number, width: number, dec: number): string;
|
|
63
|
+
/** RINEX header line: content (60 chars) + label (20 chars). */
|
|
64
|
+
declare function hdrLine(content: string, label: string): string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* RINEX file validation — lightweight warning accumulator.
|
|
68
|
+
*
|
|
69
|
+
* Designed to run during parsing with minimal overhead.
|
|
70
|
+
* Collects header issues, duplicate epochs, time gaps, etc.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
type WarningSeverity = 'info' | 'warning' | 'error';
|
|
74
|
+
interface RinexWarning {
|
|
75
|
+
code: string;
|
|
76
|
+
severity: WarningSeverity;
|
|
77
|
+
message: string;
|
|
78
|
+
count: number;
|
|
79
|
+
examples?: string[];
|
|
80
|
+
}
|
|
81
|
+
interface RinexWarnings {
|
|
82
|
+
items: RinexWarning[];
|
|
83
|
+
errorCount: number;
|
|
84
|
+
warningCount: number;
|
|
85
|
+
infoCount: number;
|
|
86
|
+
}
|
|
87
|
+
declare const EMPTY_WARNINGS: RinexWarnings;
|
|
88
|
+
declare class WarningAccumulator {
|
|
89
|
+
private items;
|
|
90
|
+
private prevEpochTime;
|
|
91
|
+
private epochTimes;
|
|
92
|
+
private intervalMs;
|
|
93
|
+
private flagCounts;
|
|
94
|
+
private seenPrns;
|
|
95
|
+
checkHeader(header: RinexHeader): void;
|
|
96
|
+
setInterval(intervalMs: number): void;
|
|
97
|
+
onEpoch(time: number, flag: number): void;
|
|
98
|
+
onPrn(prn: string): void;
|
|
99
|
+
finalize(): RinexWarnings;
|
|
100
|
+
private add;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* RINEX 3.04 mixed navigation file writer.
|
|
105
|
+
*
|
|
106
|
+
* Produces a standards-compliant RINEX 3.04 nav file from parsed NavResult data.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Write a RINEX 3.04 mixed navigation file from parsed navigation data.
|
|
111
|
+
*
|
|
112
|
+
* Ephemerides are sorted by PRN then by tocDate.
|
|
113
|
+
*/
|
|
114
|
+
declare function writeRinexNav(nav: NavResult): string;
|
|
115
|
+
|
|
116
|
+
export { type CrxField, type DiffState, EMPTY_WARNINGS, NavResult, RinexHeader, type RinexWarning, type RinexWarnings, WarningAccumulator, type WarningSeverity, crxDecompress, crxRepair, fmtF, hdrLine, padL, padR, parseCrxDataLine, writeRinexNav };
|
package/dist/rinex.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { R as RinexHeader } from './parser-JPjjFgeP.js';
|
|
2
|
+
export { E as EpochSummary, P as ParseOptions, 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';
|
|
3
|
+
import { a as NavResult } from './nav-BAI1a9vK.js';
|
|
4
|
+
export { E as Ephemeris, G as GlonassEphemeris, K as KeplerEphemeris, N as NavHeader, p as parseNavFile } from './nav-BAI1a9vK.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Compact RINEX (Hatanaka / CRX) decompression utilities.
|
|
8
|
+
* Extracted from rinex.ts for separation of concerns.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Per-observation Hatanaka state.
|
|
12
|
+
* accum[0] = reconstructed value, accum[k] = kth-order accumulator.
|
|
13
|
+
*/
|
|
14
|
+
interface DiffState {
|
|
15
|
+
accum: number[];
|
|
16
|
+
order: number;
|
|
17
|
+
arcOrder: number;
|
|
18
|
+
}
|
|
19
|
+
interface CrxField {
|
|
20
|
+
empty: boolean;
|
|
21
|
+
init: boolean;
|
|
22
|
+
arcOrder: number;
|
|
23
|
+
value: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Text-differencing repair function (matches crx2rnx repair()).
|
|
27
|
+
* Applies diff to old string in-place semantics:
|
|
28
|
+
* space = no change, '&' = replace with space, other = replace with char.
|
|
29
|
+
*/
|
|
30
|
+
declare function crxRepair(old: string, diff: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Parse a CRX satellite data line into ntype fields + trailing flag string.
|
|
33
|
+
* Mimics getdiff() from crx2rnx.c: each space is a field separator,
|
|
34
|
+
* so consecutive spaces produce empty (missing) fields.
|
|
35
|
+
*/
|
|
36
|
+
declare function parseCrxDataLine(line: string, ntype: number): {
|
|
37
|
+
fields: CrxField[];
|
|
38
|
+
flagStr: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Apply Hatanaka decompression for one observation.
|
|
42
|
+
* On init: set accum[0] = value, order = 0.
|
|
43
|
+
* On continue: ramp up order toward arcOrder, store diff at current order,
|
|
44
|
+
* then cascade accum[k-1] += accum[k] for k = order down to 1.
|
|
45
|
+
*/
|
|
46
|
+
declare function crxDecompress(prev: DiffState | null, field: CrxField): {
|
|
47
|
+
state: DiffState;
|
|
48
|
+
result: number;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Shared RINEX formatting helpers.
|
|
53
|
+
*
|
|
54
|
+
* Used by any module that needs to produce RINEX-formatted text
|
|
55
|
+
* (observation writers, navigation writers, etc.).
|
|
56
|
+
*/
|
|
57
|
+
/** Pad/truncate string to exact width, left-aligned. */
|
|
58
|
+
declare function padL(s: string, w: number): string;
|
|
59
|
+
/** Pad/truncate string to exact width, right-aligned. */
|
|
60
|
+
declare function padR(s: string, w: number): string;
|
|
61
|
+
/** Format a float with given width and decimals, right-aligned. */
|
|
62
|
+
declare function fmtF(val: number, width: number, dec: number): string;
|
|
63
|
+
/** RINEX header line: content (60 chars) + label (20 chars). */
|
|
64
|
+
declare function hdrLine(content: string, label: string): string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* RINEX file validation — lightweight warning accumulator.
|
|
68
|
+
*
|
|
69
|
+
* Designed to run during parsing with minimal overhead.
|
|
70
|
+
* Collects header issues, duplicate epochs, time gaps, etc.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
type WarningSeverity = 'info' | 'warning' | 'error';
|
|
74
|
+
interface RinexWarning {
|
|
75
|
+
code: string;
|
|
76
|
+
severity: WarningSeverity;
|
|
77
|
+
message: string;
|
|
78
|
+
count: number;
|
|
79
|
+
examples?: string[];
|
|
80
|
+
}
|
|
81
|
+
interface RinexWarnings {
|
|
82
|
+
items: RinexWarning[];
|
|
83
|
+
errorCount: number;
|
|
84
|
+
warningCount: number;
|
|
85
|
+
infoCount: number;
|
|
86
|
+
}
|
|
87
|
+
declare const EMPTY_WARNINGS: RinexWarnings;
|
|
88
|
+
declare class WarningAccumulator {
|
|
89
|
+
private items;
|
|
90
|
+
private prevEpochTime;
|
|
91
|
+
private epochTimes;
|
|
92
|
+
private intervalMs;
|
|
93
|
+
private flagCounts;
|
|
94
|
+
private seenPrns;
|
|
95
|
+
checkHeader(header: RinexHeader): void;
|
|
96
|
+
setInterval(intervalMs: number): void;
|
|
97
|
+
onEpoch(time: number, flag: number): void;
|
|
98
|
+
onPrn(prn: string): void;
|
|
99
|
+
finalize(): RinexWarnings;
|
|
100
|
+
private add;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* RINEX 3.04 mixed navigation file writer.
|
|
105
|
+
*
|
|
106
|
+
* Produces a standards-compliant RINEX 3.04 nav file from parsed NavResult data.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Write a RINEX 3.04 mixed navigation file from parsed navigation data.
|
|
111
|
+
*
|
|
112
|
+
* Ephemerides are sorted by PRN then by tocDate.
|
|
113
|
+
*/
|
|
114
|
+
declare function writeRinexNav(nav: NavResult): string;
|
|
115
|
+
|
|
116
|
+
export { type CrxField, type DiffState, EMPTY_WARNINGS, NavResult, RinexHeader, type RinexWarning, type RinexWarnings, WarningAccumulator, type WarningSeverity, crxDecompress, crxRepair, fmtF, hdrLine, padL, padR, parseCrxDataLine, writeRinexNav };
|
package/dist/rinex.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EMPTY_WARNINGS,
|
|
3
|
+
WarningAccumulator,
|
|
4
|
+
fmtF,
|
|
5
|
+
hdrLine,
|
|
6
|
+
padL,
|
|
7
|
+
padR,
|
|
8
|
+
parseNavFile,
|
|
9
|
+
writeRinexNav
|
|
10
|
+
} from "./chunk-W4YMQKWH.js";
|
|
11
|
+
import {
|
|
12
|
+
SYSTEM_ORDER,
|
|
13
|
+
crxDecompress,
|
|
14
|
+
crxRepair,
|
|
15
|
+
parseCrxDataLine,
|
|
16
|
+
parseRinexStream,
|
|
17
|
+
systemCmp,
|
|
18
|
+
systemName
|
|
19
|
+
} from "./chunk-HBLU2EJ4.js";
|
|
20
|
+
import "./chunk-LWNTWBHB.js";
|
|
21
|
+
export {
|
|
22
|
+
EMPTY_WARNINGS,
|
|
23
|
+
SYSTEM_ORDER,
|
|
24
|
+
WarningAccumulator,
|
|
25
|
+
crxDecompress,
|
|
26
|
+
crxRepair,
|
|
27
|
+
fmtF,
|
|
28
|
+
hdrLine,
|
|
29
|
+
padL,
|
|
30
|
+
padR,
|
|
31
|
+
parseCrxDataLine,
|
|
32
|
+
parseNavFile,
|
|
33
|
+
parseRinexStream,
|
|
34
|
+
systemCmp,
|
|
35
|
+
systemName,
|
|
36
|
+
writeRinexNav
|
|
37
|
+
};
|