@neilberkman/sidereon 0.9.0 → 0.9.2

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.
@@ -1367,6 +1367,37 @@ export class Ephemeris {
1367
1367
  readonly velocityKmS: Float64Array;
1368
1368
  }
1369
1369
 
1370
+ /**
1371
+ * A confidence ellipse from a 2x2 covariance block: semi-axes scaled by the
1372
+ * two-degree-of-freedom chi-square quantile `-2 ln(1 - confidence)`.
1373
+ */
1374
+ export class ErrorEllipse2 {
1375
+ private constructor();
1376
+ free(): void;
1377
+ [Symbol.dispose](): void;
1378
+ /**
1379
+ * Two-degree-of-freedom chi-square scale `-2 ln(1 - confidence)`.
1380
+ */
1381
+ readonly chiSquareScale: number;
1382
+ /**
1383
+ * Requested confidence probability in `(0, 1)`.
1384
+ */
1385
+ readonly confidence: number;
1386
+ /**
1387
+ * Semi-major-axis orientation in radians, from the first (row/col 0) axis
1388
+ * toward the second (row/col 1) axis.
1389
+ */
1390
+ readonly orientationRad: number;
1391
+ /**
1392
+ * Semi-major axis length (same unit as the square root of the covariance).
1393
+ */
1394
+ readonly semiMajor: number;
1395
+ /**
1396
+ * Semi-minor axis length.
1397
+ */
1398
+ readonly semiMinor: number;
1399
+ }
1400
+
1370
1401
  /**
1371
1402
  * A fault-detection-and-exclusion result: the surviving solution, the excluded
1372
1403
  * satellites in exclusion order, and the number of exclusions performed.
@@ -2193,6 +2224,95 @@ export class LeapSecondTable {
2193
2224
  readonly source: string;
2194
2225
  }
2195
2226
 
2227
+ /**
2228
+ * A serial leave-one-out sweep: the base solve over all rows plus one re-solve
2229
+ * per masked row, with the per-row optimum-cost shift.
2230
+ */
2231
+ export class LeastSquaresDropOneReport {
2232
+ private constructor();
2233
+ free(): void;
2234
+ [Symbol.dispose](): void;
2235
+ /**
2236
+ * The solve with residual row `index` masked out. Throws a `RangeError` for
2237
+ * an out-of-range index.
2238
+ */
2239
+ dropAt(index: number): LeastSquaresResult;
2240
+ /**
2241
+ * The solve over the full residual.
2242
+ */
2243
+ readonly base: LeastSquaresResult;
2244
+ /**
2245
+ * `costDeltas[i] = dropAt(i).cost - base.cost`: how much the optimum cost
2246
+ * moves when row `i` is removed. `Float64Array` of length `count`.
2247
+ */
2248
+ readonly costDeltas: Float64Array;
2249
+ /**
2250
+ * Number of masked-row re-solves (equals the residual-row count `m`).
2251
+ */
2252
+ readonly count: number;
2253
+ }
2254
+
2255
+ /**
2256
+ * The outcome of one trust-region least-squares solve, mirroring the fields of
2257
+ * `scipy.optimize.least_squares`'s `OptimizeResult`.
2258
+ */
2259
+ export class LeastSquaresResult {
2260
+ private constructor();
2261
+ free(): void;
2262
+ [Symbol.dispose](): void;
2263
+ /**
2264
+ * Optimal cost `0.5 * sum(residual^2)` (after robust reweighting when a
2265
+ * non-linear loss is used).
2266
+ */
2267
+ readonly cost: number;
2268
+ /**
2269
+ * Residual vector at the solution, `Float64Array` of length `m`.
2270
+ */
2271
+ readonly fun: Float64Array;
2272
+ /**
2273
+ * Gradient `J^T f` at the solution, `Float64Array` of length `n`.
2274
+ */
2275
+ readonly grad: Float64Array;
2276
+ /**
2277
+ * Row-major `m`-by-`n` Jacobian at the solution, flat `Float64Array` of
2278
+ * length `m * n`.
2279
+ */
2280
+ readonly jac: Float64Array;
2281
+ /**
2282
+ * Residual row count `m`.
2283
+ */
2284
+ readonly m: number;
2285
+ /**
2286
+ * Parameter count `n`.
2287
+ */
2288
+ readonly n: number;
2289
+ /**
2290
+ * Number of residual evaluations.
2291
+ */
2292
+ readonly nfev: number;
2293
+ /**
2294
+ * Number of Jacobian evaluations.
2295
+ */
2296
+ readonly njev: number;
2297
+ /**
2298
+ * First-order optimality `||J^T f||_inf` at the solution.
2299
+ */
2300
+ readonly optimality: number;
2301
+ /**
2302
+ * SciPy-compatible termination status: `0` max evaluations, `1` gtol,
2303
+ * `2` ftol, `3` xtol, `4` both ftol and xtol.
2304
+ */
2305
+ readonly status: number;
2306
+ /**
2307
+ * Whether the solve converged (`status > 0`).
2308
+ */
2309
+ readonly success: boolean;
2310
+ /**
2311
+ * Solution parameter vector, `Float64Array` of length `n`.
2312
+ */
2313
+ readonly x: Float64Array;
2314
+ }
2315
+
2196
2316
  /**
2197
2317
  * Link-budget inputs for [`LinkBudget.margin`].
2198
2318
  */
