@neilberkman/sidereon 0.16.1 → 0.18.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.
@@ -1,3647 +1 @@
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
- /** Opt-in Huber/IRLS robust-reweighting tuning. Including the `robust` key on an
38
- * SPP request (even as `{}`) enables the engine outer reweighting loop on top of
39
- * the static elevation weighting; every field is optional and falls back to the
40
- * engine default. Omitting `robust` runs the static reference solve unchanged. */
41
- export interface SppRobust {
42
- /** Huber tuning constant `k`; residuals scaled below this keep full weight.
43
- * Must be finite and positive. Defaults to the engine constant (~1.345). */
44
- huberK?: number;
45
- /** Floor (metres) on the MAD scale, so a near-perfect fit cannot down-weight
46
- * every satellite. Must be finite and positive. Engine default applies. */
47
- scaleFloorM?: number;
48
- /** Maximum total outer solves (the warm start plus reweighted resolves). Must
49
- * be at least 1. Engine default applies. */
50
- maxOuter?: number;
51
- /** Outer-loop position L2 step tolerance (metres). Must be finite and
52
- * non-negative. Engine default applies. */
53
- outerTolM?: number;
54
- }
55
-
56
- /** The object passed to `Sp3.solveSpp`. */
57
- export interface SppRequest {
58
- /** Pseudorange observations; at least one is required. */
59
- observations: SppObservation[];
60
- /** Receive epoch, seconds since J2000 in the ephemeris time scale. */
61
- tRxJ2000S: number;
62
- /** Receive second-of-day, seconds. */
63
- tRxSecondOfDayS: number;
64
- /** Day of year. */
65
- dayOfYear: number;
66
- /** Initial state guess [x, y, z, clock]; defaults to [0, 0, 0, 0]. */
67
- initialGuess?: [number, number, number, number];
68
- corrections?: SppCorrections;
69
- klobuchar?: SppKlobuchar;
70
- met?: SppSurfaceMet;
71
- /**
72
- * GLONASS FDMA channel numbers as `[slot, channel]` pairs, e.g.
73
- * `[[1, 1], [2, -4]]`. `slot` is the GLONASS satellite slot/PRN and `channel`
74
- * its FDMA frequency channel `k` (valid `[-7, +6]`). GLONASS is FDMA, so its
75
- * per-satellite carrier is resolved from this map to scale the L1 Klobuchar
76
- * ionosphere delay by `(f_L1 / f_k)^2`. Omit (or pass `[]`) when there is no
77
- * GLONASS observation; every other constellation is unaffected. A GLONASS
78
- * observation solved with `corrections.ionosphere` on but no entry here (or a
79
- * channel outside `[-7, +6]`) is rejected with an `Error`. Channels are
80
- * available from broadcast nav (`GlonassRecordJs.freqChannel`) or a RINEX obs
81
- * header (`ObsHeader.glonassSlots`).
82
- */
83
- glonassChannels?: [number, number][];
84
- /** Populate WGS84 lat/lon/height in the result. Defaults to true. */
85
- withGeodetic?: boolean;
86
- /** Opt-in Huber/IRLS robust reweighting. Omit for the static
87
- * elevation-weighted reference solve; include (even as `{}`) to route through
88
- * the engine outer reweighting loop. Honored on the SP3, broadcast-only, and
89
- * fallback paths, since it is a property of the solve inputs. */
90
- robust?: SppRobust;
91
- /** Cold-start convergence-basin widening: the number of near-surface
92
- * golden-spiral seeds the engine tries (plus `initialGuess`), selecting the
93
- * best redundant converged fix. Must be at least 1. Omit for the single exact
94
- * solve from `initialGuess`. Honored only by `Sp3.solveSpp` (the policy-bearing
95
- * path), not the broadcast-only or fallback paths. */
96
- coarseSearchSeeds?: number;
97
- /** Optional positive PDOP ceiling: a fix whose geometry is rank-deficient or
98
- * exceeds this ceiling is refused with an `Error`. Honored only by
99
- * `Sp3.solveSpp`. */
100
- maxPdop?: number;
101
- }
102
-
103
- /** Shared options for `Sp3.solveSppBatch(epochs, options)`, applied to every
104
- * epoch of the batch. The batch shares one `withGeodetic` flag and one solve
105
- * policy across all epochs (each epoch entry is itself an `SppRequest`, but its
106
- * own `withGeodetic` / `maxPdop` / `coarseSearchSeeds` are ignored in favour of
107
- * these). Every field is optional. */
108
- export interface SppBatchOptions {
109
- /** Populate WGS84 lat/lon/height in each epoch's result. Defaults to true. */
110
- withGeodetic?: boolean;
111
- /** Cold-start convergence-basin widening applied to every epoch. Must be at
112
- * least 1. Omit for the single exact solve from each epoch's `initialGuess`. */
113
- coarseSearchSeeds?: number;
114
- /** Positive PDOP ceiling applied to every epoch; a fix that exceeds it (or is
115
- * rank-deficient) becomes that epoch's error. */
116
- maxPdop?: number;
117
- }
118
-
119
- /** Serialized observability tier label. Handle getters return the generated
120
- * `ObservabilityTier` enum; serde-returning APIs use these stable labels. */
121
- export type ObservabilityTierLabel = "RankDeficient" | "ZeroRedundancy" | "Weak" | "Nominal";
122
-
123
- /** Geometry observability and covariance-validation diagnostics.
124
- * `ZeroRedundancy` marks a full-rank design with no residual degrees of freedom,
125
- * so snapshot covariance bounds are unvalidated unless a propagated prior is
126
- * present. `Weak` means a condition-number or GDOP cutoff was exceeded; the
127
- * returned bounds are reported as computed and are not clamped. */
128
- export interface GeometryQualityObject {
129
- tier: ObservabilityTierLabel;
130
- /** Observation redundancy, `nObs - nParams`. */
131
- redundancy: number;
132
- /** Rank of the design matrix used by the solve. */
133
- rank: number;
134
- /** Singular-value condition number of the design matrix. */
135
- conditionNumber: number;
136
- /** Geometric dilution of precision for the solved state. */
137
- gdop: number;
138
- /** Whether residual-based RAIM can test the solve. */
139
- raimCheckable: boolean;
140
- /** Whether residuals or a propagated prior validated the covariance bound. */
141
- covarianceValidated: boolean;
142
- }
143
-
144
- // --- Source localization ----------------------------------------------------
145
- //
146
- // Source-localization functions deserialize inputs and serialize outputs through
147
- // serde, so wasm-bindgen types them as `any`. Import:
148
- //
149
- // import { locateSource } from "@neilberkman/sidereon";
150
- // import type { SourceSensor, SourceLocateOptions, SourceSolution } from "@neilberkman/sidereon/types";
151
-
152
- /** One source-localization sensor. Coordinates are caller-chosen Cartesian metres. */
153
- export interface SourceSensor {
154
- positionM: number[];
155
- /** Per-sensor propagation speed, metres per second. */
156
- propagationSpeedMS?: number;
157
- }
158
-
159
- /** Source solve mode selector. */
160
- export type SourceSolveMode = "toa" | { mode: "tdoa"; referenceSensor: number };
161
-
162
- /** Options for `locateSource`. */
163
- export interface SourceLocateOptions {
164
- mode?: "toa" | "tdoa";
165
- referenceSensor?: number;
166
- timingSigmaS?: number;
167
- loss?: "linear" | "softL1" | "soft_l1" | "huber" | "cauchy" | "arctan";
168
- fScaleS?: number;
169
- ftol?: number;
170
- xtol?: number;
171
- gtol?: number;
172
- maxNfev?: number;
173
- }
174
-
175
- /** Closed-form seed used by source localization. */
176
- export interface SourceInitialGuess {
177
- positionM: number[];
178
- originTimeS?: number;
179
- residualRmsS: number;
180
- }
181
-
182
- /** One source-localization residual row. */
183
- export interface SourceResidual {
184
- sensorIndex: number;
185
- referenceSensorIndex?: number;
186
- residualS: number;
187
- }
188
-
189
- /** Per-sensor source-localization influence diagnostic. */
190
- export interface SourceSensorInfluence {
191
- sensorIndex: number;
192
- residualS: number;
193
- leaveOneOutResidualS?: number;
194
- positionDeltaM?: number;
195
- originTimeDeltaS?: number;
196
- lossWeight: number;
197
- score: number;
198
- }
199
-
200
- /** Source-localization covariance. */
201
- export interface SourceCovariance {
202
- state: number[][];
203
- positionM2: number[][];
204
- originTimeS2?: number;
205
- timingSigmaS: number;
206
- }
207
-
208
- /** Source solution returned by `locateSource`. */
209
- export interface SourceSolution {
210
- positionM: number[];
211
- originTimeS?: number;
212
- covariance?: SourceCovariance;
213
- residuals: SourceResidual[];
214
- perSensorInfluence: SourceSensorInfluence[];
215
- geometryQuality: GeometryQualityObject;
216
- initialGuess: SourceInitialGuess;
217
- status: number;
218
- nfev: number;
219
- njev: number;
220
- cost: number;
221
- optimality: number;
222
- }
223
-
224
- /** DOP scalars returned by `sourceDop` and nested in `sourceCrlb`. */
225
- export interface SourceDop {
226
- gdop: number;
227
- pdop: number;
228
- hdop: number;
229
- vdop: number;
230
- tdop: number;
231
- systemTdops: { system: string; tdop: number }[];
232
- }
233
-
234
- /** Cramer-Rao lower bound returned by `sourceCrlb`. */
235
- export interface SourceCrlb {
236
- dop: SourceDop;
237
- covariance: SourceCovariance;
238
- }
239
-
240
- // --- Observable-domain plain-object inputs ----------------------------------
241
- //
242
- // The wasm-bindgen surface types these arguments as `any` because they cross
243
- // the boundary through serde. These are the precise shapes accepted. Import:
244
- //
245
- // import { detectCycleSlips } from "@neilberkman/sidereon";
246
- // import type { ArcEpoch } from "@neilberkman/sidereon/types";
247
-
248
- /** One epoch in a single-satellite carrier-phase arc. Phases are cycles, code
249
- * values metres, carrier frequencies hertz, `gapTimeS` any comparable seconds
250
- * coordinate. Any field may be omitted. */
251
- export interface ArcEpoch {
252
- phi1Cycles?: number;
253
- phi2Cycles?: number;
254
- p1M?: number;
255
- p2M?: number;
256
- lli1?: number;
257
- lli2?: number;
258
- f1Hz?: number;
259
- f2Hz?: number;
260
- gapTimeS?: number;
261
- }
262
-
263
- /** Options controlling carrier-phase cycle-slip classification. */
264
- export interface CycleSlipOptions {
265
- /** Geometry-free step threshold, metres. Defaults to 0.05. */
266
- gfThresholdM?: number;
267
- /** Melbourne-Wubbena step threshold, wide-lane cycles. Defaults to 4.0. */
268
- mwThresholdCycles?: number;
269
- /** Data-gap threshold, seconds. Defaults to 300.0. */
270
- minArcGapS?: number;
271
- }
272
-
273
- /** One satellite observation for a receiver velocity solve. */
274
- export interface VelocityObservation {
275
- /** RINEX satellite token, e.g. "G07". */
276
- satelliteId: string;
277
- /** Pseudorange rate (m/s) for range-rate solves, or Doppler (Hz) for Doppler. */
278
- value: number;
279
- /** Carrier frequency, hertz, used for Doppler conversion. */
280
- carrierHz: number;
281
- /** Satellite clock drift, seconds per second. Defaults to 0. */
282
- satClockDriftSS?: number;
283
- }
284
-
285
- /** Options controlling receiver velocity solving. */
286
- export interface VelocitySolveOptions {
287
- /** Observation value convention. Defaults to "range_rate". */
288
- observable?: "range_rate" | "doppler";
289
- /** Apply fixed-point light-time correction. Defaults to true. */
290
- lightTime?: boolean;
291
- /** Apply Earth-rotation Sagnac correction. Defaults to true. */
292
- sagnac?: boolean;
293
- }
294
-
295
- /** One satellite/elevation row for sigma or weight construction. */
296
- export interface WeightEntry {
297
- satelliteId: string;
298
- /** Topocentric elevation, degrees. */
299
- elevationDeg: number;
300
- /** Optional carrier-to-noise density, dB-Hz. */
301
- cn0Dbhz?: number;
302
- }
303
-
304
- /** Options for pseudorange variance weighting. */
305
- export interface PseudorangeVarianceOptions {
306
- /** Zenith-floor term, metres. Defaults to 0.3. */
307
- aM?: number;
308
- /** Elevation-scaled term, metres. Defaults to 0.3. */
309
- bM?: number;
310
- /** Variance model. Defaults to "elevation". */
311
- model?: "elevation" | "elevation_cn0";
312
- /** Carrier-to-noise density, dB-Hz (required for "elevation_cn0"). */
313
- cn0Dbhz?: number;
314
- /** C/N0 variance scale, square metres. Defaults to 1.0. */
315
- cn0ScaleM2?: number;
316
- }
317
-
318
- /** One satellite-keyed pseudorange for ionosphere-free combination. */
319
- export interface PseudorangeObservation {
320
- satelliteId: string;
321
- /** Pseudorange, metres. */
322
- valueM: number;
323
- }
324
-
325
- /** A per-constellation RINEX band override for pseudorange combination. */
326
- export interface PseudorangeBandOverride {
327
- /** Single RINEX system character, e.g. "G". */
328
- system: string;
329
- /** Band-1 RINEX observation code. */
330
- band1: string;
331
- /** Band-2 RINEX observation code. */
332
- band2: string;
333
- }
334
-
335
- /** GPS C/A replica generation options. */
336
- export interface ReplicaOptions {
337
- /** Sampling rate, hertz. Defaults to 2_046_000. */
338
- sampleRateHz?: number;
339
- /** Output sample count. Defaults to 2046. */
340
- numSamples?: number;
341
- /** Initial C/A code phase, chips. Defaults to 0. */
342
- codePhaseChips?: number;
343
- /** Code-rate Doppler, hertz. Defaults to 0. */
344
- codeDopplerHz?: number;
345
- }
346
-
347
- /** Coherent GPS C/A correlation options. */
348
- export interface CorrelateOptions {
349
- sampleRateHz?: number;
350
- dopplerHz?: number;
351
- codePhaseChips?: number;
352
- codeDopplerHz?: number;
353
- }
354
-
355
- /** GPS C/A acquisition search options. */
356
- export interface AcquisitionOptions {
357
- sampleRateHz?: number;
358
- dopplerMinHz?: number;
359
- dopplerMaxHz?: number;
360
- dopplerStepHz?: number;
361
- }
362
-
363
- // --- Orbit propagation ------------------------------------------------------
364
- //
365
- // `propagateState(request)` deserializes its argument through serde, so
366
- // wasm-bindgen types it as `any`. This is the precise shape it accepts. Import:
367
- //
368
- // import { propagateState } from "@neilberkman/sidereon";
369
- // import type { PropagateStateRequest } from "@neilberkman/sidereon/types";
370
-
371
- /** Space-weather constants for a drag request. */
372
- export interface SpaceWeatherConfig {
373
- f107?: number;
374
- f107a?: number;
375
- ap?: number;
376
- }
377
-
378
- /** Atmospheric drag parameterization. */
379
- export interface DragConfig {
380
- bcFactorM2Kg?: number;
381
- ballisticCoefficientKgM2?: number;
382
- cd?: number;
383
- areaM2?: number;
384
- massKg?: number;
385
- cutoffAltitudeKm?: number;
386
- spaceWeather?: SpaceWeatherConfig;
387
- }
388
-
389
- /** Cannonball solar-radiation-pressure parameters. */
390
- export interface SolarRadiationPressureConfig {
391
- cr: number;
392
- areaToMassM2Kg?: number;
393
- areaM2?: number;
394
- massKg?: number;
395
- pressureNM2?: number;
396
- auKm?: number;
397
- }
398
-
399
- /** Zonal harmonic gravity selector. */
400
- export interface ZonalForceConfig {
401
- maxDegree?: 2 | 3 | 4 | 5 | 6;
402
- j2?: boolean;
403
- j3?: boolean;
404
- j4?: boolean;
405
- j5?: boolean;
406
- j6?: boolean;
407
- muKm3S2?: number;
408
- reKm?: number;
409
- coefficients?: {
410
- j2?: number;
411
- j3?: number;
412
- j4?: number;
413
- j5?: number;
414
- j6?: number;
415
- };
416
- }
417
-
418
- /** Embedded EGM96 spherical-harmonic geopotential selector. */
419
- export interface SphericalHarmonicForceConfig {
420
- /** Constant set used with the embedded EGM96 coefficient table. Defaults to "earth". */
421
- model?: "earth" | "egm96" | "EGM96";
422
- /** Highest active harmonic degree. Defaults to 8 when omitted. */
423
- maxDegree?: number;
424
- /** Highest active harmonic order. Defaults to `maxDegree` when omitted. */
425
- maxOrder?: number;
426
- /** Alias for `maxDegree`. */
427
- degree?: number;
428
- /** Alias for `maxOrder`. */
429
- order?: number;
430
- }
431
-
432
- /** Sun/Moon third-body force selector. */
433
- export interface ThirdBodyForceConfig {
434
- sun?: boolean;
435
- moon?: boolean;
436
- gmSunKm3S2?: number;
437
- gmMoonKm3S2?: number;
438
- }
439
-
440
- /** Schwarzschild relativity force selector. */
441
- export interface RelativityForceConfig {
442
- muKm3S2?: number;
443
- cKmS?: number;
444
- }
445
-
446
- /** Additive numerical force-model composition. */
447
- export interface CompositeForceModelConfig {
448
- kind: "composite";
449
- twoBody?: boolean;
450
- twoBodyMuKm3S2?: number;
451
- muKm3S2?: number;
452
- zonal?: boolean | "none" | "j2" | "j2_j6" | "j2ThroughJ6" | ZonalForceConfig;
453
- sphericalHarmonic?: boolean | "none" | "earth" | "egm96" | SphericalHarmonicForceConfig;
454
- /** Alias for `sphericalHarmonic`. */
455
- geopotential?: boolean | "none" | "earth" | "egm96" | SphericalHarmonicForceConfig;
456
- thirdBody?: boolean | "none" | "sun" | "moon" | "sun_moon" | "sunMoon" | ThirdBodyForceConfig;
457
- solarRadiationPressure?: false | "none" | SolarRadiationPressureConfig;
458
- srp?: false | "none" | SolarRadiationPressureConfig;
459
- relativity?: boolean | "none" | "schwarzschild" | RelativityForceConfig;
460
- }
461
-
462
- /** Canonical Earth Phase A perturbation set. */
463
- export interface EarthPhaseAForceModelConfig {
464
- kind: "earth_phase_a" | "earthPhaseA";
465
- solarRadiationPressure?: false | "none" | SolarRadiationPressureConfig;
466
- srp?: false | "none" | SolarRadiationPressureConfig;
467
- }
468
-
469
- /** Canonical Earth Phase B perturbation set with embedded spherical harmonics. */
470
- export interface EarthPhaseBForceModelConfig {
471
- kind: "earth_phase_b" | "earthPhaseB";
472
- /** Highest active harmonic degree. Defaults to 8 when omitted. */
473
- maxDegree?: number;
474
- /** Highest active harmonic order. Defaults to `maxDegree` when omitted. */
475
- maxOrder?: number;
476
- /** Alias for `maxDegree`. */
477
- degree?: number;
478
- /** Alias for `maxOrder`. */
479
- order?: number;
480
- solarRadiationPressure?: false | "none" | SolarRadiationPressureConfig;
481
- srp?: false | "none" | SolarRadiationPressureConfig;
482
- }
483
-
484
- /** Numerical state-propagation force model selector. */
485
- export type ForceModel =
486
- | "two_body"
487
- | "two_body_j2"
488
- | "composite"
489
- | "earth_phase_a"
490
- | "earth_phase_b"
491
- | CompositeForceModelConfig
492
- | EarthPhaseAForceModelConfig
493
- | EarthPhaseBForceModelConfig;
494
-
495
- /** Numerical state-propagation integrator selector. */
496
- export type Integrator = "dp54" | "rk4";
497
-
498
- /** The object passed to `propagateState`. Position/velocity are length-3,
499
- * km / km/s; `timesS` are absolute TDB epochs (seconds). */
500
- export interface PropagateStateRequest {
501
- /** Initial-state epoch, TDB seconds. */
502
- epochS: number;
503
- /** Initial ECI position [x, y, z], km. */
504
- positionKm: [number, number, number];
505
- /** Initial ECI velocity [vx, vy, vz], km/s. */
506
- velocityKmS: [number, number, number];
507
- /** Output sample epochs, TDB seconds, monotonic in the propagation direction. */
508
- timesS: number[];
509
- /** Force model. Defaults to "two_body". */
510
- forceModel?: ForceModel;
511
- /** Integrator. Defaults to "dp54". */
512
- integrator?: Integrator;
513
- /** Absolute tolerance (DP54). Defaults to 1e-9. */
514
- absTol?: number;
515
- /** Relative tolerance (DP54). Defaults to 1e-12. */
516
- relTol?: number;
517
- /** Initial step, seconds. Defaults to 60. Must be positive. */
518
- initialStepS?: number;
519
- /** Minimum step, seconds. Defaults to 1e-6. */
520
- minStepS?: number;
521
- /** Maximum step, seconds. Defaults to 3600. */
522
- maxStepS?: number;
523
- /** Maximum integrator steps. Defaults to 1_000_000. */
524
- maxSteps?: number;
525
- /** Gravitational parameter, km^3/s^2. Defaults to Earth's MU_EARTH. */
526
- muKm3S2?: number;
527
- /** Atmospheric drag layered on the selected force model. */
528
- drag?: DragConfig;
529
- }
530
-
531
- // --- 0.15 capability payloads ----------------------------------------------
532
-
533
- /** Sidereal filter template selector. */
534
- export type SiderealTemplateMethod =
535
- "mean" | "robustMad" | "robust_mad" | { method: "ewma"; alpha: number };
536
-
537
- /** Options for `siderealFilter(series, periodS, options)`. */
538
- export interface SiderealFilterOptions {
539
- sampleIntervalS?: number;
540
- priorPeriods?: number;
541
- minCoverage?: number;
542
- templateMethod?: SiderealTemplateMethod;
543
- }
544
-
545
- /** Result returned by `siderealFilter`. */
546
- export interface SiderealFilterOutput {
547
- filtered: number[];
548
- template: number[];
549
- coverage: number[];
550
- underCovered: boolean[];
551
- }
552
-
553
- /** One period score returned by `periodicityStrength`. */
554
- export interface PeriodicityStrength {
555
- periodS: number;
556
- strength: number;
557
- }
558
-
559
- /** WGS84 geodetic coordinate in radians and metres. */
560
- export interface GeodeticCoordinate {
561
- latRad: number;
562
- lonRad: number;
563
- heightM?: number;
564
- }
565
-
566
- /** One geodetic time-series sample. */
567
- export interface PositionTimeSeriesSample {
568
- epochYear: number;
569
- positionM: [number, number, number];
570
- covarianceM2?: [[number, number, number], [number, number, number], [number, number, number]];
571
- }
572
-
573
- /** Position-series frame selector. */
574
- export type PositionSeriesFrame =
575
- "enu" | { kind: "enu" } | { kind: "ecef"; reference: GeodeticCoordinate };
576
-
577
- /** Station position time series passed to geodetic time-series functions. */
578
- export interface PositionTimeSeries {
579
- samples: PositionTimeSeriesSample[];
580
- frame?: PositionSeriesFrame;
581
- }
582
-
583
- /** MIDAS velocity options. */
584
- export interface MidasOptions {
585
- dominantPeriodYears?: number;
586
- periodToleranceYears?: number;
587
- minPairs?: number;
588
- }
589
-
590
- /** One MIDAS component diagnostic. */
591
- export interface MidasComponentStats {
592
- pairCount: number;
593
- retainedPairCount: number;
594
- slopeSigmaMPerYr: number;
595
- effectivePairCount: number;
596
- }
597
-
598
- /** Result returned by `velocityMidas`. */
599
- export interface MidasVelocity {
600
- rateEnuMPerYr: [number, number, number];
601
- sigmaEnuMPerYr: [number, number, number];
602
- covarianceEnuM2PerYr2: [
603
- [number, number, number],
604
- [number, number, number],
605
- [number, number, number],
606
- ];
607
- componentStats: [MidasComponentStats, MidasComponentStats, MidasComponentStats];
608
- sampleCount: number;
609
- spanYears: number;
610
- quality: "nominal" | "shortSpan";
611
- }
612
-
613
- /** Trajectory model controls for `fitTrajectory`. */
614
- export interface TrajectoryModelOptions {
615
- referenceEpochYear?: number;
616
- includeAnnual?: boolean;
617
- includeSemiannual?: boolean;
618
- offsetEpochsYear?: number[];
619
- }
620
-
621
- /** Trajectory fit options. */
622
- export interface TrajectoryFitOptions {
623
- loss?: "linear" | "softL1" | "soft_l1" | "huber" | "cauchy" | "arctan";
624
- fScaleM?: number;
625
- maxNfev?: number;
626
- }
627
-
628
- /** One term in a fitted trajectory model. */
629
- export interface TrajectoryTerm {
630
- kind:
631
- | "position"
632
- | "velocity"
633
- | "annualSin"
634
- | "annualCos"
635
- | "semiannualSin"
636
- | "semiannualCos"
637
- | "offset";
638
- index?: number;
639
- epochYear?: number;
640
- }
641
-
642
- /** One ENU component in a trajectory fit. */
643
- export interface TrajectoryComponent {
644
- positionM: number;
645
- velocityMPerYr: number;
646
- annualSinM?: number;
647
- annualCosM?: number;
648
- semiannualSinM?: number;
649
- semiannualCosM?: number;
650
- offsetsM: number[];
651
- }
652
-
653
- /** Result returned by `fitTrajectory`. */
654
- export interface TrajectoryFit {
655
- referenceEpochYear: number;
656
- terms: TrajectoryTerm[];
657
- components: [TrajectoryComponent, TrajectoryComponent, TrajectoryComponent];
658
- parameterCovariance: number[][];
659
- residualRmsEnuM: [number, number, number];
660
- geometryQuality: GeometryQualityObject;
661
- status: number;
662
- nfev: number;
663
- njev: number;
664
- cost: number;
665
- optimality: number;
666
- }
667
-
668
- /** Step detection options. */
669
- export interface StepDetectionOptions {
670
- windowYears?: number;
671
- scoreThreshold?: number;
672
- minOffsetM?: number;
673
- minSamplesEachSide?: number;
674
- minSeparationYears?: number;
675
- midas?: MidasOptions;
676
- }
677
-
678
- /** Candidate returned by `detectSteps`. */
679
- export interface StepCandidate {
680
- epochYear: number;
681
- offsetEnuM: [number, number, number];
682
- score: number;
683
- beforeCount: number;
684
- afterCount: number;
685
- heuristic: "detrendedSlidingMedian";
686
- }
687
-
688
- /** Network field request passed to `networkField`. */
689
- export interface NetworkFieldRequest {
690
- frame: { origin: GeodeticCoordinate; removeCommonMode?: boolean };
691
- stations: { id: string; reference: GeodeticCoordinate; series: PositionTimeSeries }[];
692
- }
693
-
694
- /** Result returned by `networkField`. */
695
- export interface NetworkField {
696
- frame: { origin: Required<GeodeticCoordinate>; removeCommonMode: boolean };
697
- stations: {
698
- id: string;
699
- rateEnuMPerYr: [number, number, number];
700
- rawRateEnuMPerYr: [number, number, number];
701
- sigmaEnuMPerYr: [number, number, number];
702
- localVelocity: MidasVelocity;
703
- }[];
704
- commonModeEnuMPerYr: [number, number, number];
705
- }
706
-
707
- /** Minimal kinematic solution accepted by `metricsFromKinematicSolution`. */
708
- export interface KinematicMetricInput {
709
- positionM: [number, number, number];
710
- positionCovarianceM2: [
711
- [number, number, number],
712
- [number, number, number],
713
- [number, number, number],
714
- ];
715
- clockM?: number;
716
- ztdResidualM?: number;
717
- usedSats?: string[];
718
- innovationRmsM?: number;
719
- }
720
-
721
- /** Allan-family deviation curve used by `fitPowerLawNoise`. */
722
- export interface AllanDeviationCurve {
723
- tauS: number[];
724
- deviation: number[];
725
- n: number[];
726
- }
727
-
728
- /** Power-law clock-noise fit options. */
729
- export interface PowerLawNoiseOptions {
730
- minPointsPerOctave?: number;
731
- slopeTolerance?: number;
732
- scatterTolerance?: number;
733
- basicTauS?: number;
734
- measurementBandwidthHz?: number;
735
- }
736
-
737
- /** Power-law octave decision. */
738
- export type PowerLawOctaveDominance =
739
- | {
740
- kind: "dominant";
741
- noiseType: "randomWalkFM" | "flickerFM" | "whiteFM" | "flickerPM" | "whitePM";
742
- }
743
- | { kind: "ambiguous" }
744
- | { kind: "flagged"; flag: "underSampled" | "degenerateDeviation" | "missingModifiedAllan" };
745
-
746
- /** One classified clock-noise tau octave. */
747
- export interface PowerLawOctave {
748
- tauStartS: number;
749
- tauEndS: number;
750
- pointCount: number;
751
- adevSlope?: number;
752
- mdevSlope?: number;
753
- slopeScatter?: number;
754
- dominance: PowerLawOctaveDominance;
755
- }
756
-
757
- /** One fitted clock-noise coefficient region. */
758
- export interface PowerLawNoiseRegion {
759
- noiseType: "randomWalkFM" | "flickerFM" | "whiteFM" | "flickerPM" | "whitePM";
760
- tauStartS: number;
761
- tauEndS: number;
762
- octaveCount: number;
763
- pointCount: number;
764
- meanSlope: number;
765
- coefficient: number;
766
- }
767
-
768
- /** Result returned by `fitPowerLawNoise`. */
769
- export interface PowerLawNoiseFit {
770
- dominantPerOctave: PowerLawOctave[];
771
- coefficients: [number, number, number, number, number];
772
- regions: PowerLawNoiseRegion[];
773
- }
774
-
775
- /** Numerical orbit-fit options. */
776
- export interface OrbitFitOptions {
777
- forceModel?: ForceModel;
778
- muKm3S2?: number;
779
- integrator?: Integrator;
780
- integratorOptions?: Pick<
781
- PropagateStateRequest,
782
- "absTol" | "relTol" | "initialStepS" | "minStepS" | "maxStepS" | "maxSteps"
783
- >;
784
- solverOptions?: { gtol?: number; ftol?: number; xtol?: number; maxNfev?: number };
785
- linearSolve?: "nalgebraLu" | "nalgebra_lu" | "ownedGaussianFirstTie" | "owned_gaussian_first_tie";
786
- minLedgerSamples?: number;
787
- drag?: DragConfig;
788
- }
789
-
790
- /** Fitted orbit covariance marker. */
791
- export type OrbitFitCovariance = { kind: "estimated"; matrix: number[][] } | { kind: "unbounded" };
792
-
793
- /** One satellite solution in an orbit-fit report. */
794
- export interface OrbitFitSolution {
795
- satellite: string;
796
- initialEpochS: number;
797
- initialPositionKm: [number, number, number];
798
- initialVelocityKmS: [number, number, number];
799
- covariance: OrbitFitCovariance;
800
- geometryQuality: GeometryQualityObject;
801
- seedRms3dM: number;
802
- fitRms3dM: number;
803
- iterations: number;
804
- }
805
-
806
- /** One RTN residual ledger entry. */
807
- export interface OrbitResidualStats {
808
- radialRmsM: number;
809
- alongRmsM: number;
810
- crossRmsM: number;
811
- rms3dM: number;
812
- n: number;
813
- lowSampleCount: boolean;
814
- }
815
-
816
- /** Orbit residual ledger returned in an orbit-fit report. */
817
- export interface OrbitResidualLedger {
818
- perSatellite: { satellite: string; stats: OrbitResidualStats }[];
819
- perConstellation: { system: string; stats: OrbitResidualStats }[];
820
- arcSpan: { timeScale: string; startJ2000S: number; endJ2000S: number; durationS: number };
821
- }
822
-
823
- /** Report returned by the SP3, ECEF SP3, and sample-backed orbit-fit entries. */
824
- export interface OrbitFitReport {
825
- fits: OrbitFitSolution[];
826
- ledger: OrbitResidualLedger;
827
- }
828
-
829
- // --- Covariance propagation -------------------------------------------------
830
- //
831
- // `propagateCovariance(request)` and `transportCovariance(covariance, segments,
832
- // options)` deserialize through serde. These interfaces document the accepted
833
- // JS objects and plain object fields returned by the related table APIs.
834
-
835
- /** Covariance reference frame label. */
836
- export type CovarianceFrameLabel = "inertial" | "rtn";
837
-
838
- /** RTN acceleration process-noise power spectral densities. */
839
- export interface CovarianceProcessNoise {
840
- qRadialKm2S3?: number;
841
- qTransverseKm2S3?: number;
842
- qNormalKm2S3?: number;
843
- }
844
-
845
- /** Space-weather constants embedded in a covariance drag request. */
846
- export interface CovarianceDragSpaceWeather {
847
- f107?: number;
848
- f107a?: number;
849
- ap?: number;
850
- }
851
-
852
- /** Drag parameterization for covariance propagation. */
853
- export interface CovarianceDragConfig {
854
- bcFactorM2Kg?: number;
855
- ballisticCoefficientKgM2?: number;
856
- cd?: number;
857
- areaM2?: number;
858
- massKg?: number;
859
- cutoffAltitudeKm?: number;
860
- spaceWeather?: CovarianceDragSpaceWeather;
861
- }
862
-
863
- /** The object passed to `propagateCovariance`. */
864
- export interface CovariancePropagationRequest {
865
- epochS: number;
866
- positionKm: [number, number, number];
867
- velocityKmS: [number, number, number];
868
- covariance: number[] | Float64Array;
869
- timesS: number[];
870
- covarianceFrame?: CovarianceFrameLabel;
871
- outputFrame?: CovarianceFrameLabel;
872
- processNoise?: CovarianceProcessNoise;
873
- forceModel?: ForceModel;
874
- integrator?: Integrator;
875
- absTol?: number;
876
- relTol?: number;
877
- initialStepS?: number;
878
- minStepS?: number;
879
- maxStepS?: number;
880
- maxSteps?: number;
881
- muKm3S2?: number;
882
- drag?: CovarianceDragConfig;
883
- }
884
-
885
- /** One STM segment passed to `transportCovariance`. */
886
- export interface CovarianceTransportSegment {
887
- stateTransitionMatrix: number[] | Float64Array;
888
- dtS: number;
889
- qRotationEpochS: number;
890
- qRotationPositionKm: [number, number, number];
891
- qRotationVelocityKmS: [number, number, number];
892
- }
893
-
894
- /** Options passed as the third argument to `transportCovariance`. */
895
- export interface CovarianceTransportOptions {
896
- processNoise?: CovarianceProcessNoise;
897
- }
898
-
899
- // --- SGP4 fitting -----------------------------------------------------------
900
- //
901
- // `fitTle(samples, config)` accepts TEME state samples plus solver controls and
902
- // returns `TleFit.elements` / `TleFit.stats` as serde plain objects.
903
-
904
- /** One TEME state sample for `fitTle`. */
905
- export interface TleFitSample {
906
- epoch: [number, number];
907
- positionTemeKm: [number, number, number];
908
- velocityTemeKmS?: [number, number, number];
909
- }
910
-
911
- /** Metadata copied into the fitted TLE and OMM encodings. */
912
- export interface TleFitMetadata {
913
- catalogNumber?: number;
914
- classification?: "U" | "C" | "S";
915
- internationalDesignator?: string;
916
- elementSetNumber?: number;
917
- revAtEpoch?: number;
918
- objectName?: string;
919
- }
920
-
921
- /** Solver controls for `fitTle`. */
922
- export interface TleFitConfig {
923
- epoch?: "midpoint" | "first" | "last";
924
- epochSampleIndex?: number;
925
- epochJd?: [number, number];
926
- fitBstar?: boolean;
927
- bstarSeed?: number;
928
- useVelocity?: boolean;
929
- velocityWeightS?: number;
930
- weights?: number[];
931
- opsMode?: "improved" | "afspc";
932
- ftol?: number;
933
- xtol?: number;
934
- gtol?: number;
935
- maxNfev?: number;
936
- xScale?: "unit" | "jac" | number[];
937
- loss?: "linear" | "softL1" | "soft_l1" | "huber" | "cauchy" | "arctan";
938
- fScale?: number;
939
- metadata?: TleFitMetadata;
940
- }
941
-
942
- /** `TleFit.stats` plain object. */
943
- export interface TleFitStatistics {
944
- rms_position_km: number;
945
- max_position_km: number;
946
- rms_position_axes_km: [number, number, number];
947
- rms_velocity_km_s?: number;
948
- tle_rms_position_km: number;
949
- status: number;
950
- nfev: number;
951
- njev: number;
952
- cost: number;
953
- optimality: number;
954
- bstar_observable: boolean;
955
- seed_refine_passes: number;
956
- }
957
-
958
- /** `TleFit.elements` plain object. */
959
- export interface TleFitElements {
960
- epoch: [number, number];
961
- bstar: number;
962
- mean_motion_dot: number;
963
- mean_motion_double_dot: number;
964
- eccentricity: number;
965
- argument_of_perigee_deg: number;
966
- inclination_deg: number;
967
- mean_anomaly_deg: number;
968
- mean_motion_rev_per_day: number;
969
- right_ascension_deg: number;
970
- catalog_number: number;
971
- }
972
-
973
- // --- NMEA -------------------------------------------------------------------
974
- //
975
- // `parseNmea`, `NmeaAccumulator.push/finish`, and `nmeaWriteGga` use serde
976
- // plain objects for sentence bodies, diagnostics, epochs, and writer requests.
977
-
978
- /** Calendar date used by NMEA epoch recovery. */
979
- export interface NmeaDate {
980
- year: number;
981
- month: number;
982
- day: number;
983
- }
984
-
985
- /** NMEA time of day. */
986
- export interface NmeaTimeOfDay {
987
- hour: number;
988
- minute: number;
989
- second: number;
990
- nanos: number;
991
- decimals: number;
992
- }
993
-
994
- /** NMEA latitude, longitude, and ellipsoidal height. */
995
- export interface NmeaPosition {
996
- latDeg: number;
997
- lonDeg: number;
998
- heightM: number;
999
- }
1000
-
1001
- /** Shared NMEA parser diagnostics. */
1002
- export interface NmeaDiagnostics {
1003
- skipCount: number;
1004
- warningCount: number;
1005
- skips: unknown[];
1006
- warnings: unknown[];
1007
- }
1008
-
1009
- /** One satellite ID used by an NMEA GSA epoch. */
1010
- export interface NmeaUsedSatellite {
1011
- raw: number;
1012
- resolved?: string;
1013
- }
1014
-
1015
- /** One parsed or accumulated NMEA epoch. */
1016
- export interface NmeaEpoch {
1017
- timeOfDay: NmeaTimeOfDay;
1018
- date?: NmeaDate;
1019
- position: NmeaPosition;
1020
- instantUtcJ2000S?: number;
1021
- pdop?: number;
1022
- hdop?: number;
1023
- vdop?: number;
1024
- usedSatellites: NmeaUsedSatellite[];
1025
- satellitesInView: number;
1026
- sentenceCount: number;
1027
- diagnostics: NmeaDiagnostics;
1028
- gga?: Record<string, unknown>;
1029
- rmc?: Record<string, unknown>;
1030
- gll?: Record<string, unknown>;
1031
- gst?: Record<string, unknown>;
1032
- vtg?: Record<string, unknown>;
1033
- zda?: Record<string, unknown>;
1034
- gsa: Record<string, unknown>[];
1035
- gsv: Record<string, unknown>[];
1036
- }
1037
-
1038
- /** Plain object returned by `NmeaAccumulator.push/finish`. */
1039
- export interface NmeaAccumulatorResult {
1040
- sentences: Record<string, unknown>[];
1041
- epochs: NmeaEpoch[];
1042
- diagnostics: NmeaDiagnostics;
1043
- retainedLength: number;
1044
- }
1045
-
1046
- /** Constructor options for `NmeaAccumulator`. */
1047
- export interface NmeaAccumulatorOptions {
1048
- date?: NmeaDate;
1049
- maxSentencesPerEpoch?: number;
1050
- }
1051
-
1052
- /** The object passed to `nmeaWriteGga`. */
1053
- export interface NmeaGgaRequest {
1054
- talker?: string;
1055
- timeSecondsOfDay: number;
1056
- latDeg: number;
1057
- lonDeg: number;
1058
- coordinateDecimals?: number;
1059
- quality?: number;
1060
- satellitesUsed?: number;
1061
- hdop?: number;
1062
- altitudeMslM?: number;
1063
- geoidSeparationM?: number;
1064
- differentialAgeS?: number;
1065
- differentialStationId?: string;
1066
- }
1067
-
1068
- // --- NTRIP sans-IO ----------------------------------------------------------
1069
-
1070
- /** Basic authentication credentials for NTRIP request construction. */
1071
- export interface NtripCredentials {
1072
- username: string;
1073
- password: string;
1074
- }
1075
-
1076
- /** NTRIP revision label accepted by request and state-machine configs. */
1077
- export type NtripVersionLabel = "rev1" | "rev2";
1078
-
1079
- /** Config object for `ntripRequestBytes` and `new NtripClientMachine(config)`. */
1080
- export interface NtripRequestConfig {
1081
- host: string;
1082
- port?: number;
1083
- mountpoint?: string;
1084
- version?: NtripVersionLabel;
1085
- credentials?: NtripCredentials;
1086
- userAgentProduct?: string;
1087
- ggaIntervalS?: number;
1088
- }
1089
-
1090
- /** Header row surfaced on NTRIP connection events. */
1091
- export interface NtripHeader {
1092
- name: string;
1093
- value: string;
1094
- }
1095
-
1096
- /** Event emitted by `NtripClientMachine.push/finish`. */
1097
- export type NtripClientEvent =
1098
- | {
1099
- kind: "connected";
1100
- version?: NtripVersionLabel;
1101
- chunked?: boolean;
1102
- headers?: NtripHeader[];
1103
- payload?: undefined;
1104
- sourcetable?: undefined;
1105
- rejection?: undefined;
1106
- detail?: undefined;
1107
- }
1108
- | {
1109
- kind: "payload";
1110
- payload: number[];
1111
- version?: undefined;
1112
- chunked?: undefined;
1113
- headers?: undefined;
1114
- sourcetable?: undefined;
1115
- rejection?: undefined;
1116
- detail?: undefined;
1117
- }
1118
- | {
1119
- kind: "sourcetable";
1120
- sourcetable: NtripSourcetable;
1121
- version?: undefined;
1122
- chunked?: undefined;
1123
- headers?: undefined;
1124
- payload?: undefined;
1125
- rejection?: undefined;
1126
- detail?: undefined;
1127
- }
1128
- | {
1129
- kind: "rejected" | "streamCorrupted" | "streamEnded";
1130
- detail?: string;
1131
- rejection?: unknown;
1132
- version?: undefined;
1133
- chunked?: undefined;
1134
- headers?: undefined;
1135
- payload?: undefined;
1136
- sourcetable?: undefined;
1137
- };
1138
-
1139
- /** Parsed scalar wrapper used by NTRIP sourcetable fields. */
1140
- export type NtripParsed<T> =
1141
- { kind: "parsed"; value: T } | { kind: "missing" } | { kind: "invalid"; raw: string };
1142
-
1143
- /** One STR row in an NTRIP sourcetable. */
1144
- export interface NtripStreamRecord {
1145
- typeTag: "STR";
1146
- mountpoint: string;
1147
- identifier: string;
1148
- format: string;
1149
- formatDetails: string;
1150
- carrier: NtripParsed<number>;
1151
- navSystem: string;
1152
- network: string;
1153
- country: string;
1154
- latDeg: NtripParsed<number>;
1155
- lonDeg: NtripParsed<number>;
1156
- nmeaRequired: NtripParsed<boolean>;
1157
- networkSolution: NtripParsed<boolean>;
1158
- generator: string;
1159
- compression: string;
1160
- authentication: string;
1161
- fee: NtripParsed<boolean>;
1162
- bitrate: NtripParsed<number>;
1163
- misc: string;
1164
- }
1165
-
1166
- /** Parsed NTRIP sourcetable. */
1167
- export interface NtripSourcetable {
1168
- recordCount: number;
1169
- streamCount: number;
1170
- streams: NtripStreamRecord[];
1171
- records: Record<string, unknown>[];
1172
- diagnostics: unknown[];
1173
- }
1174
-
1175
- // --- Space weather ----------------------------------------------------------
1176
-
1177
- /** CelesTrak CSSI table coverage. */
1178
- export interface SpaceWeatherCoverage {
1179
- firstJ2000S: number;
1180
- lastObservedJ2000S: number;
1181
- lastDailyPredictedJ2000S: number;
1182
- endJ2000S: number;
1183
- }
1184
-
1185
- /** One daily CSSI space-weather row. */
1186
- export interface SpaceWeatherDay {
1187
- year: number;
1188
- month: number;
1189
- day: number;
1190
- class: "observed" | "dailyPredicted";
1191
- bsrn: number;
1192
- nd: number;
1193
- kp: number[];
1194
- kpSum: number;
1195
- ap: number[];
1196
- apAvg: number;
1197
- cp: number;
1198
- c9: number;
1199
- isn: number;
1200
- fluxQualifier?: string;
1201
- f107Obs: number;
1202
- f107Adj: number;
1203
- f107ObsCenter81: number;
1204
- f107ObsLast81: number;
1205
- f107AdjCenter81: number;
1206
- f107AdjLast81: number;
1207
- }
1208
-
1209
- /** One monthly predicted CSSI row. */
1210
- export interface SpaceWeatherMonthly {
1211
- year: number;
1212
- month: number;
1213
- f107: number;
1214
- f107a: number;
1215
- ap?: number;
1216
- }
1217
-
1218
- /** Sample returned by `SpaceWeatherTable.sampleAt`. */
1219
- export interface SpaceWeatherSample {
1220
- f107: number;
1221
- f107a: number;
1222
- ap: number;
1223
- class: "observed" | "dailyPredicted" | "monthlyPredicted";
1224
- apDefaulted: boolean;
1225
- }
1226
-
1227
- /** Optional table sampling policy. */
1228
- export interface SpaceWeatherSamplePolicy {
1229
- defaultMonthlyAp?: number;
1230
- }
1231
-
1232
- /** Decay request passed to `estimateDecayWithSpaceWeather`. */
1233
- export interface SpaceWeatherDecayRequest {
1234
- epochS: number;
1235
- positionKm: [number, number, number];
1236
- velocityKmS: [number, number, number];
1237
- scanStepS?: number;
1238
- maxDurationS?: number;
1239
- maxScanSamples?: number;
1240
- reentryAltitudeKm?: number;
1241
- crossingToleranceS?: number;
1242
- }
1243
-
1244
- /** Decay result returned by `estimateDecayWithSpaceWeather`. */
1245
- export interface SpaceWeatherDecayResult {
1246
- timeToDecayS: number;
1247
- reentryEpochS: number;
1248
- reentryPositionKm: [number, number, number];
1249
- reentryVelocityKmS: [number, number, number];
1250
- reentryAltitudeKm: number;
1251
- }
1252
-
1253
- // --- RINEX QC and repair ----------------------------------------------------
1254
-
1255
- /** Location attached to a RINEX lint finding. */
1256
- export interface RinexFindingRef {
1257
- epochIndex?: number;
1258
- satellite?: string;
1259
- field?: string;
1260
- }
1261
-
1262
- /** One lint finding from `lintRinexObs` or `lintRinexNav`. */
1263
- export interface RinexFinding {
1264
- code: string;
1265
- severity: "fatal" | "error" | "warning" | "info";
1266
- specRef: string;
1267
- repairable: boolean;
1268
- at: RinexFindingRef;
1269
- detail: string;
1270
- }
1271
-
1272
- /** Shared RINEX lint report. */
1273
- export interface RinexLintReport {
1274
- clean: boolean;
1275
- decodedFromCrinex: boolean;
1276
- findingCount: number;
1277
- counts: { fatal: number; error: number; warning: number; info: number };
1278
- findings: RinexFinding[];
1279
- }
1280
-
1281
- /** Options accepted by `repairRinexObs`. */
1282
- export interface RinexObsRepairOptions {
1283
- fileStamp?: string;
1284
- setInterval?: boolean;
1285
- setTimeOfLastObs?: boolean;
1286
- setObsCounts?: boolean;
1287
- dropEmptyRecords?: boolean;
1288
- sortRecords?: boolean;
1289
- }
1290
-
1291
- /** Options accepted by `repairRinexNav`. */
1292
- export interface RinexNavRepairOptions {
1293
- fileStamp?: string;
1294
- dropUnsupported?: boolean;
1295
- sortRecords?: boolean;
1296
- }
1297
-
1298
- /** Options accepted by `observationQc`. */
1299
- export interface ObservationQcOptions {
1300
- intervalOverrideS?: number;
1301
- gapFactor?: number;
1302
- clockJumpThresholdS?: number;
1303
- }
1304
-
1305
- /** Civil epoch used inside observation QC report rows. */
1306
- export interface ObservationQcEpochTime {
1307
- year: number;
1308
- month: number;
1309
- day: number;
1310
- hour: number;
1311
- minute: number;
1312
- second: number;
1313
- }
1314
-
1315
- /** One detected gap between adjacent observation epochs. */
1316
- export interface ObservationQcDataGap {
1317
- startEpoch: ObservationQcEpochTime;
1318
- endEpoch: ObservationQcEpochTime;
1319
- nominalIntervalS: number;
1320
- observedDeltaS: number;
1321
- missingEpochs: number;
1322
- }
1323
-
1324
- /** One detected receiver-clock jump. */
1325
- export interface ObservationQcClockJump {
1326
- epochIndex: number;
1327
- deltaS: number;
1328
- }
1329
-
1330
- /** One satellite summary in an observation QC report. */
1331
- export interface ObservationQcSatellite {
1332
- satellite: string;
1333
- epochsWithObservations: number;
1334
- valueObservations: number;
1335
- }
1336
-
1337
- /** Signal-strength indicator histogram. */
1338
- export interface ObservationQcSsi {
1339
- counts: number[];
1340
- }
1341
-
1342
- /** SNR summary for one signal. */
1343
- export interface ObservationQcSnr {
1344
- n: number;
1345
- mean: number;
1346
- min: number;
1347
- max: number;
1348
- std: number;
1349
- }
1350
-
1351
- /** One satellite/signal summary in an observation QC report. */
1352
- export interface ObservationQcSatelliteSignal {
1353
- satellite: string;
1354
- code: string;
1355
- valueObservations: number;
1356
- ssi: ObservationQcSsi;
1357
- snr?: ObservationQcSnr;
1358
- }
1359
-
1360
- /** One system/signal summary in an observation QC report. */
1361
- export interface ObservationQcSystemSignal {
1362
- system: string;
1363
- code: string;
1364
- valueObservations: number;
1365
- ssi: ObservationQcSsi;
1366
- snr?: ObservationQcSnr;
1367
- }
1368
-
1369
- /** Per-system cycle-slip summary in an observation QC report. */
1370
- export interface ObservationQcSystemCycleSlip {
1371
- system: string;
1372
- observations: number;
1373
- slips: number;
1374
- observationsPerSlip?: number;
1375
- }
1376
-
1377
- /** Cycle-slip summary in an observation QC report. */
1378
- export interface ObservationQcCycleSlips {
1379
- observations: number;
1380
- totalSlips: number;
1381
- observationsPerSlip?: number;
1382
- bySystem: ObservationQcSystemCycleSlip[];
1383
- }
1384
-
1385
- /** MP1 or MP2 multipath RMS statistics. */
1386
- export interface ObservationQcMpStats {
1387
- n: number;
1388
- rmsM: number;
1389
- }
1390
-
1391
- /** Per-satellite multipath summary in an observation QC report. */
1392
- export interface ObservationQcSatelliteMultipath {
1393
- satellite: string;
1394
- mp1?: ObservationQcMpStats;
1395
- mp2?: ObservationQcMpStats;
1396
- }
1397
-
1398
- /** Per-system multipath summary in an observation QC report. */
1399
- export interface ObservationQcSystemMultipath {
1400
- system: string;
1401
- mp1?: ObservationQcMpStats;
1402
- mp2?: ObservationQcMpStats;
1403
- }
1404
-
1405
- /** Multipath summary in an observation QC report. */
1406
- export interface ObservationQcMultipath {
1407
- satellites: ObservationQcSatelliteMultipath[];
1408
- systems: ObservationQcSystemMultipath[];
1409
- }
1410
-
1411
- /** Non-fatal observation QC note. */
1412
- export interface ObservationQcNote {
1413
- kind: string;
1414
- epochIndex?: number;
1415
- }
1416
-
1417
- /** Report object returned by `observationQc`. */
1418
- export interface ObservationQcReport {
1419
- totalEpochRecords: number;
1420
- observationEpochs: number;
1421
- eventRecords: number;
1422
- powerFailureEpochs: number;
1423
- skippedRecords: number;
1424
- intervalS?: number;
1425
- intervalSource?: string;
1426
- missingEpochs: number;
1427
- dataGaps: ObservationQcDataGap[];
1428
- clockJumps: ObservationQcClockJump[];
1429
- cycleSlips: ObservationQcCycleSlips;
1430
- multipath: ObservationQcMultipath;
1431
- satellites: ObservationQcSatellite[];
1432
- satelliteSignals: ObservationQcSatelliteSignal[];
1433
- systemSignals: ObservationQcSystemSignal[];
1434
- notes: ObservationQcNote[];
1435
- renderText(): string;
1436
- renderHtml(): string;
1437
- toJson(): string;
1438
- }
1439
-
1440
- // --- RTK baseline solving ---------------------------------------------------
1441
- //
1442
- // `solveRtkFloat(config)` / `solveRtkFixed(config)` deserialize through serde.
1443
- // These are the precise shapes accepted. Import:
1444
- //
1445
- // import { solveRtkFloat } from "@neilberkman/sidereon";
1446
- // import type { RtkFloatConfig } from "@neilberkman/sidereon/types";
1447
-
1448
- /** RTK stochastic weighting model selector. */
1449
- export type RtkStochasticModel = "simple" | "rtklib";
1450
-
1451
- /** One satellite's base/rover measurements for an RTK epoch. */
1452
- export interface RtkSatMeasurement {
1453
- sat: string;
1454
- sdAmbiguityId: string;
1455
- baseCodeM: number;
1456
- basePhaseM: number;
1457
- roverCodeM: number;
1458
- roverPhaseM: number;
1459
- baseTxPos: [number, number, number];
1460
- roverTxPos: [number, number, number];
1461
- pos: [number, number, number];
1462
- }
1463
-
1464
- /** One RTK epoch with reference and non-reference satellite rows. */
1465
- export interface RtkEpoch {
1466
- references: RtkSatMeasurement[];
1467
- nonref: RtkSatMeasurement[];
1468
- dtS: number;
1469
- velocityMps?: [number, number, number];
1470
- }
1471
-
1472
- /** RTK measurement weighting and correction model. */
1473
- export interface RtkMeasurementModel {
1474
- codeSigmaM: number;
1475
- phaseSigmaM: number;
1476
- /** Apply the Earth-rotation Sagnac correction. Defaults to true. */
1477
- sagnac?: boolean;
1478
- /** Stochastic model. Defaults to "simple". */
1479
- stochastic?: RtkStochasticModel;
1480
- /** Elevation-weight measurements (simple model only). Defaults to false. */
1481
- elevationWeighting?: boolean;
1482
- }
1483
-
1484
- /** Iteration controls for an RTK float solve. */
1485
- export interface RtkFloatOptions {
1486
- positionTolM?: number;
1487
- ambiguityTolM?: number;
1488
- maxIterations?: number;
1489
- }
1490
-
1491
- /** Iteration and integer-search controls for RTK fixed solving. */
1492
- export interface RtkFixedOptions {
1493
- positionTolM?: number;
1494
- ambiguityTolM?: number;
1495
- maxIterations?: number;
1496
- ratioThreshold?: number;
1497
- partialAmbiguityResolution?: boolean;
1498
- partialMinAmbiguities?: number;
1499
- }
1500
-
1501
- /** Residual validation controls for RTK fixed solving. */
1502
- export interface RtkResidualValidationOptions {
1503
- /** Per-residual rejection threshold in sigma, or null/omitted to disable. */
1504
- thresholdSigma?: number | null;
1505
- maxExclusions?: number;
1506
- }
1507
-
1508
- /** The object passed to `solveRtkFloat`. */
1509
- export interface RtkFloatConfig {
1510
- epochs: RtkEpoch[];
1511
- /** Known base receiver ECEF position [x, y, z], metres. */
1512
- base: [number, number, number];
1513
- ambiguityIds: string[];
1514
- model: RtkMeasurementModel;
1515
- /** Rover-minus-base ECEF baseline seed, metres. Defaults to [0, 0, 0]. */
1516
- initialBaselineM?: [number, number, number];
1517
- options?: RtkFloatOptions;
1518
- }
1519
-
1520
- /** The object passed to `solveRtkFixed`. */
1521
- export interface RtkFixedConfig {
1522
- epochs: RtkEpoch[];
1523
- base: [number, number, number];
1524
- ambiguityIds: string[];
1525
- /** Ambiguity id -> satellite token. */
1526
- ambiguitySatellites: Record<string, string>;
1527
- /** Ambiguity id -> wavelength, metres. */
1528
- wavelengthsM: Record<string, number>;
1529
- /** Ambiguity id -> offset, metres. */
1530
- offsetsM: Record<string, number>;
1531
- model: RtkMeasurementModel;
1532
- floatOptions?: RtkFloatOptions;
1533
- fixedOptions?: RtkFixedOptions;
1534
- residualOptions?: RtkResidualValidationOptions;
1535
- /** Systems kept float-only (never integer-fixed), e.g. ["R"]. */
1536
- floatOnlySystems?: string[];
1537
- initialBaselineM?: [number, number, number];
1538
- }
1539
-
1540
- // --- PPP solving ------------------------------------------------------------
1541
- //
1542
- // `solvePppFloat(sp3, epochs, initialState, config)` / `solvePppFixed(...)`
1543
- // take serde-`any` arrays and objects. Import:
1544
- //
1545
- // import { solvePppFloat } from "@neilberkman/sidereon";
1546
- // import type { PppEpoch, PppFloatConfig } from "@neilberkman/sidereon/types";
1547
-
1548
- /** Civil epoch timestamp for a PPP epoch. */
1549
- export interface PppCivilDateTime {
1550
- year: number;
1551
- month: number;
1552
- day: number;
1553
- hour: number;
1554
- minute: number;
1555
- second: number;
1556
- }
1557
-
1558
- /** One ionosphere-free code/phase observation in a PPP epoch. */
1559
- export interface PppObservation {
1560
- satelliteId: string;
1561
- ambiguityId: string;
1562
- /** Ionosphere-free code, metres. */
1563
- codeM: number;
1564
- /** Ionosphere-free carrier phase, metres. */
1565
- phaseM: number;
1566
- freq1Hz?: number;
1567
- freq2Hz?: number;
1568
- }
1569
-
1570
- /** One static PPP epoch. */
1571
- export interface PppEpoch {
1572
- civil: PppCivilDateTime;
1573
- jdWhole: number;
1574
- jdFraction: number;
1575
- tRxJ2000S: number;
1576
- observations: PppObservation[];
1577
- }
1578
-
1579
- /** Initial PPP state. */
1580
- export interface PppFloatState {
1581
- positionM: [number, number, number];
1582
- /** Per-epoch receiver clocks, metres. */
1583
- clocksM: number[];
1584
- /** Ambiguity id -> initial ambiguity, metres. */
1585
- ambiguitiesM: Record<string, number>;
1586
- /** Initial zenith tropospheric delay, metres. Defaults to 0. */
1587
- ztdM?: number;
1588
- }
1589
-
1590
- /** PPP measurement weights. */
1591
- export interface PppMeasurementWeights {
1592
- code?: number;
1593
- phase?: number;
1594
- elevationWeighting?: boolean;
1595
- }
1596
-
1597
- /** One VMF1 site-wise `a`-coefficient sample (00/06/12/18 UT node). */
1598
- export interface VmfSiteSample {
1599
- /** Modified Julian date of the sample. */
1600
- mjd: number;
1601
- /** Hydrostatic `a` coefficient. */
1602
- ah: number;
1603
- /** Wet `a` coefficient. */
1604
- aw: number;
1605
- }
1606
-
1607
- /** PPP troposphere controls. */
1608
- export interface PppTroposphereOptions {
1609
- enabled?: boolean;
1610
- estimateZtd?: boolean;
1611
- pressureHpa?: number;
1612
- temperatureK?: number;
1613
- relativeHumidity?: number;
1614
- /**
1615
- * Vienna Mapping Function 1 site-wise `a`-coefficient series. When one or
1616
- * more strictly-ascending samples are supplied the zenith delays are mapped
1617
- * with VMF1; otherwise the climatological Niell (1996) mapping is used.
1618
- */
1619
- vmf1?: VmfSiteSample[];
1620
- }
1621
-
1622
- /** Iteration and convergence controls for PPP. */
1623
- export interface PppFloatOptions {
1624
- maxIterations?: number;
1625
- positionToleranceM?: number;
1626
- clockToleranceM?: number;
1627
- ambiguityToleranceM?: number;
1628
- ztdToleranceM?: number;
1629
- }
1630
-
1631
- /** The config object passed to `solvePppFloat`. */
1632
- export interface PppFloatConfig {
1633
- weights?: PppMeasurementWeights;
1634
- tropo?: PppTroposphereOptions;
1635
- options?: PppFloatOptions;
1636
- residualScreen?: boolean;
1637
- }
1638
-
1639
- /** Integer ambiguity controls for PPP fixed solving. */
1640
- export interface PppFixedAmbiguityOptions {
1641
- /** Ambiguity id -> wavelength, metres. */
1642
- wavelengthsM: Record<string, number>;
1643
- /** Ambiguity id -> offset, metres. */
1644
- offsetsM: Record<string, number>;
1645
- ratioThreshold?: number;
1646
- }
1647
-
1648
- /** The config object passed to `solvePppFixed`. */
1649
- export interface PppFixedConfig {
1650
- ambiguity: PppFixedAmbiguityOptions;
1651
- weights?: PppMeasurementWeights;
1652
- tropo?: PppTroposphereOptions;
1653
- options?: PppFloatOptions;
1654
- }
1655
-
1656
- // --- Static PPP correction precompute ---------------------------------------
1657
- //
1658
- // `pppCorrections(sp3, epochs, receiverEcefM, options?)` deserializes `epochs`
1659
- // and `options` through serde and returns the correction tables as a plain
1660
- // object (typed `any` by wasm-bindgen). Import:
1661
- //
1662
- // import { pppCorrections } from "@neilberkman/sidereon";
1663
- // import type { PppCorrectionsOptions, PppCorrections } from "@neilberkman/sidereon/types";
1664
-
1665
- /** One satellite observation row (carrier frequencies) for the precompute. */
1666
- export interface PppCorrectionObservation {
1667
- satelliteId: string;
1668
- freq1Hz: number;
1669
- freq2Hz: number;
1670
- }
1671
-
1672
- /** One receiver epoch for the correction precompute: civil UTC date/time, the
1673
- * receive time as continuous seconds since J2000, and the visible-satellite rows. */
1674
- export interface PppCorrectionEpoch {
1675
- year: number;
1676
- month: number;
1677
- day: number;
1678
- hour: number;
1679
- minute: number;
1680
- second: number;
1681
- tRxJ2000S: number;
1682
- observations: PppCorrectionObservation[];
1683
- }
1684
-
1685
- /** Solid-earth pole-tide options: the IERS polar motion of the date (arcsec),
1686
- * sourced from IERS EOP (the engine does not embed polar motion). */
1687
- export interface PoleTideOptions {
1688
- xpArcsec: number;
1689
- ypArcsec: number;
1690
- }
1691
-
1692
- /** Per-station ocean-loading BLQ coefficients (Bos-Scherneck / HARDISP format).
1693
- *
1694
- * `amplitudeM` (metres) and `phaseDeg` (degrees, positive lag) are each a
1695
- * `3 x 11` nested array indexed `[component][constituent]`: component order is
1696
- * radial/up (0), tangential EW/west (1), tangential NS/south (2); constituent
1697
- * order is the BLQ columns M2 S2 N2 K2 K1 O1 P1 Q1 Mf Mm Ssa. */
1698
- export interface OceanLoadingBlq {
1699
- amplitudeM: number[][];
1700
- phaseDeg: number[][];
1701
- }
1702
-
1703
- /** Frequency-dependent satellite antenna calibration. */
1704
- export interface PppSatelliteAntennaFrequency {
1705
- label: string;
1706
- /** Body-frame phase-centre offset `[x, y, z]`, metres. */
1707
- pcoM: [number, number, number];
1708
- /** Nadir-angle no-azimuth PCV samples as `[nadirDeg, pcvM]` pairs. */
1709
- noaziPcvM: [number, number][];
1710
- }
1711
-
1712
- /** One satellite's antenna block, selected by PRN and an optional validity window. */
1713
- export interface PppSatelliteAntenna {
1714
- sat: string;
1715
- validFrom?: PppCivilDateTime;
1716
- validUntil?: PppCivilDateTime;
1717
- frequencies: PppSatelliteAntennaFrequency[];
1718
- }
1719
-
1720
- /** Satellite-antenna correction options. */
1721
- export interface PppSatelliteAntennaOptions {
1722
- freq1Label: string;
1723
- freq1Hz: number;
1724
- freq2Label: string;
1725
- freq2Hz: number;
1726
- antennas: PppSatelliteAntenna[];
1727
- }
1728
-
1729
- /** The optional options object passed to `pppCorrections`. Omit a field to leave
1730
- * that correction off. */
1731
- export interface PppCorrectionsOptions {
1732
- /** Compute the per-epoch solid-earth tide displacement. */
1733
- solidEarthTide?: boolean;
1734
- /** Compute the per-satellite carrier-phase wind-up. */
1735
- phaseWindup?: boolean;
1736
- /** Compute the satellite antenna PCO/PCV projection. */
1737
- satelliteAntenna?: PppSatelliteAntennaOptions;
1738
- /** Compute the solid-earth pole tide (needs the date's IERS polar motion). */
1739
- poleTide?: PoleTideOptions;
1740
- /** Compute ocean tide loading from the station's BLQ block. */
1741
- oceanLoading?: OceanLoadingBlq;
1742
- }
1743
-
1744
- /** A per-epoch ECEF displacement correction. */
1745
- export interface PppEpochVectorCorrection {
1746
- /** Index into the input `epochs` array. */
1747
- epochIndex: number;
1748
- /** ECEF displacement `[dx, dy, dz]`, metres. */
1749
- vectorM: [number, number, number];
1750
- }
1751
-
1752
- /** A per-satellite, per-epoch scalar correction (metres). */
1753
- export interface PppSatScalarCorrection {
1754
- sat: string;
1755
- epochIndex: number;
1756
- valueM: number;
1757
- }
1758
-
1759
- /** A per-satellite, per-epoch ECEF vector correction (metres). */
1760
- export interface PppSatVectorCorrection {
1761
- sat: string;
1762
- epochIndex: number;
1763
- vectorM: [number, number, number];
1764
- }
1765
-
1766
- /** The correction tables returned by `pppCorrections`. Each list is keyed by the
1767
- * input epoch index; lists for corrections that were not requested are empty. */
1768
- export interface PppCorrections {
1769
- /** Solid-earth tide displacement per epoch. */
1770
- tide: PppEpochVectorCorrection[];
1771
- /** Solid-earth pole-tide displacement per epoch. */
1772
- poleTide: PppEpochVectorCorrection[];
1773
- /** Ocean tide loading displacement per epoch. */
1774
- oceanLoading: PppEpochVectorCorrection[];
1775
- /** Carrier-phase wind-up per satellite per epoch, metres. */
1776
- windupM: PppSatScalarCorrection[];
1777
- /** Satellite antenna PCO projected into ECEF per satellite per epoch, metres. */
1778
- satPcoEcef: PppSatVectorCorrection[];
1779
- /** Satellite antenna nadir PCV per satellite per epoch, metres. */
1780
- satPcvM: PppSatScalarCorrection[];
1781
- }
1782
-
1783
- // --- SP3 merge --------------------------------------------------------------
1784
- //
1785
- // `mergeSp3(sources, options?)` deserializes `options` through serde. Import:
1786
- //
1787
- // import { mergeSp3 } from "@neilberkman/sidereon";
1788
- // import type { Sp3MergeOptions } from "@neilberkman/sidereon/types";
1789
-
1790
- /** How agreeing SP3 sources are combined in `mergeSp3`. */
1791
- export type Sp3MergeCombine = "mean" | "median" | "precedence";
1792
-
1793
- /** The options object passed to `mergeSp3`. All fields optional. */
1794
- export interface Sp3MergeOptions {
1795
- /** Max agreeing-source 3D position difference, metres. Defaults to 0.5. */
1796
- positionToleranceM?: number;
1797
- /** Max agreeing-source clock difference after alignment, seconds. Defaults to 5e-9. */
1798
- clockToleranceS?: number;
1799
- /** Minimum agreeing sources for a multi-source cell. Defaults to 2. */
1800
- minAgree?: number;
1801
- /** Minimum common clocked satellites for clock-datum alignment. Defaults to 5. */
1802
- clockMinCommon?: number;
1803
- /** Consensus combination policy. Defaults to "mean". */
1804
- combine?: Sp3MergeCombine;
1805
- /** Output epoch spacing, seconds, or null for the coarsest input grid. */
1806
- targetEpochIntervalS?: number | null;
1807
- /** Optional system filter as RINEX letters/names (e.g. ["G", "C"]). */
1808
- systems?: string[] | null;
1809
- }
1810
-
1811
- // --- DOP series -------------------------------------------------------------
1812
- //
1813
- // `gnssDopSeries(sp3, stationEcefM, j2000Seconds, options?)` deserializes
1814
- // `options` through serde. Import:
1815
- //
1816
- // import { gnssDopSeries } from "@neilberkman/sidereon";
1817
- // import type { GnssDopSeriesOptions } from "@neilberkman/sidereon/types";
1818
-
1819
- /** DOP row weighting selector for `gnssDopSeries`. */
1820
- export type DopWeighting = "unit" | "elevation";
1821
-
1822
- /** The options object passed to `gnssDopSeries`. All fields optional. */
1823
- export interface GnssDopSeriesOptions {
1824
- /** Explicit satellite tokens (e.g. ["G01", "G02"]); omit for a visibility scan. */
1825
- satellites?: string[];
1826
- /** Minimum topocentric elevation, degrees. Defaults to 5. */
1827
- elevationMaskDeg?: number;
1828
- /** Constellation filter as RINEX letters/names (e.g. ["G"]). */
1829
- systems?: string[];
1830
- /** Row weighting policy. Defaults to "unit". */
1831
- weighting?: DopWeighting;
1832
- /** Apply light-time + Sagnac corrections forming the line of sight. Defaults to false. */
1833
- lightTime?: boolean;
1834
- }
1835
-
1836
- // --- CDM construction -------------------------------------------------------
1837
- //
1838
- // `new CdmObject(positionKm, velocityKmS, covarianceRtn, meta?)` and
1839
- // `new Cdm(object1, object2, meta?)` deserialize their `meta` object through
1840
- // serde. Import:
1841
- //
1842
- // import { Cdm, CdmObject } from "@neilberkman/sidereon";
1843
- // import type { CdmObjectMeta, CdmMeta } from "@neilberkman/sidereon/types";
1844
-
1845
- /** Optional metadata for a `CdmObject`: the full CCSDS 508.0-B-1 object metadata
1846
- * block plus the optional RTN velocity-covariance rows. Every string field is the
1847
- * verbatim textual value; omitted fields are not emitted on encode. */
1848
- export interface CdmObjectMeta {
1849
- objectDesignator?: string;
1850
- catalogName?: string;
1851
- objectName?: string;
1852
- internationalDesignator?: string;
1853
- objectType?: string;
1854
- operatorContactPosition?: string;
1855
- operatorOrganization?: string;
1856
- operatorPhone?: string;
1857
- operatorEmail?: string;
1858
- ephemerisName?: string;
1859
- covarianceMethod?: string;
1860
- maneuverable?: string;
1861
- orbitCenter?: string;
1862
- refFrame?: string;
1863
- gravityModel?: string;
1864
- atmosphericModel?: string;
1865
- nBodyPerturbations?: string;
1866
- solarRadPressure?: string;
1867
- earthTides?: string;
1868
- intrackThrust?: string;
1869
- /** RTN velocity-covariance rows completing the 6x6 matrix, a length-15 array in
1870
- * CCSDS order (`CRDOT_R` .. `CNDOT_NDOT`). Omit when only the position
1871
- * covariance block is carried. */
1872
- velocityCovarianceRtn?: number[];
1873
- }
1874
-
1875
- /** Optional message-level fields for a `Cdm`. */
1876
- export interface CdmMeta {
1877
- creationDate?: string;
1878
- originator?: string;
1879
- messageId?: string;
1880
- tca?: string;
1881
- missDistanceM?: number;
1882
- relativeSpeedMS?: number;
1883
- collisionProbability?: number;
1884
- collisionProbabilityMethod?: string;
1885
- hardBodyRadiusM?: number;
1886
- }
1887
-
1888
- // --- OMM construction -------------------------------------------------------
1889
- //
1890
- // `new Omm(epoch, meanMotion, ..., noradCatId, meta?)` deserializes its `meta`
1891
- // object through serde. Import:
1892
- //
1893
- // import { Omm } from "@neilberkman/sidereon";
1894
- // import type { OmmMeta } from "@neilberkman/sidereon/types";
1895
-
1896
- /** Optional OMM fields; each defaults to the CCSDS-standard value. */
1897
- export interface OmmMeta {
1898
- ccsdsOmmVers?: string;
1899
- creationDate?: string;
1900
- originator?: string;
1901
- objectName?: string;
1902
- objectId?: string;
1903
- centerName?: string;
1904
- refFrame?: string;
1905
- timeSystem?: string;
1906
- meanElementTheory?: string;
1907
- ephemerisType?: number;
1908
- classificationType?: string;
1909
- elementSetNo?: number;
1910
- revAtEpoch?: number;
1911
- bstar?: number;
1912
- meanMotionDot?: number;
1913
- meanMotionDdot?: number;
1914
- }
1915
-
1916
- // --- DGNSS ------------------------------------------------------------------
1917
- //
1918
- // `Sp3.dgnssCorrections(request)`, `Sp3.dgnssSolve(request)`, and
1919
- // `dgnssApply(roverObservations, corrections)` deserialize their plain-object
1920
- // arguments through serde, so wasm-bindgen types them as `any`. Import:
1921
- //
1922
- // import { dgnssApply } from "@neilberkman/sidereon";
1923
- // import type { DgnssSolveRequest } from "@neilberkman/sidereon/types";
1924
-
1925
- /** One code (pseudorange) observation. */
1926
- export interface DgnssCodeObservation {
1927
- satelliteId: string;
1928
- pseudorangeM: number;
1929
- }
1930
-
1931
- /** One per-satellite pseudorange correction; the element type of the array
1932
- * returned by `Sp3.dgnssCorrections` and accepted by `dgnssApply`. */
1933
- export interface DgnssCorrectionEntry {
1934
- satelliteId: string;
1935
- correctionM: number;
1936
- }
1937
-
1938
- /** The object passed to `Sp3.dgnssCorrections`. */
1939
- export interface DgnssCorrectionsRequest {
1940
- /** Surveyed base ECEF position [x, y, z], metres. */
1941
- basePositionM: [number, number, number];
1942
- baseObservations: DgnssCodeObservation[];
1943
- /** Receive epoch, seconds since J2000 in the ephemeris time scale. */
1944
- tRxJ2000S: number;
1945
- }
1946
-
1947
- /** The object passed to `Sp3.dgnssSolve`. */
1948
- export interface DgnssSolveRequest {
1949
- /** Surveyed base ECEF position [x, y, z], metres. */
1950
- basePositionM: [number, number, number];
1951
- baseObservations: DgnssCodeObservation[];
1952
- roverObservations: DgnssCodeObservation[];
1953
- tRxJ2000S: number;
1954
- tRxSecondOfDayS: number;
1955
- dayOfYear: number;
1956
- /** Initial state guess [x, y, z, clock]; defaults to [0, 0, 0, 0]. */
1957
- initialGuess?: [number, number, number, number];
1958
- /** Populate WGS84 lat/lon/height in the result. Defaults to true. */
1959
- withGeodetic?: boolean;
1960
- }
1961
-
1962
- // --- Fault detection and exclusion (FDE) ------------------------------------
1963
- //
1964
- // `Sp3.fde(request)` deserializes its argument through serde. Import:
1965
- //
1966
- // import { loadSp3 } from "@neilberkman/sidereon";
1967
- // import type { FdeRequest } from "@neilberkman/sidereon/types";
1968
-
1969
- /** One per-satellite RAIM residual weight. */
1970
- export interface RaimWeightEntry {
1971
- satelliteId: string;
1972
- weight: number;
1973
- }
1974
-
1975
- /** The object passed to `Sp3.fde`: the SPP solve inputs plus the RAIM /
1976
- * exclusion options. */
1977
- export interface FdeRequest {
1978
- observations: SppObservation[];
1979
- tRxJ2000S: number;
1980
- tRxSecondOfDayS: number;
1981
- dayOfYear: number;
1982
- initialGuess?: [number, number, number, number];
1983
- corrections?: SppCorrections;
1984
- klobuchar?: SppKlobuchar;
1985
- met?: SppSurfaceMet;
1986
- glonassChannels?: [number, number][];
1987
- withGeodetic?: boolean;
1988
- /** RAIM false-alarm probability in the open interval (0, 1); defaults to the
1989
- * core RAIM default. */
1990
- pFa?: number;
1991
- /** Per-satellite RAIM weights; absent or empty means unit weights. */
1992
- weights?: RaimWeightEntry[];
1993
- /** Override for the number of distinct GNSS clock systems. */
1994
- nSystems?: number;
1995
- /** Maximum exclusions; defaults to max(observationCount - 4, 0). */
1996
- maxIterations?: number;
1997
- /** Optional PDOP ceiling applied to each candidate solution. */
1998
- maxPdop?: number;
1999
- }
2000
-
2001
- // --- Broadcast-vs-precise comparison ----------------------------------------
2002
- //
2003
- // `BroadcastEphemeris.compareToSp3(...)` and the window-form
2004
- // `BroadcastEphemeris.compareWindowToSp3(...)` both return a plain object typed
2005
- // `any` with the `BroadcastCompareReport` shape below. Import:
2006
- //
2007
- // import { loadRinexNav } from "@neilberkman/sidereon";
2008
- // import type { BroadcastCompareReport } from "@neilberkman/sidereon/types";
2009
-
2010
- /** Difference statistics for one satellite (or the overall set). Every metre
2011
- * field is `null` when no compared epoch populated it. */
2012
- export interface BroadcastCompareStats {
2013
- count: number;
2014
- orbit3dRmsM: number | null;
2015
- orbit3dMaxM: number | null;
2016
- radialRmsM: number | null;
2017
- radialMaxM: number | null;
2018
- alongRmsM: number | null;
2019
- alongMaxM: number | null;
2020
- crossRmsM: number | null;
2021
- crossMaxM: number | null;
2022
- clockRmsM: number | null;
2023
- clockMaxM: number | null;
2024
- clockDatumRemovedRmsM: number | null;
2025
- clockDatumRemovedMaxM: number | null;
2026
- }
2027
-
2028
- /** The report returned by `BroadcastEphemeris.compareToSp3`. */
2029
- export interface BroadcastCompareReport {
2030
- overall: BroadcastCompareStats;
2031
- perSatellite: { satelliteId: string; stats: BroadcastCompareStats }[];
2032
- missing: { satelliteId: string; count: number }[];
2033
- }
2034
-
2035
- // --- GNSS constellation identity catalog -------------------------------------
2036
- //
2037
- // The constellation surface is JSON-in / JSON-out: every function takes and
2038
- // returns plain objects through serde, so wasm-bindgen types them as `any`.
2039
- // These are the precise shapes. Import:
2040
- //
2041
- // import { fromCelestrakJson, mergeNavcen } from "@neilberkman/sidereon";
2042
- // import type { ConstellationRecord } from "@neilberkman/sidereon/types";
2043
-
2044
- /** Lower-case constellation label, e.g. "gps". GPS is supported today. */
2045
- export type ConstellationSystem =
2046
- "gps" | "glonass" | "galileo" | "beidou" | "qzss" | "navic" | "sbas";
2047
-
2048
- /** CelesTrak `gps-ops` provenance preserved on a record. */
2049
- export interface CelestrakSource {
2050
- /** CelesTrak GP group the record came from ("gps-ops"). */
2051
- group: string;
2052
- /** The OMM OBJECT_NAME. */
2053
- objectName?: string;
2054
- /** The OMM OBJECT_ID (international designator). */
2055
- objectId?: string;
2056
- /** The OMM EPOCH, ISO-8601. */
2057
- epoch?: string;
2058
- /** Block type parsed from the object name ("IIF", "IIR", "IIR-M", "III"). */
2059
- blockType?: string;
2060
- }
2061
-
2062
- /** NAVCEN status provenance preserved on a record or recorded as a conflict. */
2063
- export interface NavcenSource {
2064
- /** Space Vehicle Number. */
2065
- svn?: number;
2066
- blockType?: string;
2067
- plane?: string;
2068
- slot?: string;
2069
- clock?: string;
2070
- /** NANU type code ("FCSTSUMM", "UNUSABLE", "DECOM", ...). */
2071
- nanuType?: string;
2072
- nanuSubject?: string;
2073
- /** Whether the row carried an active NANU. */
2074
- activeNanu: boolean;
2075
- }
2076
-
2077
- /** Per-source provenance kept on a record. */
2078
- export interface RecordSource {
2079
- celestrak?: CelestrakSource;
2080
- /** NAVCEN overlay merged into this record. */
2081
- navcen?: NavcenSource;
2082
- /** A NAVCEN row that matched the PRN but was not merged (a PRN transition). */
2083
- navcenConflict?: NavcenSource;
2084
- }
2085
-
2086
- /** A normalized GNSS satellite identity record, the element type of the array
2087
- * returned by `fromCelestrakJson` / `mergeNavcen` and accepted by the validate
2088
- * and diff functions. */
2089
- export interface ConstellationRecord {
2090
- system: ConstellationSystem;
2091
- /** Within-constellation PRN. */
2092
- prn: number;
2093
- /** Space Vehicle Number, when known (CelesTrak alone leaves this absent). */
2094
- svn?: number;
2095
- /** NORAD catalog id. */
2096
- noradId: number;
2097
- /** Canonical SP3/RINEX satellite token ("G03"). */
2098
- sp3Id: string;
2099
- /** GLONASS FDMA L1/L2 frequency-channel number (`k`, in -7..=6); absent for
2100
- * the CDMA constellations. */
2101
- fdmaChannel?: number;
2102
- /** Present in the base identity source. */
2103
- active: boolean;
2104
- /** Advisory usability flag. */
2105
- usable: boolean;
2106
- source: RecordSource;
2107
- }
2108
-
2109
- /** A parsed NAVCEN GPS constellation status row, the element type returned by
2110
- * `parseNavcen` and accepted by `mergeNavcen`. */
2111
- export interface NavcenStatus {
2112
- system: ConstellationSystem;
2113
- prn: number;
2114
- svn?: number;
2115
- /** Usable per the active NANU (if any). */
2116
- usable: boolean;
2117
- activeNanu: boolean;
2118
- nanuType?: string;
2119
- nanuSubject?: string;
2120
- plane?: string;
2121
- slot?: string;
2122
- blockType?: string;
2123
- clock?: string;
2124
- }
2125
-
2126
- /** A `(system, prn)` pair. Findings are keyed by system so a legitimate
2127
- * multi-system catalog (GPS PRN 1 and Galileo PRN 1) is not a false collision. */
2128
- export interface ConstellationSystemPrn {
2129
- system: ConstellationSystem;
2130
- prn: number;
2131
- }
2132
-
2133
- /** The report returned by `validate` / `validateAgainstSp3Ids`. */
2134
- export interface ConstellationValidation {
2135
- /** Active+usable catalog SP3 ids absent from the compared product. */
2136
- missingSp3Ids: string[];
2137
- /** (system, PRN) pairs that appear in more than one record. */
2138
- duplicatePrns: ConstellationSystemPrn[];
2139
- /** NORAD ids that appear in more than one record. */
2140
- duplicateNoradIds: number[];
2141
- /** (system, PRN) pairs that are inactive or unusable. */
2142
- inactiveUnusablePrns: ConstellationSystemPrn[];
2143
- /** SP3 ids in the product absent from the active+usable catalog. */
2144
- extraSp3Ids: string[];
2145
- }
2146
-
2147
- /** A single field change on a PRN held across both diffed snapshots. */
2148
- export interface ConstellationFieldChange<T> {
2149
- system: ConstellationSystem;
2150
- prn: number;
2151
- from: T;
2152
- to: T;
2153
- }
2154
-
2155
- /** The change report returned by `diff` and tested by `changed`. */
2156
- export interface ConstellationDiff {
2157
- /** PRNs present only in the current snapshot. */
2158
- added: ConstellationRecord[];
2159
- /** PRNs present only in the previous snapshot. */
2160
- removed: ConstellationRecord[];
2161
- noradReassigned: ConstellationFieldChange<number>[];
2162
- sp3IdChanged: ConstellationFieldChange<string>[];
2163
- svnChanged: ConstellationFieldChange<number | null>[];
2164
- /** GLONASS FDMA frequency-channel corrections on a held slot. */
2165
- fdmaChannelChanged: ConstellationFieldChange<number | null>[];
2166
- activityChanged: ConstellationFieldChange<boolean>[];
2167
- usabilityChanged: ConstellationFieldChange<boolean>[];
2168
- }
2169
-
2170
- /** An OMM entry `fromCelestrakJsonLenient` could not resolve to a record for the
2171
- * requested system, carrying its identity so the caller can triage the skip. */
2172
- export interface SkippedOmm {
2173
- /** The OMM OBJECT_NAME, when present. */
2174
- objectName?: string;
2175
- /** The OMM NORAD_CAT_ID. */
2176
- noradId: number;
2177
- }
2178
-
2179
- /** The result of `fromCelestrakJsonLenient`: the records that resolved for the
2180
- * requested system, plus the entries that did not. */
2181
- export interface ConstellationCatalog {
2182
- /** Records built from resolvable entries, sorted by `(system, prn)`. */
2183
- records: ConstellationRecord[];
2184
- /** Entries whose OBJECT_NAME did not resolve to a PRN for the system, in
2185
- * input order. */
2186
- skipped: SkippedOmm[];
2187
- }
2188
-
2189
- // --- Product-staleness selection + broadcast fallback -----------------------
2190
- //
2191
- // `selectIonex` / `selectSp3` (+ `*OverRange`) and `solveWithFallback` take an
2192
- // optional `policy` object typed `any`, and the selection/source metadata cross
2193
- // out of the result handles as plain objects typed `any`. These are the precise
2194
- // shapes. Import:
2195
- //
2196
- // import { selectSp3, solveWithFallback } from "@neilberkman/sidereon";
2197
- // import type { StalenessPolicy, FixSource } from "@neilberkman/sidereon/types";
2198
-
2199
- /** The optional staleness cap passed to the selection and fallback functions.
2200
- * Set at most one of the two fields; omit the argument entirely for the engine
2201
- * default cap of 3 days. */
2202
- export interface StalenessPolicy {
2203
- /** Maximum tolerated staleness, seconds. */
2204
- maxStalenessS?: number;
2205
- /** Maximum tolerated staleness, days. */
2206
- maxStalenessDays?: number;
2207
- }
2208
-
2209
- /** How a selected product's source epoch relates to the requested epoch.
2210
- * `"exact"` is no degradation; `"nearestPrior"` is the SP3 nearest-prior path;
2211
- * `"diurnalShift"` is the IONEX whole-day persistence path. */
2212
- export type DegradationKind = "exact" | "nearestPrior" | "diurnalShift";
2213
-
2214
- /** Staleness metadata attached to every selection and to a precise fix. Epochs
2215
- * are J2000 seconds; `stalenessS` is `requested - source` and never negative. */
2216
- export interface StalenessMetadata {
2217
- kind: DegradationKind;
2218
- requestedEpochJ2000S: number;
2219
- sourceEpochJ2000S: number;
2220
- stalenessS: number;
2221
- stalenessDays: number;
2222
- }
2223
-
2224
- /** The interpolated state returned by `Sp3Selection.positionAtJ2000Seconds`. */
2225
- export interface Sp3SelectionState {
2226
- positionM: [number, number, number];
2227
- /** Clock offset, seconds, or `null` for the bad-clock sentinel. */
2228
- clockS: number | null;
2229
- }
2230
-
2231
- /** The variant `name` of a selection failure. A selection function throws an
2232
- * `Error` whose `.name` is one of these and whose `.detail` is the matching
2233
- * `SelectionErrorDetail`. */
2234
- export type SelectionErrorName =
2235
- | "EmptyProductSet"
2236
- | "InvalidRange"
2237
- | "NoPriorProduct"
2238
- | "BeyondStalenessCap"
2239
- | "InvalidProduct"
2240
- | "InvalidPolicy"
2241
- | "Overflow";
2242
-
2243
- /** The structured `.detail` attached to a thrown selection `Error`. Only the
2244
- * fields the variant carries are present. */
2245
- export interface SelectionErrorDetail {
2246
- name: SelectionErrorName;
2247
- message: string;
2248
- requestedEpochJ2000S?: number;
2249
- startEpochJ2000S?: number;
2250
- endEpochJ2000S?: number;
2251
- sourceEpochJ2000S?: number;
2252
- stalenessS?: number;
2253
- maxStalenessS?: number;
2254
- context?: string;
2255
- }
2256
-
2257
- /** The structured `.detail` attached to a thrown `solveWithFallback` `Error`.
2258
- * `name` names which path's solve failed and `message` carries the underlying
2259
- * solve error. */
2260
- export interface FallbackErrorDetail {
2261
- name: "PreciseSolveError" | "BroadcastSolveError";
2262
- message: string;
2263
- }
2264
-
2265
- /** Why `solveWithFallback` produced a fix from broadcast ephemeris. */
2266
- export interface BroadcastReason {
2267
- kind: "preciseUnavailable" | "preciseDegradedUnusable";
2268
- /** The precise selection's rejection, for `"preciseUnavailable"`. */
2269
- selectionError: SelectionErrorDetail | null;
2270
- /** The tried precise product's staleness, for `"preciseDegradedUnusable"`. */
2271
- attemptedStaleness: StalenessMetadata | null;
2272
- /** The precise solve error that triggered the fallback, for
2273
- * `"preciseDegradedUnusable"`. */
2274
- preciseError: string | null;
2275
- }
2276
-
2277
- /** Which ephemeris source produced a `SourcedSolution`, read from
2278
- * `SourcedSolution.source`. For a precise fix `staleness` is the product's
2279
- * metadata and `broadcastReason` is `null`; for a broadcast fix `staleness` is
2280
- * `null` and `broadcastReason` records why precise was not used. */
2281
- export interface FixSource {
2282
- kind: "precise" | "broadcast";
2283
- isPrecise: boolean;
2284
- isBroadcast: boolean;
2285
- isPreciseExact: boolean;
2286
- staleness: StalenessMetadata | null;
2287
- broadcastReason: BroadcastReason | null;
2288
- }
2289
-
2290
- // --- Integer-ambiguity resolution (LAMBDA / bounded ILS) --------------------
2291
- //
2292
- // `lambdaIlsSearch(floatCycles, covariance, ratioThreshold)` and
2293
- // `boundedIlsSearch(floatCycles, covariance, radius, candidateLimit,
2294
- // ratioThreshold)` take the covariance as a row-major `number[][]` and return an
2295
- // `IlsResult` object (typed `any` by wasm-bindgen). Import:
2296
- //
2297
- // import { lambdaIlsSearch } from "@neilberkman/sidereon";
2298
- // import type { IlsResult } from "@neilberkman/sidereon/types";
2299
-
2300
- /** The outcome of an integer-least-squares search. */
2301
- export interface IlsResult {
2302
- /** Best integer vector, parallel to the input `floatCycles`. Cycle counts are
2303
- * small integers and cross as plain numbers (not BigInt). */
2304
- fixed: number[];
2305
- /** Whether the ratio test passes at the requested threshold. */
2306
- fixedStatus: boolean;
2307
- /** Runner-up / best score ratio. Saturates to `Number.MAX_VALUE` when the best
2308
- * score is exactly zero with a positive runner-up; `0` when there is no
2309
- * runner-up. */
2310
- ratio: number;
2311
- /** Best (lowest) quadratic score. */
2312
- bestScore: number;
2313
- /** Runner-up score; absent when no second lattice point exists. */
2314
- secondBestScore?: number;
2315
- /** Number of lattice points evaluated. */
2316
- candidatesEvaluated: number;
2317
- /** Symmetrized covariance actually used, row-major. */
2318
- covariance: number[][];
2319
- /** Symmetrized inverse covariance, row-major. */
2320
- covarianceInverse: number[][];
2321
- }
2322
-
2323
- // --- SP3-backed visibility geometry -----------------------------------------
2324
- //
2325
- // `gnssVisible(sp3, stationEcefM, j2000Seconds, options?)`,
2326
- // `gnssVisibilitySeries(sp3, stationEcefM, startJ2000S, endJ2000S, stepSeconds,
2327
- // options?)`, and `gnssPasses(...)` deserialize `options` through serde. The
2328
- // returned classes (`GnssVisibleSatellite`, `GnssVisibilityCount`, `GnssPass`)
2329
- // are in the generated types. Import:
2330
- //
2331
- // import { gnssVisible } from "@neilberkman/sidereon";
2332
- // import type { GnssVisibilityOptions } from "@neilberkman/sidereon/types";
2333
-
2334
- /** Visibility filters shared by `gnssVisible`, `gnssVisibilitySeries`, and
2335
- * `gnssPasses`. All fields optional. */
2336
- export interface GnssVisibilityOptions {
2337
- /** Minimum topocentric elevation, degrees. Defaults to 5. */
2338
- elevationMaskDeg?: number;
2339
- /** Constellation filter as RINEX letters/names (e.g. ["G", "E"]); omit to
2340
- * admit every constellation in the product. */
2341
- systems?: string[];
2342
- }
2343
-
2344
- // --- Observable prediction --------------------------------------------------
2345
- //
2346
- // `observablesSp3(sp3, satellite, receiverEcefM, tRxJ2000S, options?)` and
2347
- // `observablesBroadcast(broadcast, satellite, tRxJ2000S, receiverEcefM,
2348
- // options?)` deserialize `options` through serde and return the generated
2349
- // `PredictedObservables` class. `solveVelocityBroadcast` reuses
2350
- // `VelocityObservation` / `VelocitySolveOptions` above. Import:
2351
- //
2352
- // import { observablesSp3 } from "@neilberkman/sidereon";
2353
- // import type { ObservablePredictOptions } from "@neilberkman/sidereon/types";
2354
-
2355
- /** Options controlling observable prediction. All fields optional. */
2356
- export interface ObservablePredictOptions {
2357
- /** Carrier frequency used to scale Doppler, hertz. Defaults to the GPS L1
2358
- * frequency. */
2359
- carrierHz?: number;
2360
- /** Apply fixed-point light-time / transmit-time correction. Defaults to true. */
2361
- lightTime?: boolean;
2362
- /** Apply Earth-rotation Sagnac correction. Defaults to true. */
2363
- sagnac?: boolean;
2364
- }
2365
-
2366
- // --- Reduced-orbit fit/eval/drift -------------------------------------------
2367
- //
2368
- // `fitReducedOrbit(samples, scale, model)` deserializes `samples` through serde
2369
- // and returns the generated `ReducedOrbit` class, whose `position(query, frame)`
2370
- // / `positionVelocity(query, frame)` / `drift(truth, thresholdM)` methods take
2371
- // the same epoch/sample shapes. `scale` is a `TimeScale` enum value; `model` and
2372
- // `frame` are the string unions below. Import:
2373
- //
2374
- // import { fitReducedOrbit } from "@neilberkman/sidereon";
2375
- // import type { ReducedOrbitSample } from "@neilberkman/sidereon/types";
2376
-
2377
- /** Reduced-orbit secular model selector. */
2378
- export type ReducedOrbitModelKind = "circular_secular" | "eccentric_secular";
2379
-
2380
- /** Frame for reduced-orbit evaluation. */
2381
- export type ReducedOrbitFrame = "ecef" | "gcrs";
2382
-
2383
- /** A civil calendar epoch, interpreted in the model's time scale. */
2384
- export interface ReducedOrbitCalendarEpoch {
2385
- year: number;
2386
- month: number;
2387
- day: number;
2388
- hour: number;
2389
- minute: number;
2390
- /** Second of minute, fractional. */
2391
- second: number;
2392
- }
2393
-
2394
- /** One ECEF position sample for `fitReducedOrbit` and `ReducedOrbit.drift`. */
2395
- export interface ReducedOrbitSample {
2396
- epoch: ReducedOrbitCalendarEpoch;
2397
- /** ECEF X, metres. */
2398
- xM: number;
2399
- /** ECEF Y, metres. */
2400
- yM: number;
2401
- /** ECEF Z, metres. */
2402
- zM: number;
2403
- }
2404
-
2405
- // --- Source-backed reduced-orbit fit/drift ----------------------------------
2406
- //
2407
- // `fitReducedOrbitSp3(sp3, satellite, options)` and
2408
- // `fitReducedOrbitTle(tle, options)` sample the source over `options` and return
2409
- // the generated `ReducedOrbitSourceFit` class. The fitted `orbit` exposes
2410
- // `driftSp3(...)` and `driftTle(...)` methods using the drift options below.
2411
-
2412
- /** Sampling window for source-backed reduced-orbit calls. */
2413
- export interface ReducedOrbitSourceSampling {
2414
- /** Inclusive sampling start in the source time scale. */
2415
- t0: ReducedOrbitCalendarEpoch;
2416
- /** Inclusive sampling end in the source time scale. */
2417
- t1: ReducedOrbitCalendarEpoch;
2418
- /** Sampling cadence, seconds. */
2419
- cadenceS: number;
2420
- }
2421
-
2422
- /** Options for `fitReducedOrbitSp3` and `fitReducedOrbitTle`. */
2423
- export interface ReducedOrbitSourceFitOptions extends ReducedOrbitSourceSampling {
2424
- model: ReducedOrbitModelKind;
2425
- }
2426
-
2427
- /** Options for `ReducedOrbit.driftSp3` and `ReducedOrbit.driftTle`. */
2428
- export interface ReducedOrbitSourceDriftOptions extends ReducedOrbitSourceSampling {
2429
- /** First crossing threshold, metres. */
2430
- thresholdM: number;
2431
- }
2432
-
2433
- // --- Piecewise reduced-orbit fit/eval/drift ---------------------------------
2434
- //
2435
- // `fitPiecewiseReducedOrbit(samples, scale, model, t0, t1, segmentSeconds)` tiles
2436
- // the `[t0, t1]` window (both `ReducedOrbitCalendarEpoch`) into
2437
- // `segmentSeconds`-long segments, fits each independently, and returns the
2438
- // generated `PiecewiseOrbit` class. Its `position(query, frame)` /
2439
- // `positionVelocity(query, frame)` / `drift(truth, thresholdM)` /
2440
- // `segmentIndexAt(query)` methods take the same `ReducedOrbitCalendarEpoch` /
2441
- // `ReducedOrbitSample` / `ReducedOrbitFrame` shapes as the single-segment model.
2442
- // `samples` is `ReducedOrbitSample[]`; `scale` is a `TimeScale` enum value;
2443
- // `model` is `ReducedOrbitModelKind`.
2444
-
2445
- // `fitPiecewiseReducedOrbitSp3(sp3, satellite, options)` and
2446
- // `fitPiecewiseReducedOrbitTle(tle, options)` sample the source over `options`
2447
- // and return the generated `PiecewiseOrbitSourceFit` class. The fitted `orbit`
2448
- // exposes `driftSp3(...)` and `driftTle(...)` methods using
2449
- // `ReducedOrbitSourceDriftOptions`.
2450
-
2451
- /** Options for source-backed piecewise reduced-orbit fitting. */
2452
- export interface PiecewiseReducedOrbitSourceFitOptions extends ReducedOrbitSourceFitOptions {
2453
- /** Segment length, seconds. */
2454
- segmentSeconds: number;
2455
- }
2456
-
2457
- // --- GPS LNAV navigation-message codec --------------------------------------
2458
- //
2459
- // `lnavEncode(params, options)` deserializes both objects through serde and
2460
- // returns the generated `LnavSubframes` class. Import:
2461
- //
2462
- // import { lnavEncode } from "@neilberkman/sidereon";
2463
- // import type { LnavParams } from "@neilberkman/sidereon/types";
2464
-
2465
- /** LNAV clock/ephemeris parameters in engineering units, the per-field input to
2466
- * `lnavEncode`. Integer fields (week number, codes, health, IODC/IODE,
2467
- * fit-interval flag, AODO) take whole numbers; the scaled fields take floats in
2468
- * the documented physical units. */
2469
- export interface LnavParams {
2470
- /** GPS week number. */
2471
- weekNumber: number;
2472
- /** L2 code indicator. */
2473
- l2Code: number;
2474
- /** L2 P data flag (encode-only; not recovered by `lnavDecode`). */
2475
- l2PDataFlag: number;
2476
- /** User range accuracy index. */
2477
- uraIndex: number;
2478
- /** SV health bits. */
2479
- svHealth: number;
2480
- /** Issue of data, clock. */
2481
- iodc: number;
2482
- /** Group delay differential, seconds. */
2483
- tgd: number;
2484
- /** Clock reference time, seconds. */
2485
- toc: number;
2486
- /** Clock bias coefficient, seconds. */
2487
- af0: number;
2488
- /** Clock drift coefficient, seconds per second. */
2489
- af1: number;
2490
- /** Clock drift-rate coefficient, seconds per second squared. */
2491
- af2: number;
2492
- /** Issue of data, ephemeris. */
2493
- iode: number;
2494
- /** Sine harmonic correction to orbit radius, metres. */
2495
- crs: number;
2496
- /** Mean motion difference, radians per second. */
2497
- deltaN: number;
2498
- /** Mean anomaly at reference time, radians. */
2499
- m0: number;
2500
- /** Cosine harmonic correction to argument of latitude, radians. */
2501
- cuc: number;
2502
- /** Eccentricity. */
2503
- eccentricity: number;
2504
- /** Sine harmonic correction to argument of latitude, radians. */
2505
- cus: number;
2506
- /** Square root of the semi-major axis, sqrt(metres). */
2507
- sqrtA: number;
2508
- /** Ephemeris reference time, seconds. */
2509
- toe: number;
2510
- /** Fit-interval flag. */
2511
- fitIntervalFlag: number;
2512
- /** Age of data offset. */
2513
- aodo: number;
2514
- /** Cosine harmonic correction to inclination, radians. */
2515
- cic: number;
2516
- /** Longitude of ascending node at weekly epoch, radians. */
2517
- omega0: number;
2518
- /** Sine harmonic correction to inclination, radians. */
2519
- cis: number;
2520
- /** Inclination at reference time, radians. */
2521
- i0: number;
2522
- /** Cosine harmonic correction to orbit radius, metres. */
2523
- crc: number;
2524
- /** Argument of perigee, radians. */
2525
- omega: number;
2526
- /** Rate of right ascension, radians per second. */
2527
- omegaDot: number;
2528
- /** Rate of inclination, radians per second. */
2529
- idot: number;
2530
- }
2531
-
2532
- /** Optional TLM/HOW options for `lnavEncode`. Every field is an integer and
2533
- * defaults to 0 when omitted. */
2534
- export interface LnavOptions {
2535
- /** Time-of-week count (17-bit). */
2536
- tow?: number;
2537
- /** Alert flag (1-bit). */
2538
- alert?: number;
2539
- /** Anti-spoof flag (1-bit). */
2540
- antiSpoof?: number;
2541
- /** Integrity status flag (1-bit). */
2542
- integrity?: number;
2543
- /** TLM message (14-bit). */
2544
- tlmMessage?: number;
2545
- }
2546
-
2547
- // ---------------------------------------------------------------------------
2548
- // Classical orbital elements (rv2coe / coe2rv)
2549
- // ---------------------------------------------------------------------------
2550
-
2551
- /** Geometric classification of a two-body orbit. */
2552
- export type OrbitType =
2553
- "ellipticalInclined" | "ellipticalEquatorial" | "circularInclined" | "circularEquatorial";
2554
-
2555
- /**
2556
- * Classical (Keplerian) orbital elements in the Vallado convention. Returned by
2557
- * `rv2coe` and accepted by `coe2rv`. Angles are radians; `p` and `a` are km.
2558
- * Undefined primary angles and inapplicable auxiliary angles are `NaN`. For
2559
- * `coe2rv` only `p`, `ecc`, `incl`, `raan`, `argp`, and `nu` are required (an
2560
- * ordinary elliptical-inclined orbit); `orbitType` and the auxiliary angles
2561
- * default.
2562
- */
2563
- export interface ClassicalElements {
2564
- /** Semi-latus rectum p = h^2 / mu, km. */
2565
- p: number;
2566
- /** Semi-major axis a, km (Infinity for a parabolic orbit). Output only. */
2567
- a?: number;
2568
- ecc: number;
2569
- incl: number;
2570
- raan: number;
2571
- argp: number;
2572
- nu: number;
2573
- /** Argument of latitude u = argp + nu, rad (circular inclined orbits). */
2574
- arglat?: number;
2575
- /** True longitude, rad (circular equatorial orbits). */
2576
- truelon?: number;
2577
- /** Longitude of perigee, rad (elliptical equatorial orbits). */
2578
- lonper?: number;
2579
- orbitType?: OrbitType;
2580
- }
2581
-
2582
- /** An inertial Cartesian state, returned by `coe2rv`. */
2583
- export interface CartesianState {
2584
- positionKm: [number, number, number];
2585
- velocityKmS: [number, number, number];
2586
- }
2587
-
2588
- // ---------------------------------------------------------------------------
2589
- // Observational-astronomy geometry
2590
- // ---------------------------------------------------------------------------
2591
-
2592
- /** A point on a body surface, geocentric/planetocentric latitude and longitude. */
2593
- export interface SurfacePoint {
2594
- /** Degrees on [-90, 90]. */
2595
- latitudeDeg: number;
2596
- /** Degrees on (-180, 180]. */
2597
- longitudeDeg: number;
2598
- }
2599
-
2600
- // ---------------------------------------------------------------------------
2601
- // RTCM 3.x decode
2602
- // ---------------------------------------------------------------------------
2603
-
2604
- /** A 1005 / 1006 station antenna reference point. */
2605
- export interface RtcmStationCoordinates {
2606
- type: "stationCoordinates";
2607
- messageNumber: number;
2608
- referenceStationId: number;
2609
- itrfRealizationYear: number;
2610
- gpsIndicator: boolean;
2611
- glonassIndicator: boolean;
2612
- galileoIndicator: boolean;
2613
- referenceStationIndicator: boolean;
2614
- ecefX: bigint;
2615
- singleReceiverOscillator: boolean;
2616
- reserved: boolean;
2617
- ecefY: bigint;
2618
- quarterCycleIndicator: number;
2619
- ecefZ: bigint;
2620
- /** Antenna height, raw 0.1 mm units (1006 only). */
2621
- antennaHeight?: number;
2622
- /** ECEF coordinates in metres. */
2623
- xM: number;
2624
- yM: number;
2625
- zM: number;
2626
- /** Antenna height in metres (1006 only). */
2627
- antennaHeightM?: number;
2628
- }
2629
-
2630
- /** A 1007 / 1008 / 1033 antenna or receiver descriptor. */
2631
- export interface RtcmAntennaDescriptor {
2632
- type: "antennaDescriptor";
2633
- messageNumber: number;
2634
- referenceStationId: number;
2635
- antennaDescriptor: string;
2636
- antennaSetupId: number;
2637
- antennaSerialNumber?: string;
2638
- receiverType?: string;
2639
- receiverFirmwareVersion?: string;
2640
- receiverSerialNumber?: string;
2641
- }
2642
-
2643
- /** MSM common header. */
2644
- export interface RtcmMsmHeader {
2645
- referenceStationId: number;
2646
- epochTime: number;
2647
- multipleMessage: boolean;
2648
- iods: number;
2649
- reserved: number;
2650
- clockSteering: number;
2651
- externalClock: number;
2652
- divergenceFreeSmoothing: boolean;
2653
- smoothingInterval: number;
2654
- }
2655
-
2656
- /** One MSM satellite record (raw transmitted integers). */
2657
- export interface RtcmMsmSatellite {
2658
- id: number;
2659
- roughRangeMs: number;
2660
- roughRangeMod1: number;
2661
- extendedInfo?: number;
2662
- roughPhaseRangeRateMS?: number;
2663
- }
2664
-
2665
- /** One MSM signal record (raw transmitted integers). */
2666
- export interface RtcmMsmSignal {
2667
- satelliteId: number;
2668
- signalId: number;
2669
- finePseudorange: number;
2670
- finePhaseRange: number;
2671
- lockTimeIndicator: number;
2672
- halfCycleAmbiguity: boolean;
2673
- cnr: number;
2674
- finePhaseRangeRate?: number;
2675
- }
2676
-
2677
- /** Derived RINEX LLI for one MSM signal cell. */
2678
- export interface RtcmCellLli {
2679
- satelliteId: number;
2680
- signalId: number;
2681
- /** RINEX LLI value; bit 0 is loss of lock, bit 1 is half-cycle ambiguity. */
2682
- lli: number;
2683
- minLockTimeMs?: number;
2684
- }
2685
-
2686
- /** Previous lock-state input for `rtcmDeriveLli`. */
2687
- export interface RtcmPreviousLock {
2688
- minLockTimeMs?: number;
2689
- elapsedMs: number;
2690
- }
2691
-
2692
- /** An MSM4 / MSM7 multi-signal observation message. */
2693
- export interface RtcmMsm {
2694
- type: "msm";
2695
- messageNumber: number;
2696
- /** GNSS constellation label, e.g. "gps", "glonass". */
2697
- system: string;
2698
- /** "msm4" or "msm7". */
2699
- kind: string;
2700
- header: RtcmMsmHeader;
2701
- satellites: RtcmMsmSatellite[];
2702
- signals: RtcmMsmSignal[];
2703
- }
2704
-
2705
- /** A 1019 GPS broadcast ephemeris (raw transmitted integers). */
2706
- export interface RtcmGpsEphemeris {
2707
- type: "gpsEphemeris";
2708
- messageNumber: number;
2709
- satelliteId: number;
2710
- weekNumber: number;
2711
- svAccuracy: number;
2712
- codeOnL2: number;
2713
- idot: number;
2714
- iode: number;
2715
- tOc: number;
2716
- aF2: number;
2717
- aF1: number;
2718
- aF0: number;
2719
- iodc: number;
2720
- cRs: number;
2721
- deltaN: number;
2722
- m0: bigint;
2723
- cUc: number;
2724
- eccentricity: bigint;
2725
- cUs: number;
2726
- sqrtA: bigint;
2727
- tOe: number;
2728
- cIc: number;
2729
- omega0: bigint;
2730
- cIs: number;
2731
- i0: bigint;
2732
- cRc: number;
2733
- omega: bigint;
2734
- omegaDot: number;
2735
- tGd: number;
2736
- svHealth: number;
2737
- l2PDataFlag: boolean;
2738
- fitInterval: boolean;
2739
- }
2740
-
2741
- /** A 1020 GLONASS broadcast ephemeris (raw transmitted integers). */
2742
- export interface RtcmGlonassEphemeris {
2743
- type: "glonassEphemeris";
2744
- messageNumber: number;
2745
- satelliteId: number;
2746
- frequencyChannel: number;
2747
- almanacHealth: boolean;
2748
- almanacHealthAvailability: boolean;
2749
- p1: number;
2750
- tK: number;
2751
- bNMsb: boolean;
2752
- p2: boolean;
2753
- tB: number;
2754
- xnDot: number;
2755
- xn: number;
2756
- xnDotDot: number;
2757
- ynDot: number;
2758
- yn: number;
2759
- ynDotDot: number;
2760
- znDot: number;
2761
- zn: number;
2762
- znDotDot: number;
2763
- p3: boolean;
2764
- gammaN: number;
2765
- mP: number;
2766
- mLNThird: boolean;
2767
- tauN: number;
2768
- deltaTauN: number;
2769
- eN: number;
2770
- mP4: boolean;
2771
- mFT: number;
2772
- mNT: number;
2773
- mM: number;
2774
- additionalDataAvailable: boolean;
2775
- nA: number;
2776
- tauC: bigint;
2777
- mN4: number;
2778
- mTauGps: number;
2779
- mLNFifth: boolean;
2780
- reserved: number;
2781
- }
2782
-
2783
- /** A recognized-but-undecoded message, preserved verbatim. */
2784
- export interface RtcmUnsupported {
2785
- type: "unsupported";
2786
- messageNumber: number;
2787
- /** Undecoded body bytes. */
2788
- body: number[];
2789
- }
2790
-
2791
- /** The decoded RTCM 3 message IR, tagged by `type`. Returned by `decodeRtcm`. */
2792
- export type RtcmMessage =
2793
- | RtcmMsm
2794
- | RtcmStationCoordinates
2795
- | RtcmAntennaDescriptor
2796
- | RtcmGpsEphemeris
2797
- | RtcmGlonassEphemeris
2798
- | RtcmUnsupported;
2799
-
2800
- /** A single decoded frame, returned by `decodeRtcmFrame`. */
2801
- export interface RtcmDecodedFrame {
2802
- message: RtcmMessage;
2803
- /** Total frame length in bytes (preamble, length, body, CRC). */
2804
- frameLen: number;
2805
- }
2806
-
2807
- /** One yielded frame from a `FrameScanner`. */
2808
- export interface RtcmScannedFrame {
2809
- /** Message body (bytes between the length word and the CRC). */
2810
- body: Uint8Array;
2811
- frameLen: number;
2812
- }
2813
-
2814
- /** One CRC-valid frame skipped by `decodeRtcmStream`. */
2815
- export interface RtcmFrameSkip {
2816
- offset: number;
2817
- messageNumber?: number;
2818
- reason: "truncated" | "malformed";
2819
- message?: string;
2820
- }
2821
-
2822
- /** Stream diagnostics returned by `decodeRtcmStream`. */
2823
- export interface RtcmStreamDiagnostics {
2824
- resyncBytes: number;
2825
- skippedFrames: RtcmFrameSkip[];
2826
- }
2827
-
2828
- /** RTCM stream decode result returned by `decodeRtcmStream`. */
2829
- export interface RtcmStream {
2830
- messages: RtcmMessage[];
2831
- diagnostics: RtcmStreamDiagnostics;
2832
- }
2833
-
2834
- /** RINEX LLI bit constants used by RTCM MSM helpers. */
2835
- export interface RtcmLliBits {
2836
- lossOfLock: number;
2837
- halfCycle: number;
2838
- }
2839
-
2840
- // ---------------------------------------------------------------------------
2841
- // Moving-baseline RTK
2842
- // ---------------------------------------------------------------------------
2843
-
2844
- /** One moving-baseline epoch: a per-epoch base ECEF position plus an RTK epoch. */
2845
- export interface MovingBaselineEpoch extends RtkEpoch {
2846
- /** Base receiver ECEF position [x, y, z] this epoch, metres. */
2847
- basePositionM: [number, number, number];
2848
- }
2849
-
2850
- /** The object passed to `solveMovingBaseline`. The ambiguity set is shared. */
2851
- export interface MovingBaselineConfig {
2852
- epochs: MovingBaselineEpoch[];
2853
- ambiguityIds: string[];
2854
- ambiguitySatellites: Record<string, string>;
2855
- wavelengthsM: Record<string, number>;
2856
- offsetsM: Record<string, number>;
2857
- floatOnlySystems?: string[];
2858
- model: RtkMeasurementModel;
2859
- floatOptions?: RtkFloatOptions;
2860
- fixedOptions?: RtkFixedOptions;
2861
- initialBaselineM?: [number, number, number];
2862
- /** Carry each solved baseline into the next epoch. Defaults to true. */
2863
- warmStart?: boolean;
2864
- }
2865
-
2866
- // ---------------------------------------------------------------------------
2867
- // Time of closest approach (TCA)
2868
- // ---------------------------------------------------------------------------
2869
-
2870
- /** Finder sampling controls (defaults: 60 s coarse step, 1e-3 s tolerance). */
2871
- export interface TcaFinderOptions {
2872
- coarseStepSeconds?: number;
2873
- timeToleranceSeconds?: number;
2874
- }
2875
-
2876
- /** Collision-probability options for the TCA conjunction finders. */
2877
- export interface TcaPcOptions {
2878
- hardBodyRadiusKm: number;
2879
- /** Pc method; defaults to "foster_equal_area". */
2880
- method?: "foster_equal_area" | "foster_numerical" | "alfano_2005";
2881
- /** Primary-object 3x3 position covariance (flat row-major, km^2). */
2882
- primaryCovarianceKm2?: number[];
2883
- /** Secondary-object 3x3 position covariance (flat row-major, km^2). */
2884
- secondaryCovarianceKm2?: number[];
2885
- }
2886
-
2887
- /** A borrowed TLE line pair for the screening catalogs. */
2888
- export interface Tle {
2889
- line1: string;
2890
- line2: string;
2891
- }
2892
-
2893
- /** One local time-of-closest-approach candidate. */
2894
- export interface TcaCandidate {
2895
- /** Refined TCA split Julian date (whole boundary). */
2896
- tcaJdWhole: number;
2897
- tcaJdFraction: number;
2898
- /** Recombined TCA Julian date. */
2899
- tcaJd: number;
2900
- tcaSecondsSinceWindowStart: number;
2901
- missDistanceKm: number;
2902
- /** Primary minus secondary TEME position [x, y, z], km. */
2903
- relativePositionKm: [number, number, number];
2904
- /** Primary minus secondary TEME velocity [vx, vy, vz], km/s. */
2905
- relativeVelocityKmS: [number, number, number];
2906
- }
2907
-
2908
- /** A TCA candidate with the collision probability evaluated at that TCA. */
2909
- export interface TcaConjunction {
2910
- candidate: TcaCandidate;
2911
- pc: number;
2912
- missKm: number;
2913
- relativeSpeedKmS: number;
2914
- sigmaXKm: number;
2915
- sigmaZKm: number;
2916
- }
2917
-
2918
- /** One threshold-screening hit. */
2919
- export interface TcaScreeningHit {
2920
- /** Index of the secondary in the supplied catalog. */
2921
- secondaryIndex: number;
2922
- candidate: TcaCandidate;
2923
- }
2924
-
2925
- /** A threshold-screening hit with Pc evaluated at the returned TCA. */
2926
- export interface TcaScreeningConjunctionHit {
2927
- secondaryIndex: number;
2928
- conjunction: TcaConjunction;
2929
- }
2930
-
2931
- // ---------------------------------------------------------------------------
2932
- // NeQuick-G full three-dimensional slant ionosphere
2933
- // ---------------------------------------------------------------------------
2934
- //
2935
- // `nequickGStecTecu(eval)` / `nequickGDelayM(eval, frequencyHz)` take a serde-
2936
- // `any` object. Import:
2937
- //
2938
- // import { nequickGStecTecu } from "@neilberkman/sidereon";
2939
- // import type { NequickGEval } from "@neilberkman/sidereon/types";
2940
-
2941
- /** One receiver-to-satellite ray (geometry, epoch, and the Galileo broadcast
2942
- * effective-ionisation coefficients) for the full NeQuick-G slant model. */
2943
- export interface NequickGEval {
2944
- /** Galileo broadcast effective-ionisation coefficient a_i0. */
2945
- ai0: number;
2946
- ai1: number;
2947
- ai2: number;
2948
- /** Month of the year, 1..=12. */
2949
- month: number;
2950
- /** UTC time of day in hours, [0, 24]. */
2951
- utcHours: number;
2952
- /** Receiver geodetic longitude, degrees. */
2953
- stationLonDeg: number;
2954
- /** Receiver geodetic latitude, degrees. */
2955
- stationLatDeg: number;
2956
- /** Receiver height above the reference sphere, metres. */
2957
- stationHeightM: number;
2958
- /** Satellite geodetic longitude, degrees. */
2959
- satelliteLonDeg: number;
2960
- /** Satellite geodetic latitude, degrees. */
2961
- satelliteLatDeg: number;
2962
- /** Satellite height above the reference sphere, metres. */
2963
- satelliteHeightM: number;
2964
- }
2965
-
2966
- // ---------------------------------------------------------------------------
2967
- // Range RAIM / fault detection and exclusion (design-matrix form)
2968
- // ---------------------------------------------------------------------------
2969
- //
2970
- // `raimFdeDesign(rows, options?)` takes a serde-`any` array and object and
2971
- // returns the result as a plain object (typed `any` by wasm-bindgen). Import:
2972
- //
2973
- // import { raimFdeDesign } from "@neilberkman/sidereon";
2974
- // import type { RaimFdeRow, RaimFdeResult } from "@neilberkman/sidereon/types";
2975
-
2976
- /** One linearized range measurement. */
2977
- export interface RaimFdeRow {
2978
- /** Stable measurement identifier, e.g. a satellite token "G01". */
2979
- id: string;
2980
- /** Observed-minus-computed range residual, metres. */
2981
- residualM: number;
2982
- /** Design-matrix row (partials of predicted range w.r.t. each state
2983
- * parameter). Length equals the estimated state dimension. */
2984
- designRow: number[];
2985
- /** Inverse-variance weight 1 / sigma^2; finite and strictly positive. */
2986
- weight: number;
2987
- }
2988
-
2989
- /** Options for `raimFdeDesign`. Every field is optional. */
2990
- export interface RaimFdeOptions {
2991
- /** False-alarm probability for the global chi-square test. Default 1.0e-3. */
2992
- pFa?: number;
2993
- /** Maximum measurements the exclusion loop may remove. Default unbounded. */
2994
- maxExclusions?: number;
2995
- /** Minimum redundancy an exclusion must leave behind. Default 1. */
2996
- minRedundancy?: number;
2997
- }
2998
-
2999
- /** Global chi-square consistency test over the protected set. */
3000
- export interface RaimChiSquareTest {
3001
- weightedSumSquares: number;
3002
- /** Redundancy: nUsed - nState. */
3003
- dof: number;
3004
- /** Chi-square threshold, absent when dof <= 0. */
3005
- threshold?: number;
3006
- testable: boolean;
3007
- faultDetected: boolean;
3008
- }
3009
-
3010
- /** Per-measurement diagnostic, in input order. */
3011
- export interface RaimMeasurementDiagnostic {
3012
- id: string;
3013
- excluded: boolean;
3014
- postFitResidualM: number;
3015
- normalizedResidual: number;
3016
- }
3017
-
3018
- /** Result of `raimFdeDesign`. */
3019
- export interface RaimFdeResult {
3020
- /** Protected weighted-least-squares state correction, length nState. */
3021
- stateCorrection: number[];
3022
- /** Protected state covariance (H^T W H)^-1, nState-by-nState. */
3023
- stateCovariance: number[][];
3024
- globalTest: RaimChiSquareTest;
3025
- /** Excluded measurement ids, in exclusion order. */
3026
- excluded: string[];
3027
- diagnostics: RaimMeasurementDiagnostic[];
3028
- iterations: number;
3029
- }
3030
-
3031
- // ---------------------------------------------------------------------------
3032
- // PPP auto-init (SPP-seeded) drivers
3033
- // ---------------------------------------------------------------------------
3034
- //
3035
- // `solvePppAutoInitFloat(sp3, epochs, options?, config)` and
3036
- // `solvePppAutoInitFixed(sp3, epochs, options?, floatConfig, fixedConfig)` seed
3037
- // the float state from the SPP solver, so no initial state is supplied. Import:
3038
- //
3039
- // import { solvePppAutoInitFloat } from "@neilberkman/sidereon";
3040
- // import type { PppAutoInitOptions } from "@neilberkman/sidereon/types";
3041
-
3042
- /** Explicit static-position/clock seed that bypasses the SPP auto-init stages. */
3043
- export interface PppInitialGuess {
3044
- positionM: [number, number, number];
3045
- /** Receiver clock seed, metres (duplicated across every epoch). */
3046
- clockM: number;
3047
- }
3048
-
3049
- /** SPP surface meteorology for the auto-init seed troposphere. */
3050
- export interface PppSppSurfaceMet {
3051
- pressureHpa: number;
3052
- temperatureK: number;
3053
- relativeHumidity: number;
3054
- }
3055
-
3056
- /** Auto-initialization policy for the raw-epochs PPP drivers. Every field is
3057
- * optional; omitting `initialGuess` runs the per-epoch SPP seed. */
3058
- export interface PppAutoInitOptions {
3059
- /** Explicit seed; present skips the SPP/mean stages entirely. */
3060
- initialGuess?: PppInitialGuess;
3061
- /** SPP cold-start guess [x, y, z, b] for each per-epoch seed. Default zeros. */
3062
- sppInitialGuess?: [number, number, number, number];
3063
- /** Apply the troposphere correction in the SPP seed. Default false. */
3064
- sppTroposphere?: boolean;
3065
- /** Surface meteorology used by the SPP seed troposphere. */
3066
- sppMet?: PppSppSurfaceMet;
3067
- }
3068
-
3069
- // ---------------------------------------------------------------------------
3070
- // Sequential RTK baseline arc driver
3071
- // ---------------------------------------------------------------------------
3072
- //
3073
- // `solveRtkArc(epochs, config)` takes serde-`any` arrays/objects and returns
3074
- // the solution as a plain object (typed `any` by wasm-bindgen). Import:
3075
- //
3076
- // import { solveRtkArc } from "@neilberkman/sidereon";
3077
- // import type { RtkArcEpoch, RtkArcConfig, RtkArcSolution } from "@neilberkman/sidereon/types";
3078
-
3079
- /** One raw single-frequency code/carrier observation at a receiver. */
3080
- export interface RtkArcObservation {
3081
- satelliteId: string;
3082
- /** Ambiguity-arc id (the satellite id for a clean arc; a distinct id splits
3083
- * a cycle-slip arc so the single-difference key resets). */
3084
- ambiguityId: string;
3085
- codeM: number;
3086
- phaseM: number;
3087
- /** Loss-of-lock indicator. Bit 0 set marks a cycle-slip event when enabled. */
3088
- lli?: number;
3089
- }
3090
-
3091
- /** One raw RTK arc epoch: paired base/rover observations and satellite positions. */
3092
- export interface RtkArcEpoch {
3093
- base: RtkArcObservation[];
3094
- rover: RtkArcObservation[];
3095
- /** Shared receive-time satellite ECEF positions (metres), satellite -> xyz. */
3096
- satellitePositionsM: Record<string, [number, number, number]>;
3097
- /** Transmit-time positions for the base; defaults to the shared map. */
3098
- baseSatellitePositionsM?: Record<string, [number, number, number]>;
3099
- /** Transmit-time positions for the rover; defaults to the shared map. */
3100
- roverSatellitePositionsM?: Record<string, [number, number, number]>;
3101
- velocityMps?: [number, number, number];
3102
- /** Epoch time coordinate (seconds) for the prediction-delta computation. */
3103
- predictionTimeS?: number;
3104
- }
3105
-
3106
- /** Reference-satellite selection policy for the arc. */
3107
- export interface RtkArcReferenceSelection {
3108
- /** "auto" (default), "satellite", or "perSystem". */
3109
- mode?: "auto" | "satellite" | "perSystem";
3110
- /** Fixed reference satellite token (mode "satellite", single-system only). */
3111
- satellite?: string;
3112
- /** Constellation letter -> reference satellite (mode "perSystem"). */
3113
- references?: Record<string, string>;
3114
- }
3115
-
3116
- /** Optional predicted-residual screen for one epoch update. */
3117
- export interface RtkArcInnovationScreen {
3118
- thresholdSigma: number;
3119
- minRows: number;
3120
- }
3121
-
3122
- /** Per-epoch sequential-update controls. Every field is optional. */
3123
- export interface RtkArcUpdateOptions {
3124
- holdSigmaM?: number;
3125
- positionTolM?: number;
3126
- ambiguityTolM?: number;
3127
- maxIterations?: number;
3128
- /** Kinematic baseline process-noise sigma (metres); 0 is the static filter. */
3129
- processNoiseBaselineSigmaM?: number;
3130
- /** Prediction dynamics. Default "constantPosition". */
3131
- dynamicsModel?: "constantPosition" | "velocityPropagated";
3132
- /** Constellation letters kept float-only (never integer-fixed), e.g. ["R"]. */
3133
- floatOnlySystems?: string[];
3134
- innovationScreen?: RtkArcInnovationScreen;
3135
- /** Emit per-epoch residual diagnostics. Default false. */
3136
- reportResiduals?: boolean;
3137
- /** AR commitment arming gate (metres); omit to keep always-armed. */
3138
- arArmingSigmaM?: number;
3139
- /** LAMBDA acceptance ratio threshold. Default 3.0. */
3140
- ratioThreshold?: number;
3141
- }
3142
-
3143
- /** Cycle-slip handling policy for arc preprocessing. */
3144
- export type RtkArcCycleSlipPolicy = "error" | "dropSatellite" | "splitArc";
3145
-
3146
- /** Optional preprocessing chained ahead of the RTK arc solve. */
3147
- export interface RtkArcPreprocessing {
3148
- /** Reads `RtkArcObservation.lli`; omit to skip cycle-slip preprocessing. */
3149
- cycleSlip?: RtkArcCycleSlipPolicy;
3150
- /** Hatch code-smoothing window cap; omit to skip smoothing. */
3151
- hatchWindowCap?: number;
3152
- /** Base-receiver elevation mask in degrees; omit to skip masking. */
3153
- elevationMaskDeg?: number;
3154
- }
3155
-
3156
- /** The config object passed to `solveRtkArc`. */
3157
- export interface RtkArcConfig {
3158
- /** Base-station ECEF position [x, y, z], metres. */
3159
- baseM: [number, number, number];
3160
- reference?: RtkArcReferenceSelection;
3161
- model: RtkMeasurementModel;
3162
- /** Baseline prior sigma (metres) for the initial information matrix. */
3163
- baselinePriorSigmaM: number;
3164
- /** Ambiguity prior sigma (metres) for each new single-difference column. */
3165
- ambiguityPriorSigmaM: number;
3166
- initialBaselineM?: [number, number, number];
3167
- /** Per-ambiguity carrier wavelengths (metres) for the integer search. */
3168
- wavelengthsM?: Record<string, number>;
3169
- /** Per-ambiguity code-to-phase metre offsets for the integer search. */
3170
- offsetsM?: Record<string, number>;
3171
- updateOpts?: RtkArcUpdateOptions;
3172
- preprocessing?: RtkArcPreprocessing;
3173
- }
3174
-
3175
- /** Option groups used by the validated fixed solve inside `solveStaticRtkArc`. */
3176
- export interface RtkValidatedFixedOptions {
3177
- float?: RtkFloatOptions;
3178
- fixed?: RtkFixedOptions;
3179
- residual?: RtkResidualValidationOptions;
3180
- }
3181
-
3182
- /** The config object passed to `solveStaticRtkArc`. */
3183
- export interface RtkStaticArcConfig {
3184
- arc: RtkArcConfig;
3185
- opts?: RtkValidatedFixedOptions;
3186
- }
3187
-
3188
- /** Scalar summary of one epoch's LAMBDA integer search. */
3189
- export interface RtkArcSearchSummary {
3190
- integerStatus: "Fixed" | "NotFixed";
3191
- integerMethod: string;
3192
- integerRatio?: number;
3193
- integerBestScore?: number;
3194
- integerSecondBestScore?: number;
3195
- integerCandidates: number;
3196
- partialEnabled: boolean;
3197
- partialFixed: boolean;
3198
- }
3199
-
3200
- /** One public residual row at a reported epoch solution. */
3201
- export interface RtkArcResidual {
3202
- epochIndex: number;
3203
- satelliteId: string;
3204
- referenceSatelliteId: string;
3205
- ambiguityId: string;
3206
- codeM: number;
3207
- phaseM: number;
3208
- codeSigmaM: number;
3209
- phaseSigmaM: number;
3210
- codeNormalized: number;
3211
- phaseNormalized: number;
3212
- }
3213
-
3214
- /** Static float RTK solution returned inside `RtkStaticArcSolution`. */
3215
- export interface RtkStaticArcFloatSolution {
3216
- baselineM: [number, number, number];
3217
- ambiguitiesM: Record<string, number>;
3218
- ambiguityCovarianceM: number[];
3219
- ambiguityCovarianceInverseM: number[];
3220
- residuals: RtkArcResidual[];
3221
- iterations: number;
3222
- converged: boolean;
3223
- status: "StateTolerance" | "MaxIterations";
3224
- codeRmsM: number;
3225
- phaseRmsM: number;
3226
- weightedRmsM: number;
3227
- nObservations: number;
3228
- geometryQuality: GeometryQualityObject;
3229
- }
3230
-
3231
- /** Static fixed RTK solution returned inside `RtkStaticArcSolution`. */
3232
- export interface RtkStaticArcFixedSolution {
3233
- baselineM: [number, number, number];
3234
- freeAmbiguitiesM: Record<string, number>;
3235
- fixedAmbiguitiesCycles: Record<string, number>;
3236
- fixedAmbiguitiesM: Record<string, number>;
3237
- residuals: RtkArcResidual[];
3238
- search: RtkArcSearchSummary;
3239
- iterations: number;
3240
- converged: boolean;
3241
- status: "StateTolerance" | "MaxIterations";
3242
- codeRmsM: number;
3243
- phaseRmsM: number;
3244
- weightedRmsM: number;
3245
- nObservations: number;
3246
- }
3247
-
3248
- /** One residual-validation outlier selected by fixed RTK validation. */
3249
- export interface RtkResidualValidationOutlier {
3250
- epochIndex: number;
3251
- satelliteId: string;
3252
- referenceSatelliteId: string;
3253
- ambiguityId: string;
3254
- kind: "code" | "phase";
3255
- residualM: number;
3256
- sigmaM: number;
3257
- normalizedResidual: number;
3258
- thresholdSigma: number;
3259
- }
3260
-
3261
- /** Residual-validation metadata for the accepted fixed RTK solution. */
3262
- export interface RtkResidualValidationResult {
3263
- thresholdSigma: number;
3264
- maxExclusions: number;
3265
- excludedSats: string[];
3266
- exclusions: RtkResidualValidationOutlier[];
3267
- }
3268
-
3269
- /** Validated fixed RTK solution returned inside `RtkStaticArcSolution`. */
3270
- export interface RtkValidatedFixedSolution {
3271
- floatSolution: RtkStaticArcFloatSolution;
3272
- fixedSolution: RtkStaticArcFixedSolution;
3273
- residualValidation?: RtkResidualValidationResult;
3274
- ambiguityIds: string[];
3275
- ambiguitySatellites: Record<string, string>;
3276
- }
3277
-
3278
- /** The full static RTK arc solution returned by `solveStaticRtkArc`. */
3279
- export interface RtkStaticArcSolution {
3280
- geometryQuality: GeometryQualityObject;
3281
- references: Record<string, string>;
3282
- ambiguityIds: string[];
3283
- ambiguitySatellites: Record<string, string>;
3284
- floatSolution: RtkStaticArcFloatSolution;
3285
- fixedSolution: RtkValidatedFixedSolution;
3286
- droppedSats: string[];
3287
- splitCycleSlipArcs: RtkArcCycleSlipSplitArc[];
3288
- elevationMaskedSats: string[];
3289
- }
3290
-
3291
- /** One epoch's predicted-residual (innovation) screen outcome, present only when
3292
- * the screen was enabled via `updateOpts.innovationScreen`. */
3293
- export interface RtkArcInnovationScreenResult {
3294
- thresholdSigma: number;
3295
- minRows: number;
3296
- inputRows: number;
3297
- acceptedRows: number;
3298
- rejectedRows: number;
3299
- rejectedCodeRows: number;
3300
- rejectedPhaseRows: number;
3301
- maxAbsNormalizedInnovation?: number;
3302
- maxRejectedAbsNormalizedInnovation?: number;
3303
- /** Whether the epoch was coasted (too few rows survived the screen). */
3304
- coasted: boolean;
3305
- }
3306
-
3307
- /** One epoch's reported baseline/ambiguity solution. */
3308
- export interface RtkArcEpochSolution {
3309
- reportedBaselineM: [number, number, number];
3310
- floatBaselineM: [number, number, number];
3311
- integerFixed: boolean;
3312
- integerRatio: number;
3313
- newlyFixed: string[];
3314
- fixedIds: string[];
3315
- /** Reported single-difference ambiguities (id -> metres). */
3316
- sdAmbiguitiesM: Record<string, number>;
3317
- fixedDoubleDifferenceIds: string[];
3318
- usedSatelliteIds: string[];
3319
- search?: RtkArcSearchSummary;
3320
- residuals: RtkArcResidual[];
3321
- geometryQuality: GeometryQualityObject;
3322
- /** Per-epoch innovation-screen result, present only when the screen is enabled
3323
- * for the arc via `updateOpts.innovationScreen`. */
3324
- innovationScreen?: RtkArcInnovationScreenResult;
3325
- }
3326
-
3327
- /** The final carried filter state (the serializable streaming ABI). */
3328
- export interface RtkArcFilterState {
3329
- version: number;
3330
- references: Record<string, string>;
3331
- sdAmbiguityIds: string[];
3332
- baselineM: [number, number, number];
3333
- sdAmbiguitiesM: number[];
3334
- /** Row-major n-by-n information matrix, n = 3 + sdAmbiguityIds.length. */
3335
- information: number[];
3336
- ambiguityPriorSigmaM: number;
3337
- epochCount: number;
3338
- fixedCycles: Record<string, number>;
3339
- fixedM: Record<string, number>;
3340
- }
3341
-
3342
- /** Cycle-slip split-arc metadata emitted by preprocessing. */
3343
- export interface RtkArcCycleSlipSplitArc {
3344
- receiver: "base" | "rover";
3345
- satelliteId: string;
3346
- ambiguityId: string;
3347
- startEpochIndex: number;
3348
- endEpochIndex: number;
3349
- nEpochs: number;
3350
- }
3351
-
3352
- /** The full sequential RTK arc solution returned by `solveRtkArc`. */
3353
- export interface RtkArcSolution {
3354
- /** Per-constellation reference single-difference ambiguity ids. */
3355
- references: Record<string, string>;
3356
- epochs: RtkArcEpochSolution[];
3357
- finalState: RtkArcFilterState;
3358
- droppedSats: string[];
3359
- splitCycleSlipArcs: RtkArcCycleSlipSplitArc[];
3360
- elevationMaskedSats: string[];
3361
- /** Row-major posterior covariance, n-by-n with n = finalState information size. */
3362
- measurementCovariance: number[];
3363
- }
3364
-
3365
- /** One receiver's dual-frequency code/carrier observation. */
3366
- export interface RtkDualFrequencyObservation {
3367
- ambiguityId: string;
3368
- p1M: number;
3369
- p2M: number;
3370
- phi1Cycles: number;
3371
- phi2Cycles: number;
3372
- f1Hz: number;
3373
- f2Hz: number;
3374
- lli1?: number;
3375
- lli2?: number;
3376
- }
3377
-
3378
- /** Paired base/rover dual-frequency observation for one satellite. */
3379
- export interface RtkDualFrequencySatelliteObservation {
3380
- satelliteId: string;
3381
- base: RtkDualFrequencyObservation;
3382
- rover: RtkDualFrequencyObservation;
3383
- }
3384
-
3385
- /** One dual-frequency RTK arc epoch. */
3386
- export interface RtkDualFrequencyArcEpoch {
3387
- jdWhole: number;
3388
- jdFraction: number;
3389
- epochSortKey?: string;
3390
- gapTimeS?: number;
3391
- observations: RtkDualFrequencySatelliteObservation[];
3392
- satellitePositionsM: Record<string, [number, number, number]>;
3393
- baseSatellitePositionsM?: Record<string, [number, number, number]>;
3394
- roverSatellitePositionsM?: Record<string, [number, number, number]>;
3395
- velocityMps?: [number, number, number];
3396
- predictionTimeS?: number;
3397
- }
3398
-
3399
- /** Dual-frequency cycle-slip classifier thresholds. */
3400
- export interface RtkDualCycleSlipOptions {
3401
- gfThresholdM?: number;
3402
- mwThresholdCycles?: number;
3403
- minArcGapS?: number;
3404
- }
3405
-
3406
- /** Optional dual-frequency cycle-slip preprocessing for wide-lane fixing. */
3407
- export interface RtkDualCycleSlipConfig {
3408
- policy: RtkArcCycleSlipPolicy;
3409
- options?: RtkDualCycleSlipOptions;
3410
- }
3411
-
3412
- /** Wide-lane integer estimation controls. */
3413
- export interface RtkWideLaneOptions {
3414
- minEpochs: number;
3415
- toleranceCycles: number;
3416
- skipShortFragments: boolean;
3417
- }
3418
-
3419
- /** The config object passed to `fixWideLaneRtkArc`. */
3420
- export interface RtkWideLaneArcConfig {
3421
- baseM: [number, number, number];
3422
- reference?: RtkArcReferenceSelection;
3423
- options: RtkWideLaneOptions;
3424
- cycleSlip?: RtkDualCycleSlipConfig;
3425
- }
3426
-
3427
- /** The wide-lane RTK arc solution returned by `fixWideLaneRtkArc`. */
3428
- export interface RtkWideLaneArcSolution {
3429
- geometryQuality: GeometryQualityObject;
3430
- references: Record<string, string>;
3431
- wideLaneCycles: Record<string, number>;
3432
- epochs: RtkDualFrequencyArcEpoch[];
3433
- droppedSats: string[];
3434
- splitCycleSlipArcs: RtkArcCycleSlipSplitArc[];
3435
- }
3436
-
3437
- /** The config object passed to `prepareIonosphereFreeRtkArc`. */
3438
- export interface RtkIonosphereFreeArcConfig {
3439
- baseM: [number, number, number];
3440
- initialBaselineM?: [number, number, number];
3441
- reference?: RtkArcReferenceSelection;
3442
- applyTroposphere?: boolean;
3443
- }
3444
-
3445
- /** The ionosphere-free RTK arc setup returned by `prepareIonosphereFreeRtkArc`. */
3446
- export interface RtkIonosphereFreeArcSolution {
3447
- references: Record<string, string>;
3448
- epochs: RtkArcEpoch[];
3449
- wavelengthsM: Record<string, number>;
3450
- offsetsM: Record<string, number>;
3451
- }
3452
-
3453
- // ---------------------------------------------------------------------------
3454
- // RTCM construction + encode (the inverse of decodeRtcm)
3455
- // ---------------------------------------------------------------------------
3456
- //
3457
- // `encodeRtcm(message)` / `encodeRtcmFrame(message)` take a `type`-tagged plain
3458
- // object carrying the raw transmitted field integers and return the encoded body
3459
- // / framed bytes. The accepted shapes mirror the `decodeRtcm` output minus the
3460
- // derived convenience fields. Import:
3461
- //
3462
- // import { encodeRtcmFrame } from "@neilberkman/sidereon";
3463
- // import type { RtcmMessageInput } from "@neilberkman/sidereon/types";
3464
-
3465
- /** A 1005 / 1006 station antenna reference point for encoding. */
3466
- export type RtcmStationCoordinatesInput = Omit<
3467
- RtcmStationCoordinates,
3468
- "xM" | "yM" | "zM" | "antennaHeightM"
3469
- >;
3470
-
3471
- /** A 1007 / 1008 / 1033 antenna or receiver descriptor for encoding. */
3472
- export type RtcmAntennaDescriptorInput = RtcmAntennaDescriptor;
3473
-
3474
- /** An MSM4 / MSM7 observation message for encoding. */
3475
- export type RtcmMsmInput = RtcmMsm;
3476
-
3477
- /** A 1019 GPS broadcast ephemeris for encoding (`messageNumber` is implied). */
3478
- export type RtcmGpsEphemerisInput = Omit<RtcmGpsEphemeris, "messageNumber">;
3479
-
3480
- /** A 1020 GLONASS broadcast ephemeris for encoding (`messageNumber` is implied). */
3481
- export type RtcmGlonassEphemerisInput = Omit<RtcmGlonassEphemeris, "messageNumber">;
3482
-
3483
- /** A recognized-but-undecoded message for encoding (body preserved verbatim). */
3484
- export type RtcmUnsupportedInput = RtcmUnsupported;
3485
-
3486
- /** The message IR accepted by `encodeRtcm` / `encodeRtcmFrame`, tagged by `type`.
3487
- * A `decodeRtcm` output object is also accepted (its extra derived fields are
3488
- * ignored). */
3489
- export type RtcmMessageInput =
3490
- | RtcmMsmInput
3491
- | RtcmStationCoordinatesInput
3492
- | RtcmAntennaDescriptorInput
3493
- | RtcmGpsEphemerisInput
3494
- | RtcmGlonassEphemerisInput
3495
- | RtcmUnsupportedInput;
3496
-
3497
- // ---------------------------------------------------------------------------
3498
- // Classical reliability and SBAS protection-level plain objects
3499
- // ---------------------------------------------------------------------------
3500
-
3501
- /** Result returned by `wtestNoncentrality(alpha, power)`. */
3502
- export interface WtestNoncentrality {
3503
- /** Two-sided false-alarm probability supplied by the caller. */
3504
- alpha: number;
3505
- /** Detection power supplied by the caller. */
3506
- power: number;
3507
- /** Missed-detection probability passed to the core calculation. */
3508
- beta: number;
3509
- /** Baarda w-test noncentrality distance. */
3510
- delta0: number;
3511
- /** Squared noncentrality distance. */
3512
- lambda0: number;
3513
- }
3514
-
3515
- /** One range-observation row accepted by `reliabilityDesign`. */
3516
- export interface RangeReliabilityRow {
3517
- /** Observation identifier echoed into the report. */
3518
- id: string;
3519
- /** Linearized design row for this range observation. */
3520
- designRow: number[];
3521
- /** Externally supplied one-sigma range model, metres. */
3522
- sigmaM: number;
3523
- }
3524
-
3525
- /** Options accepted by `reliabilityDesign` and `reliabilityAraim`. */
3526
- export interface ReliabilityOptions {
3527
- /** Two-sided false-alarm probability for the one-dimensional w-test. */
3528
- alpha?: number;
3529
- /** Detection power. Mutually exclusive with `beta`. Defaults to 0.80. */
3530
- power?: number;
3531
- /** Missed-detection probability. Mutually exclusive with `power`. */
3532
- beta?: number;
3533
- /** Optional precomputed noncentrality parameter. */
3534
- lambda0Override?: number;
3535
- /** Alias for `lambda0Override`. */
3536
- lambda0?: number;
3537
- /** Redundancy floor below which an observation is uncheckable. */
3538
- minRedundancy?: number;
3539
- }
3540
-
3541
- /** Reliability diagnostics for one observation. */
3542
- export interface ObservationReliability {
3543
- /** Observation identifier echoed from the input row. */
3544
- id: string;
3545
- /** Redundancy number for this observation. */
3546
- redundancy: number;
3547
- /** Minimal detectable bias, metres, or `null` when uncheckable. */
3548
- mdbM: number | null;
3549
- /** External effect vector, metres, or `null` when unavailable. */
3550
- externalEnuM: [number, number, number] | null;
3551
- /** Bias-to-noise ratio in state space, or `null` when uncheckable. */
3552
- biasToNoise: number | null;
3553
- /** True when redundancy is below the reporting floor. */
3554
- uncheckable: boolean;
3555
- }
3556
-
3557
- /** Observation carrying the largest finite MDB in a reliability report. */
3558
- export interface ReliabilityMaxMdb {
3559
- /** Observation identifier. */
3560
- id: string;
3561
- /** Largest finite MDB, metres. */
3562
- mdbM: number;
3563
- }
3564
-
3565
- /** Observation carrying the smallest redundancy number. */
3566
- export interface ReliabilityMinRedundancy {
3567
- /** Observation identifier. */
3568
- id: string;
3569
- /** Smallest redundancy number. */
3570
- redundancy: number;
3571
- }
3572
-
3573
- /** Aggregate reliability diagnostics for a design. */
3574
- export interface ReliabilitySummary {
3575
- /** Number of observations in the design. */
3576
- nObs: number;
3577
- /** Number of estimated parameters in the design. */
3578
- nParams: number;
3579
- /** Algebraic degrees of freedom, `nObs - nParams`. */
3580
- dof: number;
3581
- /** Sum of per-observation redundancy numbers. */
3582
- sumRedundancy: number;
3583
- /** Noncentrality parameter used for MDB calculations. */
3584
- lambda0: number;
3585
- /** Largest finite MDB, or `null` if no observation is checkable. */
3586
- maxMdbM: ReliabilityMaxMdb | null;
3587
- /** Smallest redundancy number and its observation identifier. */
3588
- minRedundancy: ReliabilityMinRedundancy;
3589
- /** Count of observations reported as uncheckable. */
3590
- nUncheckable: number;
3591
- }
3592
-
3593
- /** Full reliability design report. */
3594
- export interface ReliabilityReport {
3595
- /** Per-observation reliability diagnostics, in input order. */
3596
- perObservation: ObservationReliability[];
3597
- /** Aggregate design diagnostics. */
3598
- summary: ReliabilitySummary;
3599
- }
3600
-
3601
- /** One SBAS or ARAIM protection-geometry row. */
3602
- export interface ProtectionRow {
3603
- /** Satellite token such as `"G01"`. */
3604
- id: string;
3605
- /** ECEF line-of-sight unit vector. */
3606
- lineOfSight: [number, number, number];
3607
- /** Optional GNSS system label. Defaults to the system encoded in `id`. */
3608
- system?: string;
3609
- /** Satellite elevation angle, radians. */
3610
- elevationRad: number;
3611
- }
3612
-
3613
- /** Receiver coordinates used by SBAS and ARAIM protection geometry. */
3614
- export interface ProtectionReceiver {
3615
- /** Geodetic latitude, radians. */
3616
- latRad: number;
3617
- /** Geodetic longitude, radians east. */
3618
- lonRad: number;
3619
- /** Ellipsoidal height above WGS84, metres. */
3620
- heightM: number;
3621
- }
3622
-
3623
- /** Protection geometry accepted by `sbasProtectionLevels` and `reliabilityAraim`. */
3624
- export interface ProtectionGeometry {
3625
- /** Satellite rows in input order. */
3626
- rows: ProtectionRow[];
3627
- /** Receiver geodetic coordinates. */
3628
- receiver: ProtectionReceiver;
3629
- /** Active receiver clock systems, such as `["G"]`. */
3630
- clockSystems: string[];
3631
- }
3632
-
3633
- /** Plain-object row accepted by `new SbasErrorModel(rows)`. */
3634
- export interface SbasSisErrorInput {
3635
- /** Satellite token matching a protection-geometry row. */
3636
- id: string;
3637
- /** Total one-sigma range term, metres. Mutually exclusive with components. */
3638
- sigmaM?: number;
3639
- /** Fast and long-term correction residual sigma, metres. */
3640
- sigmaFltM?: number;
3641
- /** User ionospheric range-error sigma, metres. */
3642
- sigmaUireM?: number;
3643
- /** Airborne receiver noise, divergence, and multipath sigma, metres. */
3644
- sigmaAirM?: number;
3645
- /** Tropospheric residual sigma, metres. */
3646
- sigmaTropoM?: number;
3647
- }
1
+ export {};