@neilberkman/sidereon 0.8.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/LICENSE +21 -0
- package/README.md +105 -0
- package/package.json +32 -0
- package/pkg/sidereon.d.ts +4724 -0
- package/pkg/sidereon.js +10807 -0
- package/pkg/sidereon_bg.wasm +0 -0
- package/pkg/sidereon_bg.wasm.d.ts +761 -0
- package/pkg-node/sidereon.d.ts +3938 -0
- package/pkg-node/sidereon.js +10919 -0
- package/pkg-node/sidereon_bg.wasm +0 -0
- package/pkg-node/sidereon_bg.wasm.d.ts +761 -0
- package/types/sidereon-extra.d.ts +896 -0
|
@@ -0,0 +1,896 @@
|
|
|
1
|
+
// Hand-written companion types for the shapes wasm-bindgen exposes as `any`.
|
|
2
|
+
//
|
|
3
|
+
// `Sp3.solveSpp(request)` takes a plain object; wasm-bindgen types its argument
|
|
4
|
+
// as `any` because it deserializes through serde. This is the precise shape it
|
|
5
|
+
// accepts. Import it alongside the generated types:
|
|
6
|
+
//
|
|
7
|
+
// import { loadSp3 } from "@neilberkman/sidereon";
|
|
8
|
+
// import type { SppRequest } from "@neilberkman/sidereon/types";
|
|
9
|
+
|
|
10
|
+
/** One pseudorange observation for an SPP solve. */
|
|
11
|
+
export interface SppObservation {
|
|
12
|
+
/** RINEX/IGS satellite token, e.g. "G01", "E12", "C08". */
|
|
13
|
+
satelliteId: string;
|
|
14
|
+
/** Pseudorange in metres. */
|
|
15
|
+
pseudorangeM: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Which atmospheric corrections to apply. Both default to false. */
|
|
19
|
+
export interface SppCorrections {
|
|
20
|
+
ionosphere?: boolean;
|
|
21
|
+
troposphere?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** GPS Klobuchar ionosphere coefficients (each a 4-element tuple). */
|
|
25
|
+
export interface SppKlobuchar {
|
|
26
|
+
alpha?: [number, number, number, number];
|
|
27
|
+
beta?: [number, number, number, number];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Surface meteorology for the troposphere model. */
|
|
31
|
+
export interface SppSurfaceMet {
|
|
32
|
+
pressureHpa: number;
|
|
33
|
+
temperatureK: number;
|
|
34
|
+
relativeHumidity: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The object passed to `Sp3.solveSpp`. */
|
|
38
|
+
export interface SppRequest {
|
|
39
|
+
/** Pseudorange observations; at least one is required. */
|
|
40
|
+
observations: SppObservation[];
|
|
41
|
+
/** Receive epoch, seconds since J2000 in the ephemeris time scale. */
|
|
42
|
+
tRxJ2000S: number;
|
|
43
|
+
/** Receive second-of-day, seconds. */
|
|
44
|
+
tRxSecondOfDayS: number;
|
|
45
|
+
/** Day of year. */
|
|
46
|
+
dayOfYear: number;
|
|
47
|
+
/** Initial state guess [x, y, z, clock]; defaults to [0, 0, 0, 0]. */
|
|
48
|
+
initialGuess?: [number, number, number, number];
|
|
49
|
+
corrections?: SppCorrections;
|
|
50
|
+
klobuchar?: SppKlobuchar;
|
|
51
|
+
met?: SppSurfaceMet;
|
|
52
|
+
/**
|
|
53
|
+
* GLONASS FDMA channel numbers as `[slot, channel]` pairs, e.g.
|
|
54
|
+
* `[[1, 1], [2, -4]]`. `slot` is the GLONASS satellite slot/PRN and `channel`
|
|
55
|
+
* its FDMA frequency channel `k` (valid `[-7, +6]`). GLONASS is FDMA, so its
|
|
56
|
+
* per-satellite carrier is resolved from this map to scale the L1 Klobuchar
|
|
57
|
+
* ionosphere delay by `(f_L1 / f_k)^2`. Omit (or pass `[]`) when there is no
|
|
58
|
+
* GLONASS observation; every other constellation is unaffected. A GLONASS
|
|
59
|
+
* observation solved with `corrections.ionosphere` on but no entry here (or a
|
|
60
|
+
* channel outside `[-7, +6]`) is rejected with an `Error`. Channels are
|
|
61
|
+
* available from broadcast nav (`GlonassRecordJs.freqChannel`) or a RINEX obs
|
|
62
|
+
* header (`ObsHeader.glonassSlots`).
|
|
63
|
+
*/
|
|
64
|
+
glonassChannels?: [number, number][];
|
|
65
|
+
/** Populate WGS84 lat/lon/height in the result. Defaults to true. */
|
|
66
|
+
withGeodetic?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// --- Observable-domain plain-object inputs ----------------------------------
|
|
70
|
+
//
|
|
71
|
+
// The wasm-bindgen surface types these arguments as `any` because they cross
|
|
72
|
+
// the boundary through serde. These are the precise shapes accepted. Import:
|
|
73
|
+
//
|
|
74
|
+
// import { detectCycleSlips } from "@neilberkman/sidereon";
|
|
75
|
+
// import type { ArcEpoch } from "@neilberkman/sidereon/types";
|
|
76
|
+
|
|
77
|
+
/** One epoch in a single-satellite carrier-phase arc. Phases are cycles, code
|
|
78
|
+
* values metres, carrier frequencies hertz, `gapTimeS` any comparable seconds
|
|
79
|
+
* coordinate. Any field may be omitted. */
|
|
80
|
+
export interface ArcEpoch {
|
|
81
|
+
phi1Cycles?: number;
|
|
82
|
+
phi2Cycles?: number;
|
|
83
|
+
p1M?: number;
|
|
84
|
+
p2M?: number;
|
|
85
|
+
lli1?: number;
|
|
86
|
+
lli2?: number;
|
|
87
|
+
f1Hz?: number;
|
|
88
|
+
f2Hz?: number;
|
|
89
|
+
gapTimeS?: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Options controlling carrier-phase cycle-slip classification. */
|
|
93
|
+
export interface CycleSlipOptions {
|
|
94
|
+
/** Geometry-free step threshold, metres. Defaults to 0.05. */
|
|
95
|
+
gfThresholdM?: number;
|
|
96
|
+
/** Melbourne-Wubbena step threshold, wide-lane cycles. Defaults to 4.0. */
|
|
97
|
+
mwThresholdCycles?: number;
|
|
98
|
+
/** Data-gap threshold, seconds. Defaults to 300.0. */
|
|
99
|
+
minArcGapS?: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** One satellite observation for a receiver velocity solve. */
|
|
103
|
+
export interface VelocityObservation {
|
|
104
|
+
/** RINEX satellite token, e.g. "G07". */
|
|
105
|
+
satelliteId: string;
|
|
106
|
+
/** Pseudorange rate (m/s) for range-rate solves, or Doppler (Hz) for Doppler. */
|
|
107
|
+
value: number;
|
|
108
|
+
/** Carrier frequency, hertz, used for Doppler conversion. */
|
|
109
|
+
carrierHz: number;
|
|
110
|
+
/** Satellite clock drift, seconds per second. Defaults to 0. */
|
|
111
|
+
satClockDriftSS?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Options controlling receiver velocity solving. */
|
|
115
|
+
export interface VelocitySolveOptions {
|
|
116
|
+
/** Observation value convention. Defaults to "range_rate". */
|
|
117
|
+
observable?: "range_rate" | "doppler";
|
|
118
|
+
/** Apply fixed-point light-time correction. Defaults to true. */
|
|
119
|
+
lightTime?: boolean;
|
|
120
|
+
/** Apply Earth-rotation Sagnac correction. Defaults to true. */
|
|
121
|
+
sagnac?: boolean;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** One satellite/elevation row for sigma or weight construction. */
|
|
125
|
+
export interface WeightEntry {
|
|
126
|
+
satelliteId: string;
|
|
127
|
+
/** Topocentric elevation, degrees. */
|
|
128
|
+
elevationDeg: number;
|
|
129
|
+
/** Optional carrier-to-noise density, dB-Hz. */
|
|
130
|
+
cn0Dbhz?: number;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Options for pseudorange variance weighting. */
|
|
134
|
+
export interface PseudorangeVarianceOptions {
|
|
135
|
+
/** Zenith-floor term, metres. Defaults to 0.3. */
|
|
136
|
+
aM?: number;
|
|
137
|
+
/** Elevation-scaled term, metres. Defaults to 0.3. */
|
|
138
|
+
bM?: number;
|
|
139
|
+
/** Variance model. Defaults to "elevation". */
|
|
140
|
+
model?: "elevation" | "elevation_cn0";
|
|
141
|
+
/** Carrier-to-noise density, dB-Hz (required for "elevation_cn0"). */
|
|
142
|
+
cn0Dbhz?: number;
|
|
143
|
+
/** C/N0 variance scale, square metres. Defaults to 1.0. */
|
|
144
|
+
cn0ScaleM2?: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** One satellite-keyed pseudorange for ionosphere-free combination. */
|
|
148
|
+
export interface PseudorangeObservation {
|
|
149
|
+
satelliteId: string;
|
|
150
|
+
/** Pseudorange, metres. */
|
|
151
|
+
valueM: number;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** A per-constellation RINEX band override for pseudorange combination. */
|
|
155
|
+
export interface PseudorangeBandOverride {
|
|
156
|
+
/** Single RINEX system character, e.g. "G". */
|
|
157
|
+
system: string;
|
|
158
|
+
/** Band-1 RINEX observation code. */
|
|
159
|
+
band1: string;
|
|
160
|
+
/** Band-2 RINEX observation code. */
|
|
161
|
+
band2: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** GPS C/A replica generation options. */
|
|
165
|
+
export interface ReplicaOptions {
|
|
166
|
+
/** Sampling rate, hertz. Defaults to 2_046_000. */
|
|
167
|
+
sampleRateHz?: number;
|
|
168
|
+
/** Output sample count. Defaults to 2046. */
|
|
169
|
+
numSamples?: number;
|
|
170
|
+
/** Initial C/A code phase, chips. Defaults to 0. */
|
|
171
|
+
codePhaseChips?: number;
|
|
172
|
+
/** Code-rate Doppler, hertz. Defaults to 0. */
|
|
173
|
+
codeDopplerHz?: number;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Coherent GPS C/A correlation options. */
|
|
177
|
+
export interface CorrelateOptions {
|
|
178
|
+
sampleRateHz?: number;
|
|
179
|
+
dopplerHz?: number;
|
|
180
|
+
codePhaseChips?: number;
|
|
181
|
+
codeDopplerHz?: number;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** GPS C/A acquisition search options. */
|
|
185
|
+
export interface AcquisitionOptions {
|
|
186
|
+
sampleRateHz?: number;
|
|
187
|
+
dopplerMinHz?: number;
|
|
188
|
+
dopplerMaxHz?: number;
|
|
189
|
+
dopplerStepHz?: number;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// --- Orbit propagation ------------------------------------------------------
|
|
193
|
+
//
|
|
194
|
+
// `propagateState(request)` deserializes its argument through serde, so
|
|
195
|
+
// wasm-bindgen types it as `any`. This is the precise shape it accepts. Import:
|
|
196
|
+
//
|
|
197
|
+
// import { propagateState } from "@neilberkman/sidereon";
|
|
198
|
+
// import type { PropagateStateRequest } from "@neilberkman/sidereon/types";
|
|
199
|
+
|
|
200
|
+
/** Numerical state-propagation force model selector. */
|
|
201
|
+
export type ForceModel = "two_body" | "two_body_j2";
|
|
202
|
+
|
|
203
|
+
/** Numerical state-propagation integrator selector. */
|
|
204
|
+
export type Integrator = "dp54" | "rk4";
|
|
205
|
+
|
|
206
|
+
/** The object passed to `propagateState`. Position/velocity are length-3,
|
|
207
|
+
* km / km/s; `timesS` are absolute TDB epochs (seconds). */
|
|
208
|
+
export interface PropagateStateRequest {
|
|
209
|
+
/** Initial-state epoch, TDB seconds. */
|
|
210
|
+
epochS: number;
|
|
211
|
+
/** Initial ECI position [x, y, z], km. */
|
|
212
|
+
positionKm: [number, number, number];
|
|
213
|
+
/** Initial ECI velocity [vx, vy, vz], km/s. */
|
|
214
|
+
velocityKmS: [number, number, number];
|
|
215
|
+
/** Output sample epochs, TDB seconds, monotonic in the propagation direction. */
|
|
216
|
+
timesS: number[];
|
|
217
|
+
/** Force model. Defaults to "two_body". */
|
|
218
|
+
forceModel?: ForceModel;
|
|
219
|
+
/** Integrator. Defaults to "dp54". */
|
|
220
|
+
integrator?: Integrator;
|
|
221
|
+
/** Absolute tolerance (DP54). Defaults to 1e-9. */
|
|
222
|
+
absTol?: number;
|
|
223
|
+
/** Relative tolerance (DP54). Defaults to 1e-12. */
|
|
224
|
+
relTol?: number;
|
|
225
|
+
/** Initial step, seconds. Defaults to 60. Must be positive. */
|
|
226
|
+
initialStepS?: number;
|
|
227
|
+
/** Minimum step, seconds. Defaults to 1e-6. */
|
|
228
|
+
minStepS?: number;
|
|
229
|
+
/** Maximum step, seconds. Defaults to 3600. */
|
|
230
|
+
maxStepS?: number;
|
|
231
|
+
/** Maximum integrator steps. Defaults to 1_000_000. */
|
|
232
|
+
maxSteps?: number;
|
|
233
|
+
/** Gravitational parameter, km^3/s^2. Defaults to Earth's MU_EARTH. */
|
|
234
|
+
muKm3S2?: number;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// --- RTK baseline solving ---------------------------------------------------
|
|
238
|
+
//
|
|
239
|
+
// `solveRtkFloat(config)` / `solveRtkFixed(config)` deserialize through serde.
|
|
240
|
+
// These are the precise shapes accepted. Import:
|
|
241
|
+
//
|
|
242
|
+
// import { solveRtkFloat } from "@neilberkman/sidereon";
|
|
243
|
+
// import type { RtkFloatConfig } from "@neilberkman/sidereon/types";
|
|
244
|
+
|
|
245
|
+
/** RTK stochastic weighting model selector. */
|
|
246
|
+
export type RtkStochasticModel = "simple" | "rtklib";
|
|
247
|
+
|
|
248
|
+
/** One satellite's base/rover measurements for an RTK epoch. */
|
|
249
|
+
export interface RtkSatMeasurement {
|
|
250
|
+
sat: string;
|
|
251
|
+
sdAmbiguityId: string;
|
|
252
|
+
baseCodeM: number;
|
|
253
|
+
basePhaseM: number;
|
|
254
|
+
roverCodeM: number;
|
|
255
|
+
roverPhaseM: number;
|
|
256
|
+
baseTxPos: [number, number, number];
|
|
257
|
+
roverTxPos: [number, number, number];
|
|
258
|
+
pos: [number, number, number];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** One RTK epoch with reference and non-reference satellite rows. */
|
|
262
|
+
export interface RtkEpoch {
|
|
263
|
+
references: RtkSatMeasurement[];
|
|
264
|
+
nonref: RtkSatMeasurement[];
|
|
265
|
+
dtS: number;
|
|
266
|
+
velocityMps?: [number, number, number];
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** RTK measurement weighting and correction model. */
|
|
270
|
+
export interface RtkMeasurementModel {
|
|
271
|
+
codeSigmaM: number;
|
|
272
|
+
phaseSigmaM: number;
|
|
273
|
+
/** Apply the Earth-rotation Sagnac correction. Defaults to true. */
|
|
274
|
+
sagnac?: boolean;
|
|
275
|
+
/** Stochastic model. Defaults to "simple". */
|
|
276
|
+
stochastic?: RtkStochasticModel;
|
|
277
|
+
/** Elevation-weight measurements (simple model only). Defaults to false. */
|
|
278
|
+
elevationWeighting?: boolean;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** Iteration controls for an RTK float solve. */
|
|
282
|
+
export interface RtkFloatOptions {
|
|
283
|
+
positionTolM?: number;
|
|
284
|
+
ambiguityTolM?: number;
|
|
285
|
+
maxIterations?: number;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/** Iteration and integer-search controls for RTK fixed solving. */
|
|
289
|
+
export interface RtkFixedOptions {
|
|
290
|
+
positionTolM?: number;
|
|
291
|
+
ambiguityTolM?: number;
|
|
292
|
+
maxIterations?: number;
|
|
293
|
+
ratioThreshold?: number;
|
|
294
|
+
partialAmbiguityResolution?: boolean;
|
|
295
|
+
partialMinAmbiguities?: number;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** Residual validation controls for RTK fixed solving. */
|
|
299
|
+
export interface RtkResidualValidationOptions {
|
|
300
|
+
/** Per-residual rejection threshold in sigma, or null/omitted to disable. */
|
|
301
|
+
thresholdSigma?: number | null;
|
|
302
|
+
maxExclusions?: number;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/** The object passed to `solveRtkFloat`. */
|
|
306
|
+
export interface RtkFloatConfig {
|
|
307
|
+
epochs: RtkEpoch[];
|
|
308
|
+
/** Known base receiver ECEF position [x, y, z], metres. */
|
|
309
|
+
base: [number, number, number];
|
|
310
|
+
ambiguityIds: string[];
|
|
311
|
+
model: RtkMeasurementModel;
|
|
312
|
+
/** Rover-minus-base ECEF baseline seed, metres. Defaults to [0, 0, 0]. */
|
|
313
|
+
initialBaselineM?: [number, number, number];
|
|
314
|
+
options?: RtkFloatOptions;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** The object passed to `solveRtkFixed`. */
|
|
318
|
+
export interface RtkFixedConfig {
|
|
319
|
+
epochs: RtkEpoch[];
|
|
320
|
+
base: [number, number, number];
|
|
321
|
+
ambiguityIds: string[];
|
|
322
|
+
/** Ambiguity id -> satellite token. */
|
|
323
|
+
ambiguitySatellites: Record<string, string>;
|
|
324
|
+
/** Ambiguity id -> wavelength, metres. */
|
|
325
|
+
wavelengthsM: Record<string, number>;
|
|
326
|
+
/** Ambiguity id -> offset, metres. */
|
|
327
|
+
offsetsM: Record<string, number>;
|
|
328
|
+
model: RtkMeasurementModel;
|
|
329
|
+
floatOptions?: RtkFloatOptions;
|
|
330
|
+
fixedOptions?: RtkFixedOptions;
|
|
331
|
+
residualOptions?: RtkResidualValidationOptions;
|
|
332
|
+
/** Systems kept float-only (never integer-fixed), e.g. ["R"]. */
|
|
333
|
+
floatOnlySystems?: string[];
|
|
334
|
+
initialBaselineM?: [number, number, number];
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// --- PPP solving ------------------------------------------------------------
|
|
338
|
+
//
|
|
339
|
+
// `solvePppFloat(sp3, epochs, initialState, config)` / `solvePppFixed(...)`
|
|
340
|
+
// take serde-`any` arrays and objects. Import:
|
|
341
|
+
//
|
|
342
|
+
// import { solvePppFloat } from "@neilberkman/sidereon";
|
|
343
|
+
// import type { PppEpoch, PppFloatConfig } from "@neilberkman/sidereon/types";
|
|
344
|
+
|
|
345
|
+
/** Civil epoch timestamp for a PPP epoch. */
|
|
346
|
+
export interface PppCivilDateTime {
|
|
347
|
+
year: number;
|
|
348
|
+
month: number;
|
|
349
|
+
day: number;
|
|
350
|
+
hour: number;
|
|
351
|
+
minute: number;
|
|
352
|
+
second: number;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/** One ionosphere-free code/phase observation in a PPP epoch. */
|
|
356
|
+
export interface PppObservation {
|
|
357
|
+
satelliteId: string;
|
|
358
|
+
ambiguityId: string;
|
|
359
|
+
/** Ionosphere-free code, metres. */
|
|
360
|
+
codeM: number;
|
|
361
|
+
/** Ionosphere-free carrier phase, metres. */
|
|
362
|
+
phaseM: number;
|
|
363
|
+
freq1Hz?: number;
|
|
364
|
+
freq2Hz?: number;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** One static PPP epoch. */
|
|
368
|
+
export interface PppEpoch {
|
|
369
|
+
civil: PppCivilDateTime;
|
|
370
|
+
jdWhole: number;
|
|
371
|
+
jdFraction: number;
|
|
372
|
+
tRxJ2000S: number;
|
|
373
|
+
observations: PppObservation[];
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/** Initial PPP state. */
|
|
377
|
+
export interface PppFloatState {
|
|
378
|
+
positionM: [number, number, number];
|
|
379
|
+
/** Per-epoch receiver clocks, metres. */
|
|
380
|
+
clocksM: number[];
|
|
381
|
+
/** Ambiguity id -> initial ambiguity, metres. */
|
|
382
|
+
ambiguitiesM: Record<string, number>;
|
|
383
|
+
/** Initial zenith tropospheric delay, metres. Defaults to 0. */
|
|
384
|
+
ztdM?: number;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** PPP measurement weights. */
|
|
388
|
+
export interface PppMeasurementWeights {
|
|
389
|
+
code?: number;
|
|
390
|
+
phase?: number;
|
|
391
|
+
elevationWeighting?: boolean;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/** PPP troposphere controls. */
|
|
395
|
+
export interface PppTroposphereOptions {
|
|
396
|
+
enabled?: boolean;
|
|
397
|
+
estimateZtd?: boolean;
|
|
398
|
+
pressureHpa?: number;
|
|
399
|
+
temperatureK?: number;
|
|
400
|
+
relativeHumidity?: number;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/** Iteration and convergence controls for PPP. */
|
|
404
|
+
export interface PppFloatOptions {
|
|
405
|
+
maxIterations?: number;
|
|
406
|
+
positionToleranceM?: number;
|
|
407
|
+
clockToleranceM?: number;
|
|
408
|
+
ambiguityToleranceM?: number;
|
|
409
|
+
ztdToleranceM?: number;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/** The config object passed to `solvePppFloat`. */
|
|
413
|
+
export interface PppFloatConfig {
|
|
414
|
+
weights?: PppMeasurementWeights;
|
|
415
|
+
tropo?: PppTroposphereOptions;
|
|
416
|
+
options?: PppFloatOptions;
|
|
417
|
+
residualScreen?: boolean;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** Integer ambiguity controls for PPP fixed solving. */
|
|
421
|
+
export interface PppFixedAmbiguityOptions {
|
|
422
|
+
/** Ambiguity id -> wavelength, metres. */
|
|
423
|
+
wavelengthsM: Record<string, number>;
|
|
424
|
+
/** Ambiguity id -> offset, metres. */
|
|
425
|
+
offsetsM: Record<string, number>;
|
|
426
|
+
ratioThreshold?: number;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/** The config object passed to `solvePppFixed`. */
|
|
430
|
+
export interface PppFixedConfig {
|
|
431
|
+
ambiguity: PppFixedAmbiguityOptions;
|
|
432
|
+
weights?: PppMeasurementWeights;
|
|
433
|
+
tropo?: PppTroposphereOptions;
|
|
434
|
+
options?: PppFloatOptions;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// --- SP3 merge --------------------------------------------------------------
|
|
438
|
+
//
|
|
439
|
+
// `mergeSp3(sources, options?)` deserializes `options` through serde. Import:
|
|
440
|
+
//
|
|
441
|
+
// import { mergeSp3 } from "@neilberkman/sidereon";
|
|
442
|
+
// import type { Sp3MergeOptions } from "@neilberkman/sidereon/types";
|
|
443
|
+
|
|
444
|
+
/** How agreeing SP3 sources are combined in `mergeSp3`. */
|
|
445
|
+
export type Sp3MergeCombine = "mean" | "median" | "precedence";
|
|
446
|
+
|
|
447
|
+
/** The options object passed to `mergeSp3`. All fields optional. */
|
|
448
|
+
export interface Sp3MergeOptions {
|
|
449
|
+
/** Max agreeing-source 3D position difference, metres. Defaults to 0.5. */
|
|
450
|
+
positionToleranceM?: number;
|
|
451
|
+
/** Max agreeing-source clock difference after alignment, seconds. Defaults to 5e-9. */
|
|
452
|
+
clockToleranceS?: number;
|
|
453
|
+
/** Minimum agreeing sources for a multi-source cell. Defaults to 2. */
|
|
454
|
+
minAgree?: number;
|
|
455
|
+
/** Minimum common clocked satellites for clock-datum alignment. Defaults to 5. */
|
|
456
|
+
clockMinCommon?: number;
|
|
457
|
+
/** Consensus combination policy. Defaults to "mean". */
|
|
458
|
+
combine?: Sp3MergeCombine;
|
|
459
|
+
/** Output epoch spacing, seconds, or null for the coarsest input grid. */
|
|
460
|
+
targetEpochIntervalS?: number | null;
|
|
461
|
+
/** Optional system filter as RINEX letters/names (e.g. ["G", "C"]). */
|
|
462
|
+
systems?: string[] | null;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// --- DOP series -------------------------------------------------------------
|
|
466
|
+
//
|
|
467
|
+
// `gnssDopSeries(sp3, stationEcefM, j2000Seconds, options?)` deserializes
|
|
468
|
+
// `options` through serde. Import:
|
|
469
|
+
//
|
|
470
|
+
// import { gnssDopSeries } from "@neilberkman/sidereon";
|
|
471
|
+
// import type { GnssDopSeriesOptions } from "@neilberkman/sidereon/types";
|
|
472
|
+
|
|
473
|
+
/** DOP row weighting selector for `gnssDopSeries`. */
|
|
474
|
+
export type DopWeighting = "unit" | "elevation";
|
|
475
|
+
|
|
476
|
+
/** The options object passed to `gnssDopSeries`. All fields optional. */
|
|
477
|
+
export interface GnssDopSeriesOptions {
|
|
478
|
+
/** Explicit satellite tokens (e.g. ["G01", "G02"]); omit for a visibility scan. */
|
|
479
|
+
satellites?: string[];
|
|
480
|
+
/** Minimum topocentric elevation, degrees. Defaults to 5. */
|
|
481
|
+
elevationMaskDeg?: number;
|
|
482
|
+
/** Constellation filter as RINEX letters/names (e.g. ["G"]). */
|
|
483
|
+
systems?: string[];
|
|
484
|
+
/** Row weighting policy. Defaults to "unit". */
|
|
485
|
+
weighting?: DopWeighting;
|
|
486
|
+
/** Apply light-time + Sagnac corrections forming the line of sight. Defaults to false. */
|
|
487
|
+
lightTime?: boolean;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// --- CDM construction -------------------------------------------------------
|
|
491
|
+
//
|
|
492
|
+
// `new CdmObject(positionKm, velocityKmS, covarianceRtn, meta?)` and
|
|
493
|
+
// `new Cdm(object1, object2, meta?)` deserialize their `meta` object through
|
|
494
|
+
// serde. Import:
|
|
495
|
+
//
|
|
496
|
+
// import { Cdm, CdmObject } from "@neilberkman/sidereon";
|
|
497
|
+
// import type { CdmObjectMeta, CdmMeta } from "@neilberkman/sidereon/types";
|
|
498
|
+
|
|
499
|
+
/** Optional metadata for a `CdmObject`. */
|
|
500
|
+
export interface CdmObjectMeta {
|
|
501
|
+
objectDesignator?: string;
|
|
502
|
+
catalogName?: string;
|
|
503
|
+
objectName?: string;
|
|
504
|
+
internationalDesignator?: string;
|
|
505
|
+
objectType?: string;
|
|
506
|
+
refFrame?: string;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/** Optional message-level fields for a `Cdm`. */
|
|
510
|
+
export interface CdmMeta {
|
|
511
|
+
creationDate?: string;
|
|
512
|
+
originator?: string;
|
|
513
|
+
messageId?: string;
|
|
514
|
+
tca?: string;
|
|
515
|
+
missDistanceM?: number;
|
|
516
|
+
relativeSpeedMS?: number;
|
|
517
|
+
collisionProbability?: number;
|
|
518
|
+
collisionProbabilityMethod?: string;
|
|
519
|
+
hardBodyRadiusM?: number;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// --- OMM construction -------------------------------------------------------
|
|
523
|
+
//
|
|
524
|
+
// `new Omm(epoch, meanMotion, ..., noradCatId, meta?)` deserializes its `meta`
|
|
525
|
+
// object through serde. Import:
|
|
526
|
+
//
|
|
527
|
+
// import { Omm } from "@neilberkman/sidereon";
|
|
528
|
+
// import type { OmmMeta } from "@neilberkman/sidereon/types";
|
|
529
|
+
|
|
530
|
+
/** Optional OMM fields; each defaults to the CCSDS-standard value. */
|
|
531
|
+
export interface OmmMeta {
|
|
532
|
+
ccsdsOmmVers?: string;
|
|
533
|
+
creationDate?: string;
|
|
534
|
+
originator?: string;
|
|
535
|
+
objectName?: string;
|
|
536
|
+
objectId?: string;
|
|
537
|
+
centerName?: string;
|
|
538
|
+
refFrame?: string;
|
|
539
|
+
timeSystem?: string;
|
|
540
|
+
meanElementTheory?: string;
|
|
541
|
+
ephemerisType?: number;
|
|
542
|
+
classificationType?: string;
|
|
543
|
+
elementSetNo?: number;
|
|
544
|
+
revAtEpoch?: number;
|
|
545
|
+
bstar?: number;
|
|
546
|
+
meanMotionDot?: number;
|
|
547
|
+
meanMotionDdot?: number;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// --- DGNSS ------------------------------------------------------------------
|
|
551
|
+
//
|
|
552
|
+
// `Sp3.dgnssCorrections(request)`, `Sp3.dgnssSolve(request)`, and
|
|
553
|
+
// `dgnssApply(roverObservations, corrections)` deserialize their plain-object
|
|
554
|
+
// arguments through serde, so wasm-bindgen types them as `any`. Import:
|
|
555
|
+
//
|
|
556
|
+
// import { dgnssApply } from "@neilberkman/sidereon";
|
|
557
|
+
// import type { DgnssSolveRequest } from "@neilberkman/sidereon/types";
|
|
558
|
+
|
|
559
|
+
/** One code (pseudorange) observation. */
|
|
560
|
+
export interface DgnssCodeObservation {
|
|
561
|
+
satelliteId: string;
|
|
562
|
+
pseudorangeM: number;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/** One per-satellite pseudorange correction; the element type of the array
|
|
566
|
+
* returned by `Sp3.dgnssCorrections` and accepted by `dgnssApply`. */
|
|
567
|
+
export interface DgnssCorrectionEntry {
|
|
568
|
+
satelliteId: string;
|
|
569
|
+
correctionM: number;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
/** The object passed to `Sp3.dgnssCorrections`. */
|
|
573
|
+
export interface DgnssCorrectionsRequest {
|
|
574
|
+
/** Surveyed base ECEF position [x, y, z], metres. */
|
|
575
|
+
basePositionM: [number, number, number];
|
|
576
|
+
baseObservations: DgnssCodeObservation[];
|
|
577
|
+
/** Receive epoch, seconds since J2000 in the ephemeris time scale. */
|
|
578
|
+
tRxJ2000S: number;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/** The object passed to `Sp3.dgnssSolve`. */
|
|
582
|
+
export interface DgnssSolveRequest {
|
|
583
|
+
/** Surveyed base ECEF position [x, y, z], metres. */
|
|
584
|
+
basePositionM: [number, number, number];
|
|
585
|
+
baseObservations: DgnssCodeObservation[];
|
|
586
|
+
roverObservations: DgnssCodeObservation[];
|
|
587
|
+
tRxJ2000S: number;
|
|
588
|
+
tRxSecondOfDayS: number;
|
|
589
|
+
dayOfYear: number;
|
|
590
|
+
/** Initial state guess [x, y, z, clock]; defaults to [0, 0, 0, 0]. */
|
|
591
|
+
initialGuess?: [number, number, number, number];
|
|
592
|
+
/** Populate WGS84 lat/lon/height in the result. Defaults to true. */
|
|
593
|
+
withGeodetic?: boolean;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// --- Fault detection and exclusion (FDE) ------------------------------------
|
|
597
|
+
//
|
|
598
|
+
// `Sp3.fde(request)` deserializes its argument through serde. Import:
|
|
599
|
+
//
|
|
600
|
+
// import { loadSp3 } from "@neilberkman/sidereon";
|
|
601
|
+
// import type { FdeRequest } from "@neilberkman/sidereon/types";
|
|
602
|
+
|
|
603
|
+
/** One per-satellite RAIM residual weight. */
|
|
604
|
+
export interface RaimWeightEntry {
|
|
605
|
+
satelliteId: string;
|
|
606
|
+
weight: number;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/** The object passed to `Sp3.fde`: the SPP solve inputs plus the RAIM /
|
|
610
|
+
* exclusion options. */
|
|
611
|
+
export interface FdeRequest {
|
|
612
|
+
observations: SppObservation[];
|
|
613
|
+
tRxJ2000S: number;
|
|
614
|
+
tRxSecondOfDayS: number;
|
|
615
|
+
dayOfYear: number;
|
|
616
|
+
initialGuess?: [number, number, number, number];
|
|
617
|
+
corrections?: SppCorrections;
|
|
618
|
+
klobuchar?: SppKlobuchar;
|
|
619
|
+
met?: SppSurfaceMet;
|
|
620
|
+
glonassChannels?: [number, number][];
|
|
621
|
+
withGeodetic?: boolean;
|
|
622
|
+
/** RAIM false-alarm probability in the open interval (0, 1); defaults to the
|
|
623
|
+
* core RAIM default. */
|
|
624
|
+
pFa?: number;
|
|
625
|
+
/** Per-satellite RAIM weights; absent or empty means unit weights. */
|
|
626
|
+
weights?: RaimWeightEntry[];
|
|
627
|
+
/** Override for the number of distinct GNSS clock systems. */
|
|
628
|
+
nSystems?: number;
|
|
629
|
+
/** Maximum exclusions; defaults to max(observationCount - 4, 0). */
|
|
630
|
+
maxIterations?: number;
|
|
631
|
+
/** Optional PDOP ceiling applied to each candidate solution. */
|
|
632
|
+
maxPdop?: number;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
// --- Broadcast-vs-precise comparison ----------------------------------------
|
|
636
|
+
//
|
|
637
|
+
// `BroadcastEphemeris.compareToSp3(...)` returns a plain object typed `any`.
|
|
638
|
+
// Import:
|
|
639
|
+
//
|
|
640
|
+
// import { loadRinexNav } from "@neilberkman/sidereon";
|
|
641
|
+
// import type { BroadcastCompareReport } from "@neilberkman/sidereon/types";
|
|
642
|
+
|
|
643
|
+
/** Difference statistics for one satellite (or the overall set). Every metre
|
|
644
|
+
* field is `null` when no compared epoch populated it. */
|
|
645
|
+
export interface BroadcastCompareStats {
|
|
646
|
+
count: number;
|
|
647
|
+
orbit3dRmsM: number | null;
|
|
648
|
+
orbit3dMaxM: number | null;
|
|
649
|
+
radialRmsM: number | null;
|
|
650
|
+
radialMaxM: number | null;
|
|
651
|
+
alongRmsM: number | null;
|
|
652
|
+
alongMaxM: number | null;
|
|
653
|
+
crossRmsM: number | null;
|
|
654
|
+
crossMaxM: number | null;
|
|
655
|
+
clockRmsM: number | null;
|
|
656
|
+
clockMaxM: number | null;
|
|
657
|
+
clockDatumRemovedRmsM: number | null;
|
|
658
|
+
clockDatumRemovedMaxM: number | null;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/** The report returned by `BroadcastEphemeris.compareToSp3`. */
|
|
662
|
+
export interface BroadcastCompareReport {
|
|
663
|
+
overall: BroadcastCompareStats;
|
|
664
|
+
perSatellite: { satelliteId: string; stats: BroadcastCompareStats }[];
|
|
665
|
+
missing: { satelliteId: string; count: number }[];
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// --- GNSS constellation identity catalog -------------------------------------
|
|
669
|
+
//
|
|
670
|
+
// The constellation surface is JSON-in / JSON-out: every function takes and
|
|
671
|
+
// returns plain objects through serde, so wasm-bindgen types them as `any`.
|
|
672
|
+
// These are the precise shapes. Import:
|
|
673
|
+
//
|
|
674
|
+
// import { fromCelestrakJson, mergeNavcen } from "@neilberkman/sidereon";
|
|
675
|
+
// import type { ConstellationRecord } from "@neilberkman/sidereon/types";
|
|
676
|
+
|
|
677
|
+
/** Lower-case constellation label, e.g. "gps". GPS is supported today. */
|
|
678
|
+
export type ConstellationSystem =
|
|
679
|
+
| "gps"
|
|
680
|
+
| "glonass"
|
|
681
|
+
| "galileo"
|
|
682
|
+
| "beidou"
|
|
683
|
+
| "qzss"
|
|
684
|
+
| "navic"
|
|
685
|
+
| "sbas";
|
|
686
|
+
|
|
687
|
+
/** CelesTrak `gps-ops` provenance preserved on a record. */
|
|
688
|
+
export interface CelestrakSource {
|
|
689
|
+
/** CelesTrak GP group the record came from ("gps-ops"). */
|
|
690
|
+
group: string;
|
|
691
|
+
/** The OMM OBJECT_NAME. */
|
|
692
|
+
objectName?: string;
|
|
693
|
+
/** The OMM OBJECT_ID (international designator). */
|
|
694
|
+
objectId?: string;
|
|
695
|
+
/** The OMM EPOCH, ISO-8601. */
|
|
696
|
+
epoch?: string;
|
|
697
|
+
/** Block type parsed from the object name ("IIF", "IIR", "IIR-M", "III"). */
|
|
698
|
+
blockType?: string;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/** NAVCEN status provenance preserved on a record or recorded as a conflict. */
|
|
702
|
+
export interface NavcenSource {
|
|
703
|
+
/** Space Vehicle Number. */
|
|
704
|
+
svn?: number;
|
|
705
|
+
blockType?: string;
|
|
706
|
+
plane?: string;
|
|
707
|
+
slot?: string;
|
|
708
|
+
clock?: string;
|
|
709
|
+
/** NANU type code ("FCSTSUMM", "UNUSABLE", "DECOM", ...). */
|
|
710
|
+
nanuType?: string;
|
|
711
|
+
nanuSubject?: string;
|
|
712
|
+
/** Whether the row carried an active NANU. */
|
|
713
|
+
activeNanu: boolean;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/** Per-source provenance kept on a record. */
|
|
717
|
+
export interface RecordSource {
|
|
718
|
+
celestrak?: CelestrakSource;
|
|
719
|
+
/** NAVCEN overlay merged into this record. */
|
|
720
|
+
navcen?: NavcenSource;
|
|
721
|
+
/** A NAVCEN row that matched the PRN but was not merged (a PRN transition). */
|
|
722
|
+
navcenConflict?: NavcenSource;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/** A normalized GNSS satellite identity record, the element type of the array
|
|
726
|
+
* returned by `fromCelestrakJson` / `mergeNavcen` and accepted by the validate
|
|
727
|
+
* and diff functions. */
|
|
728
|
+
export interface ConstellationRecord {
|
|
729
|
+
system: ConstellationSystem;
|
|
730
|
+
/** Within-constellation PRN. */
|
|
731
|
+
prn: number;
|
|
732
|
+
/** Space Vehicle Number, when known (CelesTrak alone leaves this absent). */
|
|
733
|
+
svn?: number;
|
|
734
|
+
/** NORAD catalog id. */
|
|
735
|
+
noradId: number;
|
|
736
|
+
/** Canonical SP3/RINEX satellite token ("G03"). */
|
|
737
|
+
sp3Id: string;
|
|
738
|
+
/** Present in the base identity source. */
|
|
739
|
+
active: boolean;
|
|
740
|
+
/** Advisory usability flag. */
|
|
741
|
+
usable: boolean;
|
|
742
|
+
source: RecordSource;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/** A parsed NAVCEN GPS constellation status row, the element type returned by
|
|
746
|
+
* `parseNavcen` and accepted by `mergeNavcen`. */
|
|
747
|
+
export interface NavcenStatus {
|
|
748
|
+
system: ConstellationSystem;
|
|
749
|
+
prn: number;
|
|
750
|
+
svn?: number;
|
|
751
|
+
/** Usable per the active NANU (if any). */
|
|
752
|
+
usable: boolean;
|
|
753
|
+
activeNanu: boolean;
|
|
754
|
+
nanuType?: string;
|
|
755
|
+
nanuSubject?: string;
|
|
756
|
+
plane?: string;
|
|
757
|
+
slot?: string;
|
|
758
|
+
blockType?: string;
|
|
759
|
+
clock?: string;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/** The report returned by `validate` / `validateAgainstSp3Ids`. */
|
|
763
|
+
export interface ConstellationValidation {
|
|
764
|
+
/** Active+usable catalog SP3 ids absent from the compared product. */
|
|
765
|
+
missingSp3Ids: string[];
|
|
766
|
+
/** PRNs that appear in more than one record. */
|
|
767
|
+
duplicatePrns: number[];
|
|
768
|
+
/** NORAD ids that appear in more than one record. */
|
|
769
|
+
duplicateNoradIds: number[];
|
|
770
|
+
/** PRNs that are inactive or unusable. */
|
|
771
|
+
inactiveUnusablePrns: number[];
|
|
772
|
+
/** SP3 ids in the product absent from the active+usable catalog. */
|
|
773
|
+
extraSp3Ids: string[];
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
/** A single field change on a PRN held across both diffed snapshots. */
|
|
777
|
+
export interface ConstellationFieldChange<T> {
|
|
778
|
+
system: ConstellationSystem;
|
|
779
|
+
prn: number;
|
|
780
|
+
from: T;
|
|
781
|
+
to: T;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/** The change report returned by `diff` and tested by `changed`. */
|
|
785
|
+
export interface ConstellationDiff {
|
|
786
|
+
/** PRNs present only in the current snapshot. */
|
|
787
|
+
added: ConstellationRecord[];
|
|
788
|
+
/** PRNs present only in the previous snapshot. */
|
|
789
|
+
removed: ConstellationRecord[];
|
|
790
|
+
noradReassigned: ConstellationFieldChange<number>[];
|
|
791
|
+
sp3IdChanged: ConstellationFieldChange<string>[];
|
|
792
|
+
svnChanged: ConstellationFieldChange<number | null>[];
|
|
793
|
+
activityChanged: ConstellationFieldChange<boolean>[];
|
|
794
|
+
usabilityChanged: ConstellationFieldChange<boolean>[];
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
// --- Product-staleness selection + broadcast fallback -----------------------
|
|
798
|
+
//
|
|
799
|
+
// `selectIonex` / `selectSp3` (+ `*OverRange`) and `solveWithFallback` take an
|
|
800
|
+
// optional `policy` object typed `any`, and the selection/source metadata cross
|
|
801
|
+
// out of the result handles as plain objects typed `any`. These are the precise
|
|
802
|
+
// shapes. Import:
|
|
803
|
+
//
|
|
804
|
+
// import { selectSp3, solveWithFallback } from "@neilberkman/sidereon";
|
|
805
|
+
// import type { StalenessPolicy, FixSource } from "@neilberkman/sidereon/types";
|
|
806
|
+
|
|
807
|
+
/** The optional staleness cap passed to the selection and fallback functions.
|
|
808
|
+
* Set at most one of the two fields; omit the argument entirely for the engine
|
|
809
|
+
* default cap of 3 days. */
|
|
810
|
+
export interface StalenessPolicy {
|
|
811
|
+
/** Maximum tolerated staleness, seconds. */
|
|
812
|
+
maxStalenessS?: number;
|
|
813
|
+
/** Maximum tolerated staleness, days. */
|
|
814
|
+
maxStalenessDays?: number;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/** How a selected product's source epoch relates to the requested epoch.
|
|
818
|
+
* `"exact"` is no degradation; `"nearestPrior"` is the SP3 nearest-prior path;
|
|
819
|
+
* `"diurnalShift"` is the IONEX whole-day persistence path. */
|
|
820
|
+
export type DegradationKind = "exact" | "nearestPrior" | "diurnalShift";
|
|
821
|
+
|
|
822
|
+
/** Staleness metadata attached to every selection and to a precise fix. Epochs
|
|
823
|
+
* are J2000 seconds; `stalenessS` is `requested - source` and never negative. */
|
|
824
|
+
export interface StalenessMetadata {
|
|
825
|
+
kind: DegradationKind;
|
|
826
|
+
requestedEpochJ2000S: number;
|
|
827
|
+
sourceEpochJ2000S: number;
|
|
828
|
+
stalenessS: number;
|
|
829
|
+
stalenessDays: number;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/** The interpolated state returned by `Sp3Selection.positionAtJ2000Seconds`. */
|
|
833
|
+
export interface Sp3SelectionState {
|
|
834
|
+
positionM: [number, number, number];
|
|
835
|
+
/** Clock offset, seconds, or `null` for the bad-clock sentinel. */
|
|
836
|
+
clockS: number | null;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/** The variant `name` of a selection failure. A selection function throws an
|
|
840
|
+
* `Error` whose `.name` is one of these and whose `.detail` is the matching
|
|
841
|
+
* `SelectionErrorDetail`. */
|
|
842
|
+
export type SelectionErrorName =
|
|
843
|
+
| "EmptyProductSet"
|
|
844
|
+
| "InvalidRange"
|
|
845
|
+
| "NoPriorProduct"
|
|
846
|
+
| "BeyondStalenessCap"
|
|
847
|
+
| "InvalidProduct"
|
|
848
|
+
| "InvalidPolicy"
|
|
849
|
+
| "Overflow";
|
|
850
|
+
|
|
851
|
+
/** The structured `.detail` attached to a thrown selection `Error`. Only the
|
|
852
|
+
* fields the variant carries are present. */
|
|
853
|
+
export interface SelectionErrorDetail {
|
|
854
|
+
name: SelectionErrorName;
|
|
855
|
+
message: string;
|
|
856
|
+
requestedEpochJ2000S?: number;
|
|
857
|
+
startEpochJ2000S?: number;
|
|
858
|
+
endEpochJ2000S?: number;
|
|
859
|
+
sourceEpochJ2000S?: number;
|
|
860
|
+
stalenessS?: number;
|
|
861
|
+
maxStalenessS?: number;
|
|
862
|
+
context?: string;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/** The structured `.detail` attached to a thrown `solveWithFallback` `Error`.
|
|
866
|
+
* `name` names which path's solve failed and `message` carries the underlying
|
|
867
|
+
* solve error. */
|
|
868
|
+
export interface FallbackErrorDetail {
|
|
869
|
+
name: "PreciseSolveError" | "BroadcastSolveError";
|
|
870
|
+
message: string;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/** Why `solveWithFallback` produced a fix from broadcast ephemeris. */
|
|
874
|
+
export interface BroadcastReason {
|
|
875
|
+
kind: "preciseUnavailable" | "preciseDegradedUnusable";
|
|
876
|
+
/** The precise selection's rejection, for `"preciseUnavailable"`. */
|
|
877
|
+
selectionError: SelectionErrorDetail | null;
|
|
878
|
+
/** The tried precise product's staleness, for `"preciseDegradedUnusable"`. */
|
|
879
|
+
attemptedStaleness: StalenessMetadata | null;
|
|
880
|
+
/** The precise solve error that triggered the fallback, for
|
|
881
|
+
* `"preciseDegradedUnusable"`. */
|
|
882
|
+
preciseError: string | null;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/** Which ephemeris source produced a `SourcedSolution`, read from
|
|
886
|
+
* `SourcedSolution.source`. For a precise fix `staleness` is the product's
|
|
887
|
+
* metadata and `broadcastReason` is `null`; for a broadcast fix `staleness` is
|
|
888
|
+
* `null` and `broadcastReason` records why precise was not used. */
|
|
889
|
+
export interface FixSource {
|
|
890
|
+
kind: "precise" | "broadcast";
|
|
891
|
+
isPrecise: boolean;
|
|
892
|
+
isBroadcast: boolean;
|
|
893
|
+
isPreciseExact: boolean;
|
|
894
|
+
staleness: StalenessMetadata | null;
|
|
895
|
+
broadcastReason: BroadcastReason | null;
|
|
896
|
+
}
|