@@ -2421,6 +2541,49 @@ export class MappingFactors {
2421
2541
  readonly wet: number;
2422
2542
  }
2423
2543
 
2544
+ /**
2545
+ * One refined Moon elevation threshold crossing (moonrise / moonset).
2546
+ */
2547
+ export class MoonElevationCrossing {
2548
+ private constructor();
2549
+ free(): void;
2550
+ [Symbol.dispose](): void;
2551
+ /**
2552
+ * Topocentric Moon elevation at the refined instant, degrees.
2553
+ */
2554
+ readonly elevationDeg: number;
2555
+ /**
2556
+ * Crossing direction: `"rising"` (moonrise) or `"setting"` (moonset).
2557
+ */
2558
+ readonly kind: string;
2559
+ /**
2560
+ * Refined crossing instant, unix microseconds.
2561
+ */
2562
+ readonly timeUnixUs: bigint;
2563
+ }
2564
+
2565
+ /**
2566
+ * One refined Moon meridian transit (culmination).
2567
+ */
2568
+ export class MoonTransit {
2569
+ private constructor();
2570
+ free(): void;
2571
+ [Symbol.dispose](): void;
2572
+ /**
2573
+ * Topocentric Moon elevation at the refined instant, degrees.
2574
+ */
2575
+ readonly elevationDeg: number;
2576
+ /**
2577
+ * Culmination kind: `"upper"` (due south, highest) or `"lower"` (due north,
2578
+ * lowest).
2579
+ */
2580
+ readonly kind: string;
2581
+ /**
2582
+ * Refined culmination instant, unix microseconds.
2583
+ */
2584
+ readonly timeUnixUs: bigint;
2585
+ }
2586
+
2424
2587
  /**
2425
2588
  * One solved moving-baseline epoch.
2426
2589
  */
@@ -3500,6 +3663,61 @@ export class PppFloatSolution {
3500
3663
  readonly ztdResidualM: number | undefined;
3501
3664
  }
3502
3665
 
3666
+ /**
3667
+ * A precise-ephemeris source built from samples rather than parsed SP3 text.
3668
+ *
3669
+ * Implements the same `ObservableEphemerisSource` contract as a parsed [`Sp3`]
3670
+ * product and shares its interpolation substrate, so [`predictRanges`] accepts
3671
+ * either handle. Build one with [`preciseEphemerisSamplesFromSamples`].
3672
+ */
3673
+ export class PreciseEphemerisSampleSource {
3674
+ private constructor();
3675
+ free(): void;
3676
+ [Symbol.dispose](): void;
3677
+ /**
3678
+ * Predict geometric ranges for many requests in one call. See the shared
3679
+ * [`predictRanges`](crate::precise_samples::predict_ranges_over) contract;
3680
+ * this is the sample-source entry point.
3681
+ */
3682
+ predictRanges(requests: any, options: any): any;
3683
+ /**
3684
+ * The satellites this source can interpolate (e.g. `"G01"`), ascending.
3685
+ */
3686
+ readonly satellites: string[];
3687
+ }
3688
+
3689
+ /**
3690
+ * The per-request results of a batch observable prediction, index-aligned to
3691
+ * the input requests. Each request independently either produced observables or
3692
+ * failed; query a request with [`PredictBatch.isOk`] /
3693
+ * [`PredictBatch.observables`] / [`PredictBatch.error`].
3694
+ */
3695
+ export class PredictBatch {
3696
+ private constructor();
3697
+ free(): void;
3698
+ [Symbol.dispose](): void;
3699
+ /**
3700
+ * The failure message for request `index`, or `undefined` when it
3701
+ * succeeded. Throws a `RangeError` for an out-of-range index.
3702
+ */
3703
+ error(index: number): string | undefined;
3704
+ /**
3705
+ * Whether request `index` produced observables. Throws a `RangeError` for
3706
+ * an out-of-range index.
3707
+ */
3708
+ isOk(index: number): boolean;
3709
+ /**
3710
+ * The observables for request `index`. Throws a `RangeError` for an
3711
+ * out-of-range index and an `Error` carrying that request's failure message
3712
+ * when the prediction failed (check [`PredictBatch.isOk`] first).
3713
+ */
3714
+ observables(index: number): PredictedObservables;
3715
+ /**
3716
+ * Number of requests in the batch.
3717
+ */
3718
+ readonly count: number;
3719
+ }
3720
+
3503
3721
  /**
3504
3722
  * Predicted GNSS observables for one satellite at one receive epoch. Every
3505
3723
  * field is computed by `sidereon_core::observables::predict`.
@@ -4129,6 +4347,16 @@ export class Sp3 {
4129
4347
  * coverage gap (the engine refuses to extrapolate).
4130
4348
  */
4131
4349
  interpolate(satellite: string, j2000_seconds: Float64Array): Sp3Interpolation;
4350
+ /**
4351
+ * Predict geometric ranges for many `(satellite, receiver, epoch)` requests
4352
+ * against this ephemeris in one call. `requests` is an array of
4353
+ * `{ sat, receiverEcefM, tRxJ2000S }`; returns an array of
4354
+ * `{ geometricRangeM, satClockS, transmitTimeJ2000S, satPosEcefM }`
4355
+ * index-aligned to `requests`. The same call shape works on a
4356
+ * `PreciseEphemerisSampleSource`. Delegates to the serial reference kernel
4357
+ * `sidereon_core::observables::predict_ranges`.
4358
+ */
4359
+ predictRanges(requests: any, options: any): any;
4132
4360
  /**
4133
4361
  * Run single-point positioning against this ephemeris.
4134
4362
  *
@@ -5119,6 +5347,21 @@ export function collisionProbability(object1: ConjunctionState, object2: Conjunc
5119
5347
  */
5120
5348
  export function correlate(iq: Float64Array, prn: bigint, options: any): CorrelationResult;
5121
5349
 
5350
+ /**
5351
+ * Fitted parameter covariance from a converged solve, scaling `(J^T J)^-1` by
5352
+ * the post-fit reduced chi-square `s_sq = 2 * cost / (m - n)` (the same scale
5353
+ * `scipy.optimize.curve_fit` applies to its `pcov`).
5354
+ *
5355
+ * `jacobian` is a flat row-major `(m, n)` `Float64Array` (the Jacobian at the
5356
+ * solution), and `cost` is the solve's optimal cost `0.5 * sum(residual^2)`;
5357
+ * the degrees of freedom `m - n` (taken from the Jacobian's own shape) must be
5358
+ * positive. Pairs naturally with a [`crate::LeastSquaresResult`] (`result.jac`,
5359
+ * `result.m`, `result.n`, `result.cost`). Returns the `n`-by-`n` covariance as
5360
+ * a flat row-major `Float64Array`. Delegates to
5361
+ * `sidereon_core::astro::math::least_squares::covariance_from_jacobian`.
5362
+ */
5363
+ export function covarianceFromJacobian(jacobian: Float64Array, m: number, n: number, cost: number): Float64Array;
5364
+
5122
5365
  /**
5123
5366
  * Whether a 3x3 covariance (flat row-major length 9) is symmetric positive
5124
5367
  * semidefinite within the engine tolerance.
@@ -5221,6 +5464,19 @@ export function diff(previous: any, current: any): any;
5221
5464
  */
5222
5465
  export function dishGain(diameter_m: number, frequency_hz: number, efficiency: number): number;
5223
5466
 
5467
+ /**
5468
+ * GNSS dilution of precision with an explicit ENU convention for the
5469
+ * horizontal/vertical split.
5470
+ *
5471
+ * `lineOfSight` is a flat row-major `(n, 3)` `Float64Array` of ECEF unit
5472
+ * vectors, `weights` a positive `Float64Array` of length `n`, and `convention`
5473
+ * is `"geodeticNormal"` (the GNSS-standard default, matching [`gnssDop`]) or
5474
+ * `"geocentricRadial"` (radial up). Only HDOP/VDOP differ between conventions
5475
+ * (by ~`1e-3` relative); GDOP/PDOP/TDOP are identical. Delegates to
5476
+ * `sidereon_core::geometry::dop_with_convention`.
5477
+ */
5478
+ export function dopWithConvention(line_of_sight: Float64Array, weights: Float64Array, receiver: Wgs84Geodetic, convention: string): Dop;
5479
+
5224
5480
  /**
5225
5481
  * Range rate and dimensionless Doppler ratio from a GCRS state.
5226
5482
  *
@@ -5267,6 +5523,33 @@ export function ecefToGeodetic(position_km: Float64Array): Float64Array;
5267
5523
  */
5268
5524
  export function eclipseStatus(satellite_position_km: Float64Array, sun_position_km: Float64Array): string[];
5269
5525
 
5526
+ /**
5527
+ * Ellipsoidal height `h = H + N` (metres above the WGS84 ellipsoid) from an
5528
+ * orthometric height and a geodetic position in radians, using the embedded
5529
+ * genuine EGM96 1-degree model. Delegates to
5530
+ * `sidereon_core::geoid::egm96_ellipsoidal_height_m`.
5531
+ */
5532
+ export function egm96EllipsoidalHeightM(orthometric_height_m: number, lat_rad: number, lon_rad: number): number;
5533
+
5534
+ /**
5535
+ * Orthometric height `H = h - N` (metres above mean sea level) from an
5536
+ * ellipsoidal height and a geodetic position in radians, using the embedded
5537
+ * genuine EGM96 1-degree model. Delegates to
5538
+ * `sidereon_core::geoid::egm96_orthometric_height_m`.
5539
+ */
5540
+ export function egm96OrthometricHeightM(ellipsoidal_height_m: number, lat_rad: number, lon_rad: number): number;
5541
+
5542
+ /**
5543
+ * Geoid undulation `N` (metres above the WGS84 ellipsoid) at a geodetic
5544
+ * position in radians, from the embedded GENUINE EGM96 1-degree global grid.
5545
+ * Latitude is positive north, longitude positive east. This is the recommended
5546
+ * zero-setup default for metre-class datum work (its bilinear lookup agrees
5547
+ * with the full 15-arcminute EGM96 grid to ~0.4 m RMS); the coarse
5548
+ * [`geoidUndulation`] is only suitable for sanity checks. Delegates to
5549
+ * `sidereon_core::geoid::egm96_undulation`.
5550
+ */
5551
+ export function egm96Undulation(lat_rad: number, lon_rad: number): number;
5552
+
5270
5553
  /**
5271
5554
  * Effective isotropic radiated power, dBW.
5272
5555
  */
@@ -5328,6 +5611,39 @@ export function encounterFrame(position1_km: Float64Array, velocity1_km_s: Float
5328
5611
  */
5329
5612
  export function encounterPlaneCovariance(frame: EncounterFrame, covariance_km2: Float64Array): Float64Array;
5330
5613
 
5614
+ /**
5615
+ * Confidence ellipse from an arbitrary 2x2 covariance block.
5616
+ *
5617
+ * `covariance` is a flat row-major length-4 `Float64Array` (`[c00, c01, c10,
5618
+ * c11]`); `confidence` is in `(0, 1)`. The semi-axes are the eigenvalues of the
5619
+ * symmetrized block scaled by the chi-square(2) quantile. Throws a `RangeError`
5620
+ * for a non-positive-semidefinite block or an out-of-range confidence.
5621
+ * Delegates to `sidereon_core::geometry::error_ellipse_2x2`.
5622
+ */
5623
+ export function errorEllipse2(covariance: Float64Array, confidence: number): ErrorEllipse2;
5624
+
5625
+ /**
5626
+ * Find Moon elevation threshold crossings (moonrise / moonset) over a UTC
5627
+ * window.
5628
+ *
5629
+ * The station is geodetic (`latitudeDeg`, `longitudeDeg`, `altitudeKm`);
5630
+ * `startUnixUs` / `endUnixUs` bound the window in unix microseconds. `options`
5631
+ * is `{ elevationThresholdDeg?, stepSeconds?, timeToleranceSeconds? }`.
5632
+ * Delegates to `sidereon_core::astro::bodies::find_moon_elevation_crossings`.
5633
+ */
5634
+ export function findMoonElevationCrossings(latitude_deg: number, longitude_deg: number, altitude_km: number, start_unix_us: bigint, end_unix_us: bigint, options: any): MoonElevationCrossing[];
5635
+
5636
+ /**
5637
+ * Find Moon meridian transits (upper and lower culminations) over a UTC window.
5638
+ *
5639
+ * The station is geodetic (`latitudeDeg`, `longitudeDeg`, `altitudeKm`);
5640
+ * `startUnixUs` / `endUnixUs` bound the window in unix microseconds.
5641
+ * `stepSeconds` is the uniform scan step and `timeToleranceSeconds` the
5642
+ * refinement tolerance. Delegates to
5643
+ * `sidereon_core::astro::bodies::find_moon_transits`.
5644
+ */
5645
+ export function findMoonTransits(latitude_deg: number, longitude_deg: number, altitude_km: number, start_unix_us: bigint, end_unix_us: bigint, step_seconds: number, time_tolerance_seconds: number): MoonTransit[];
5646
+
5331
5647
  /**
5332
5648
  * Find local TCA candidates between two satellites over a UTC window.
5333
5649
  *
@@ -5601,6 +5917,24 @@ export function gnssVisibilitySeries(sp3: Sp3, station_ecef_m: Float64Array, sta
5601
5917
  */
5602
5918
  export function gnssVisible(sp3: Sp3, station_ecef_m: Float64Array, j2000_seconds: number, options: any): GnssVisibleSatellite[];
5603
5919
 
5920
+ /**
5921
+ * GPS - UTC (the GNSS leap-second offset since the GPS epoch) on a UTC calendar
5922
+ * date: the IS-GPS-200 quantity broadcast in the navigation message (18 s from
5923
+ * 2017-01-01). Equals `taiUtcOffsetS - 19`. Use this, not [`taiUtcOffsetS`],
5924
+ * whenever you mean the leap seconds a GPS receiver applies. Delegates to
5925
+ * `sidereon_core::astro::time::scales::gps_utc_offset_s`.
5926
+ */
5927
+ export function gpsUtcOffsetS(year: number, month: number, day: number): number;
5928
+
5929
+ /**
5930
+ * Trace of the Gauss-Newton Hessian approximation `J^T J`: the sum of the
5931
+ * squared column norms of the Jacobian, with no inverse formed.
5932
+ *
5933
+ * `jacobian` is a flat row-major `(m, n)` `Float64Array`. Delegates to
5934
+ * `sidereon_core::astro::math::least_squares::hessian_trace`.
5935
+ */
5936
+ export function hessianTrace(jacobian: Float64Array, m: number, n: number): number;
5937
+
5604
5938
  /**
5605
5939
  * Gauss angles-only orbit determination.
5606
5940
  *
@@ -5670,6 +6004,17 @@ export function itrsToGcrs(position_km: Float64Array, epochs_unix_us: BigInt64Ar
5670
6004
  */
5671
6005
  export function j2000SecondsToCivil(seconds: bigint): CivilDateTime;
5672
6006
 
6007
+ /**
6008
+ * Jarque-Bera normality test on a residual set.
6009
+ *
6010
+ * `x` is a `Float64Array` (at least two values). Returns
6011
+ * `{ statistic, pValue }` with `statistic = n/6 (S^2 + K^2/4)` (biased moments)
6012
+ * and the chi-square(2) survival `pValue = exp(-statistic/2)`, matching
6013
+ * `scipy.stats.jarque_bera`. Delegates to
6014
+ * `sidereon_core::quality::normality::jarque_bera`.
6015
+ */
6016
+ export function jarqueBera(x: Float64Array): any;
6017
+
5673
6018
  /**
5674
6019
  * GPS broadcast Klobuchar ionospheric group delay in the model's native units
5675
6020
  * (positive metres).
@@ -5686,6 +6031,17 @@ export function j2000SecondsToCivil(seconds: bigint): CivilDateTime;
5686
6031
  */
5687
6032
  export function klobucharDelay(alpha: Float64Array, beta: Float64Array, lat_deg: number, lon_deg: number, azimuth_deg: number, elevation_deg: number, t_gps_s: number, frequency_hz: number): number;
5688
6033
 
6034
+ /**
6035
+ * Sample kurtosis of a residual set.
6036
+ *
6037
+ * `x` is a `Float64Array`. `fisher` (default `true`) returns the excess
6038
+ * kurtosis `m4 / m2^2 - 3` (Gaussian -> 0, `scipy.stats.kurtosis`); `false`
6039
+ * returns the Pearson kurtosis (Gaussian -> 3). `bias` (default `true`); pass
6040
+ * `false` for the sample correction (needs at least four values). Delegates to
6041
+ * `sidereon_core::quality::normality::kurtosis`.
6042
+ */
6043
+ export function kurtosis(x: Float64Array, fisher?: boolean | null, bias?: boolean | null): number;
6044
+
5689
6045
  /**
5690
6046
  * Resolve integer ambiguities with the LAMBDA method (RTKLIB `lambda()` port).
5691
6047
  *
@@ -5729,6 +6085,31 @@ export function leapSeconds(year: number, month: number, day: number): number;
5729
6085
  */
5730
6086
  export function leapSecondsBatch(dates: Int32Array): Float64Array;
5731
6087
 
6088
+ /**
6089
+ * Solve a generic data-driven least-squares problem.
6090
+ *
6091
+ * `request` is a `DataProblemInput` object: a `kind` (`"linear"`,
6092
+ * `"polynomial"`, `"exponential"`) carrying its data arrays, the `x0` starting
6093
+ * point, and the SciPy `least_squares` options. The whole trust-region
6094
+ * iteration runs in Rust through
6095
+ * `trust_region_least_squares::data::solve_data_problem` (the serial entry, the
6096
+ * default in-crate SVD backend); no rayon thread pool is entered.
6097
+ */
6098
+ export function leastSquares(request: any): LeastSquaresResult;
6099
+
6100
+ /**
6101
+ * Serial leave-one-out (jackknife) over a data-driven least-squares problem.
6102
+ *
6103
+ * Delegates to the core's serial leave-one-out entry
6104
+ * `trust_region_least_squares::batch::solve_data_problem_drop_one_serial`: the
6105
+ * full problem is solved once, then re-solved with each residual row masked in
6106
+ * turn. The core's default `solve_data_problem_drop_one` fans these re-solves
6107
+ * across a rayon pool that wasm has no threads for, so this binding takes the
6108
+ * serial twin, which runs the identical re-solves one row at a time and is
6109
+ * byte-identical to the parallel version.
6110
+ */
6111
+ export function leastSquaresDropOne(request: any): LeastSquaresDropOneReport;
6112
+
5732
6113
  /**
5733
6114
  * Decode LNAV subframes 1-3 back into engineering-unit parameters.
5734
6115
  *
@@ -5854,11 +6235,47 @@ export function mergeNavcen(records: any, statuses: any): any;
5854
6235
  */
5855
6236
  export function mergeSp3(sources: Sp3[], options: any): Sp3MergeResult;
5856
6237
 
6238
+ /**
6239
+ * Mean, variance, skewness, and excess kurtosis of a residual set in one pass.
6240
+ *
6241
+ * `x` is a `Float64Array`; `fisher` and `bias` select the kurtosis convention
6242
+ * and the bias correction exactly as in [`skewness`] / [`kurtosis`] (both
6243
+ * default `true`). Returns `{ mean, variance, skewness, kurtosisExcess }`; the
6244
+ * variance is the biased second central moment. Delegates to
6245
+ * `sidereon_core::quality::normality::moments`.
6246
+ */
6247
+ export function moments(x: Float64Array, fisher?: boolean | null, bias?: boolean | null): any;
6248
+
5857
6249
  /**
5858
6250
  * Angle in degrees between satellite nadir and the Moon direction.
5859
6251
  */
5860
6252
  export function moonAngle(satellite_position_km: Float64Array, moon_position_km: Float64Array): Float64Array;
5861
6253
 
6254
+ /**
6255
+ * Topocentric azimuth/elevation/range of the Moon from a ground site,
6256
+ * including the diurnal parallax. See [`sunAzEl`] for the argument shapes.
6257
+ * Delegates to `sidereon_core::astro::bodies::moon_az_el`.
6258
+ */
6259
+ export function moonAzEl(latitude_deg: number, longitude_deg: number, altitude_km: number, epoch_unix_us: bigint): any;
6260
+
6261
+ /**
6262
+ * Topocentric geometric Moon (disk-center) elevation from a ground site,
6263
+ * degrees. See [`sunAzEl`] for the argument shapes. Delegates to
6264
+ * `sidereon_core::astro::bodies::moon_az_el` and returns its `elevationDeg`: the
6265
+ * core `moon_elevation_deg` convenience wrapper `expect`s on the geometry, so a
6266
+ * valid-shaped but out-of-range station (e.g. latitude 120) would panic the
6267
+ * wasm module; going through `moon_az_el` surfaces that as a thrown JS error.
6268
+ */
6269
+ export function moonElevationDeg(latitude_deg: number, longitude_deg: number, altitude_km: number, epoch_unix_us: bigint): number;
6270
+
6271
+ /**
6272
+ * Illuminated fraction of the Moon as seen from a ground site. Returns
6273
+ * `{ illuminatedFraction, phaseAngleDeg }` (0 = new, 1 = full). See [`sunAzEl`]
6274
+ * for the argument shapes. Delegates to
6275
+ * `sidereon_core::astro::bodies::moon_illumination`.
6276
+ */
6277
+ export function moonIllumination(latitude_deg: number, longitude_deg: number, altitude_km: number, epoch_unix_us: bigint): any;
6278
+
5862
6279
  /**
5863
6280
  * Narrow-lane code combination, metres.
5864
6281
  */
@@ -5901,6 +6318,21 @@ export function nequickGStecTecu(_eval: any): number;
5901
6318
  */
5902
6319
  export function noiseAmplification(f1_hz: number, f2_hz: number): number;
5903
6320
 
6321
+ /**
6322
+ * Parameter covariance from a design (Jacobian) matrix via the Gauss-Newton
6323
+ * normal equations `varianceScale * (J^T J)^-1`, formed from the thin SVD of
6324
+ * `J` (not by inverting `J^T J`, so the condition number is not squared).
6325
+ *
6326
+ * `jacobian` is a flat row-major `(m, n)` `Float64Array` with `m >= n`;
6327
+ * `varianceScale` (`sigma^2`, non-negative) scales the bare cofactor (pass the
6328
+ * post-fit reduced chi-square for the fitted covariance, or `1.0` for
6329
+ * `(J^T J)^-1`). Returns the `n`-by-`n` covariance as a flat row-major
6330
+ * `Float64Array` of length `n * n`. Throws an `Error` for a rank-deficient
6331
+ * Jacobian. Delegates to
6332
+ * `sidereon_core::astro::math::least_squares::normal_covariance`.
6333
+ */
6334
+ export function normalCovariance(jacobian: Float64Array, m: number, n: number, variance_scale: number): Float64Array;
6335
+
5904
6336
  /**
5905
6337
  * Predict observables for one satellite from a broadcast ephemeris store.
5906
6338
  * Delegates to `sidereon_core::observables::predict`.
@@ -6084,6 +6516,40 @@ export function phaseMeters(phi_cycles: number, f_hz: number): number;
6084
6516
  */
6085
6517
  export function pppCorrections(sp3: Sp3, epochs: any, receiver_ecef_m: Float64Array, options: any): any;
6086
6518
 
6519
+ /**
6520
+ * Build a sample-backed precise-ephemeris source from an array of samples.
6521
+ *
6522
+ * `samples` is an array of `{ sat, epoch, positionEcefM, clockS?, clockEvent? }`
6523
+ * objects (see the sample field docs). Samples are grouped by satellite in their
6524
+ * supplied order; each satellite needs at least two strictly time-increasing
6525
+ * samples. Throws a `TypeError` for a malformed object or bad satellite token
6526
+ * and a `RangeError` for a non-finite epoch or a source validation failure
6527
+ * (empty input, a single-sample satellite, non-monotonic epochs, a non-finite
6528
+ * sample). Delegates to `sidereon_core::sp3::PreciseEphemerisSamples::from_samples`.
6529
+ */
6530
+ export function preciseEphemerisSamplesFromSamples(samples: any): PreciseEphemerisSampleSource;
6531
+
6532
+ /**
6533
+ * Predict observables for many `(satellite, receiver, epoch)` requests from a
6534
+ * broadcast ephemeris store, serially. See [`predictBatchSp3`] for the argument
6535
+ * shapes. Delegates to the serial `sidereon_core::observables::predict_batch`.
6536
+ */
6537
+ export function predictBatchBroadcast(broadcast: BroadcastEphemeris, satellites: string[], receivers_ecef_m: Float64Array, epochs_j2000_s: Float64Array, options: any): PredictBatch;
6538
+
6539
+ /**
6540
+ * Predict observables for many `(satellite, receiver, epoch)` requests from an
6541
+ * SP3 precise product, serially.
6542
+ *
6543
+ * `satellites` is an array of satellite tokens, `receiversEcefM` a flat
6544
+ * row-major `(n, 3)` `Float64Array` of receiver ECEF positions (metres), and
6545
+ * `epochsJ2000S` a `Float64Array` of receive epochs (seconds since J2000); all
6546
+ * three are index-aligned and length `n`. Element `i` of the result corresponds
6547
+ * to request `i`. Delegates to the serial reference kernel
6548
+ * `sidereon_core::observables::predict_batch`; the binding never spawns the
6549
+ * rayon thread pool the parallel variant uses.
6550
+ */
6551
+ export function predictBatchSp3(sp3: Sp3, satellites: string[], receivers_ecef_m: Float64Array, epochs_j2000_s: Float64Array, options: any): PredictBatch;
6552
+
6087
6553
  /**
6088
6554
  * Prepare ionosphere-free single-frequency RTK arc inputs from a
6089
6555
  * dual-frequency arc and fixed wide-lane ambiguities.
@@ -6264,12 +6730,32 @@ export function selectSp3OverRange(products: Sp3[], start_epoch_j2000_s: number,
6264
6730
  */
6265
6731
  export function shadowFraction(satellite_position_km: Float64Array, sun_position_km: Float64Array): Float64Array;
6266
6732
 
6733
+ /**
6734
+ * Shapiro-Wilk normality test on a residual set.
6735
+ *
6736
+ * `x` is a `Float64Array` (at least three values). Returns `{ w, pValue }`,
6737
+ * Royston's AS R94 port that `scipy.stats.shapiro` uses; `w` is in `(0, 1]`
6738
+ * (closer to one is more Gaussian). Delegates to
6739
+ * `sidereon_core::quality::normality::shapiro_wilk`.
6740
+ */
6741
+ export function shapiroWilk(x: Float64Array): any;
6742
+
6267
6743
  /**
6268
6744
  * Build satellite-keyed pseudorange sigmas in metres from `{ satelliteId,
6269
6745
  * elevationDeg, cn0Dbhz? }` entries. Invalid entries are dropped by the core.
6270
6746
  */
6271
6747
  export function sigmas(entries: any, options: any): SatelliteVector;
6272
6748
 
6749
+ /**
6750
+ * Sample skewness of a residual set.
6751
+ *
6752
+ * `x` is a `Float64Array`. `bias` (default `true`) selects the Fisher-Pearson
6753
+ * coefficient `g1 = m3 / m2^(3/2)` (`scipy.stats.skew`); `false` applies the
6754
+ * sample correction (`scipy.stats.skew(bias=False)`, needs at least three
6755
+ * values). Delegates to `sidereon_core::quality::normality::skewness`.
6756
+ */
6757
+ export function skewness(x: Float64Array, bias?: boolean | null): number;
6758
+
6273
6759
  /**
6274
6760
  * Stable lower-case label for a slip reason.
6275
6761
  */
@@ -6432,6 +6918,20 @@ export function solveVelocityBroadcast(broadcast: BroadcastEphemeris, observatio
6432
6918
  */
6433
6919
  export function solveWithFallback(precise: Sp3[], broadcast: BroadcastEphemeris, request: any, policy: any): SourcedSolution;
6434
6920
 
6921
+ /**
6922
+ * Extract a parsed SP3 product as the canonical precise-ephemeris samples, one
6923
+ * per real position record in ascending epoch order.
6924
+ *
6925
+ * Returns an array of `{ sat, epoch, positionEcefM, clockS, clockEvent }`
6926
+ * objects. Round-tripping the result back through
6927
+ * [`preciseEphemerisSamplesFromSamples`] rebuilds an interpolatable source that
6928
+ * reproduces the SP3-parsed source's interpolated states and predicted ranges
6929
+ * to the documented round-trip precision (byte-identical for samples whose
6930
+ * meters are the faithful image of the fit nodes; see the core module docs).
6931
+ * Delegates to `sidereon_core::sp3::Sp3::precise_ephemeris_samples`.
6932
+ */
6933
+ export function sp3PreciseEphemerisSamples(sp3: Sp3): any;
6934
+
6435
6935
  /**
6436
6936
  * Continuous seconds since J2000 for a split Julian date.
6437
6937
  */
@@ -6464,6 +6964,16 @@ export function subSolarPoint(sun_ecef: Float64Array): any;
6464
6964
  */
6465
6965
  export function sunAngle(satellite_position_km: Float64Array, sun_position_km: Float64Array): Float64Array;
6466
6966
 
6967
+ /**
6968
+ * Topocentric azimuth/elevation/range of the Sun from a ground site.
6969
+ *
6970
+ * The station is geodetic (`latitudeDeg`, `longitudeDeg`, `altitudeKm`);
6971
+ * `epochUnixUs` is the UTC instant as unix microseconds. Returns
6972
+ * `{ azimuthDeg, elevationDeg, rangeKm }` (azimuth clockwise from north).
6973
+ * Delegates to `sidereon_core::astro::bodies::sun_az_el`.
6974
+ */
6975
+ export function sunAzEl(latitude_deg: number, longitude_deg: number, altitude_km: number, epoch_unix_us: bigint): any;
6976
+
6467
6977
  /**
6468
6978
  * Sun elevation in degrees above the satellite local horizontal plane.
6469
6979
  */
@@ -6481,6 +6991,15 @@ export function sunMoonEcef(epochs_unix_us: BigInt64Array): SunMoon;
6481
6991
  */
6482
6992
  export function sunMoonEci(epochs_unix_us: BigInt64Array): SunMoon;
6483
6993
 
6994
+ /**
6995
+ * TAI-UTC (cumulative leap seconds) in effect on a UTC calendar date.
6996
+ *
6997
+ * This is **not** the GNSS "GPS - UTC" offset; for the quantity a GPS receiver
6998
+ * applies use [`gpsUtcOffsetS`] (they differ by a constant 19 s). Delegates to
6999
+ * `sidereon_core::astro::time::scales::tai_utc_offset_s`.
7000
+ */
7001
+ export function taiUtcOffsetS(year: number, month: number, day: number): number;
7002
+
6484
7003
  /**
6485
7004
  * Transform a batch of TEME states to GCRS, each at its own epoch.
6486
7005
  *
@@ -6523,8 +7042,8 @@ export function timescaleOffsetAtS(from: TimeScale, to: TimeScale, utc_jd: numbe
6523
7042
  *
6524
7043
  * Covers the atomic scales (TAI/TT/GPST/GST/QZSST/BDT), whose mutual offsets
6525
7044
  * are constants fixed by their ICDs. Throws a `RangeError` when either scale is
6526
- * UTC-based (`Utc`/`Glonasst`) those carry leap seconds, so their offset is
6527
- * epoch-dependent and needs [`timescaleOffsetAtS`] or for `Tdb` (no fixed
7045
+ * UTC-based (`Utc`/`Glonasst`): those carry leap seconds, so their offset is
7046
+ * epoch-dependent and needs [`timescaleOffsetAtS`], or for `Tdb` (no fixed
6528
7047
  * offset; resolve it through an `Instant`).
6529
7048
  */
6530
7049
  export function timescaleOffsetS(from: TimeScale, to: TimeScale): number;