@neilberkman/sidereon 0.12.0 → 0.13.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.
@@ -884,6 +884,43 @@ class BroadcastEphemeris {
884
884
  const ret = wasm.broadcastephemeris_leapSeconds(this.__wbg_ptr);
885
885
  return ret[0] === 0 ? undefined : ret[1];
886
886
  }
887
+ /**
888
+ * Query ECEF position and clock for parallel satellite and epoch arrays
889
+ * against this parsed broadcast ephemeris store.
890
+ *
891
+ * `satellites[i]` is evaluated at `epochsJ2000S[i]`, where epochs are
892
+ * seconds since J2000 in GPST for GNSS broadcast records. The returned
893
+ * plain object has aligned `positionsEcefM`, `clocksS`, `statuses`, and
894
+ * `elementResults` arrays.
895
+ * @param {any} satellites
896
+ * @param {any} epochs_j2000_s
897
+ * @returns {any}
898
+ */
899
+ observableStatesAtJ2000S(satellites, epochs_j2000_s) {
900
+ const ret = wasm.broadcastephemeris_observableStatesAtJ2000S(this.__wbg_ptr, satellites, epochs_j2000_s);
901
+ if (ret[2]) {
902
+ throw takeFromExternrefTable0(ret[1]);
903
+ }
904
+ return takeFromExternrefTable0(ret[0]);
905
+ }
906
+ /**
907
+ * Query ECEF position and clock for many satellites at one epoch against
908
+ * this parsed broadcast ephemeris store.
909
+ *
910
+ * `epochJ2000S` is seconds since J2000 in GPST. The returned object follows
911
+ * the same contract as
912
+ * [`observableStatesAtJ2000S`](Self::observable_states_at_j2000_s).
913
+ * @param {any} satellites
914
+ * @param {number} epoch_j2000_s
915
+ * @returns {any}
916
+ */
917
+ observableStatesAtSharedJ2000S(satellites, epoch_j2000_s) {
918
+ const ret = wasm.broadcastephemeris_observableStatesAtSharedJ2000S(this.__wbg_ptr, satellites, epoch_j2000_s);
919
+ if (ret[2]) {
920
+ throw takeFromExternrefTable0(ret[1]);
921
+ }
922
+ return takeFromExternrefTable0(ret[0]);
923
+ }
887
924
  /**
888
925
  * Number of usable GPS, Galileo, and BeiDou records.
889
926
  * @returns {number}
@@ -11049,6 +11086,160 @@ class PppFloatSolution {
11049
11086
  if (Symbol.dispose) PppFloatSolution.prototype[Symbol.dispose] = PppFloatSolution.prototype.free;
11050
11087
  exports.PppFloatSolution = PppFloatSolution;
11051
11088
 
11089
+ /**
11090
+ * A reusable precise-ephemeris interpolant with cached per-satellite nodes.
11091
+ *
11092
+ * Build this handle once from a parsed [`Sp3`] product, raw precise samples, or
11093
+ * a [`PreciseEphemerisSampleSource`], then reuse it for many state or range
11094
+ * queries. The handle delegates to
11095
+ * `sidereon_core::ephemeris::PreciseEphemerisInterpolant`; ECEF positions are
11096
+ * metres, clocks are seconds, and query epochs are seconds since J2000 in the
11097
+ * source time scale.
11098
+ */
11099
+ class PreciseEphemerisInterpolant {
11100
+ static __wrap(ptr) {
11101
+ const obj = Object.create(PreciseEphemerisInterpolant.prototype);
11102
+ obj.__wbg_ptr = ptr;
11103
+ PreciseEphemerisInterpolantFinalization.register(obj, obj.__wbg_ptr, obj);
11104
+ return obj;
11105
+ }
11106
+ __destroy_into_raw() {
11107
+ const ptr = this.__wbg_ptr;
11108
+ this.__wbg_ptr = 0;
11109
+ PreciseEphemerisInterpolantFinalization.unregister(this);
11110
+ return ptr;
11111
+ }
11112
+ free() {
11113
+ const ptr = this.__destroy_into_raw();
11114
+ wasm.__wbg_preciseephemerisinterpolant_free(ptr, 0);
11115
+ }
11116
+ /**
11117
+ * Build a cached interpolant from an existing sample-backed precise source.
11118
+ * @param {PreciseEphemerisSampleSource} source
11119
+ * @returns {PreciseEphemerisInterpolant}
11120
+ */
11121
+ static fromPreciseEphemerisSamples(source) {
11122
+ _assertClass(source, PreciseEphemerisSampleSource);
11123
+ const ret = wasm.preciseephemerisinterpolant_fromPreciseEphemerisSamples(source.__wbg_ptr);
11124
+ return PreciseEphemerisInterpolant.__wrap(ret);
11125
+ }
11126
+ /**
11127
+ * Build a cached interpolant directly from precise samples.
11128
+ *
11129
+ * `samples` is the same array accepted by
11130
+ * [`preciseEphemerisSamplesFromSamples`]: each item has `{ sat, epoch,
11131
+ * positionEcefM, clockS?, clockEvent? }`, with epochs in seconds since
11132
+ * J2000 and positions in ECEF metres. Throws a `TypeError` for malformed
11133
+ * JS input and a `RangeError` for sample validation failures.
11134
+ * @param {any} samples
11135
+ * @returns {PreciseEphemerisInterpolant}
11136
+ */
11137
+ static fromSamples(samples) {
11138
+ const ret = wasm.preciseephemerisinterpolant_fromSamples(samples);
11139
+ if (ret[2]) {
11140
+ throw takeFromExternrefTable0(ret[1]);
11141
+ }
11142
+ return PreciseEphemerisInterpolant.__wrap(ret[0]);
11143
+ }
11144
+ /**
11145
+ * Build a cached interpolant from a parsed SP3 precise product.
11146
+ *
11147
+ * Nodes are copied from the product's native SP3 records. Query epochs are
11148
+ * seconds since J2000 in the SP3 product time scale.
11149
+ * @param {Sp3} sp3
11150
+ * @returns {PreciseEphemerisInterpolant}
11151
+ */
11152
+ static fromSp3(sp3) {
11153
+ _assertClass(sp3, Sp3);
11154
+ const ret = wasm.preciseephemerisinterpolant_fromSp3(sp3.__wbg_ptr);
11155
+ return PreciseEphemerisInterpolant.__wrap(ret);
11156
+ }
11157
+ /**
11158
+ * Query ECEF position and optional clock for parallel satellite and epoch
11159
+ * arrays using this cached interpolant.
11160
+ *
11161
+ * `satellites[i]` is evaluated at `epochsJ2000S[i]`, where epochs are
11162
+ * seconds since J2000 on this handle's time scale. The returned plain
11163
+ * object has aligned `positionsEcefM`, `clocksS`, `statuses`, and
11164
+ * `elementResults` arrays.
11165
+ * @param {any} satellites
11166
+ * @param {any} epochs_j2000_s
11167
+ * @returns {any}
11168
+ */
11169
+ observableStatesAtJ2000S(satellites, epochs_j2000_s) {
11170
+ const ret = wasm.preciseephemerisinterpolant_observableStatesAtJ2000S(this.__wbg_ptr, satellites, epochs_j2000_s);
11171
+ if (ret[2]) {
11172
+ throw takeFromExternrefTable0(ret[1]);
11173
+ }
11174
+ return takeFromExternrefTable0(ret[0]);
11175
+ }
11176
+ /**
11177
+ * Query ECEF position and optional clock for many satellites at one epoch
11178
+ * using this cached interpolant.
11179
+ *
11180
+ * `epochJ2000S` is seconds since J2000 on this handle's time scale. The
11181
+ * returned object follows the same contract as
11182
+ * [`observableStatesAtJ2000S`](Self::observable_states_at_j2000_s).
11183
+ * @param {any} satellites
11184
+ * @param {number} epoch_j2000_s
11185
+ * @returns {any}
11186
+ */
11187
+ observableStatesAtSharedJ2000S(satellites, epoch_j2000_s) {
11188
+ const ret = wasm.preciseephemerisinterpolant_observableStatesAtSharedJ2000S(this.__wbg_ptr, satellites, epoch_j2000_s);
11189
+ if (ret[2]) {
11190
+ throw takeFromExternrefTable0(ret[1]);
11191
+ }
11192
+ return takeFromExternrefTable0(ret[0]);
11193
+ }
11194
+ /**
11195
+ * Predict geometric ranges for many `(satellite, receiver, epoch)`
11196
+ * requests using this cached interpolant.
11197
+ *
11198
+ * `requests` is an array of `{ sat, receiverEcefM, tRxJ2000S }` objects.
11199
+ * Positions are ECEF metres and epochs are seconds since J2000 on this
11200
+ * handle's time scale. The output matches [`Sp3.predictRanges`].
11201
+ * @param {any} requests
11202
+ * @param {any} options
11203
+ * @returns {any}
11204
+ */
11205
+ predictRanges(requests, options) {
11206
+ const ret = wasm.preciseephemerisinterpolant_predictRanges(this.__wbg_ptr, requests, options);
11207
+ if (ret[2]) {
11208
+ throw takeFromExternrefTable0(ret[1]);
11209
+ }
11210
+ return takeFromExternrefTable0(ret[0]);
11211
+ }
11212
+ /**
11213
+ * Satellite tokens this handle can interpolate, ascending.
11214
+ * @returns {string[]}
11215
+ */
11216
+ get satellites() {
11217
+ const ret = wasm.preciseephemerisinterpolant_satellites(this.__wbg_ptr);
11218
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
11219
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
11220
+ return v1;
11221
+ }
11222
+ /**
11223
+ * Source time-scale abbreviation used by this handle's J2000-second axis,
11224
+ * such as `"GPST"`.
11225
+ * @returns {string}
11226
+ */
11227
+ get timeScale() {
11228
+ let deferred1_0;
11229
+ let deferred1_1;
11230
+ try {
11231
+ const ret = wasm.preciseephemerisinterpolant_timeScale(this.__wbg_ptr);
11232
+ deferred1_0 = ret[0];
11233
+ deferred1_1 = ret[1];
11234
+ return getStringFromWasm0(ret[0], ret[1]);
11235
+ } finally {
11236
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
11237
+ }
11238
+ }
11239
+ }
11240
+ if (Symbol.dispose) PreciseEphemerisInterpolant.prototype[Symbol.dispose] = PreciseEphemerisInterpolant.prototype.free;
11241
+ exports.PreciseEphemerisInterpolant = PreciseEphemerisInterpolant;
11242
+
11052
11243
  /**
11053
11244
  * A precise-ephemeris source built from samples rather than parsed SP3 text.
11054
11245
  *
@@ -11073,6 +11264,44 @@ class PreciseEphemerisSampleSource {
11073
11264
  const ptr = this.__destroy_into_raw();
11074
11265
  wasm.__wbg_preciseephemerissamplesource_free(ptr, 0);
11075
11266
  }
11267
+ /**
11268
+ * Query ECEF position and optional clock for parallel satellite and epoch
11269
+ * arrays against this sample-backed precise source.
11270
+ *
11271
+ * `satellites[i]` is evaluated at `epochsJ2000S[i]`, where epochs are
11272
+ * seconds since J2000 on the source time scale. The returned plain object
11273
+ * has aligned `positionsEcefM`, `clocksS`, `statuses`, and
11274
+ * `elementResults` arrays. Failed elements use the core missing-position
11275
+ * sentinel and carry the scalar engine error in `elementResults[i].error`.
11276
+ * @param {any} satellites
11277
+ * @param {any} epochs_j2000_s
11278
+ * @returns {any}
11279
+ */
11280
+ observableStatesAtJ2000S(satellites, epochs_j2000_s) {
11281
+ const ret = wasm.preciseephemerissamplesource_observableStatesAtJ2000S(this.__wbg_ptr, satellites, epochs_j2000_s);
11282
+ if (ret[2]) {
11283
+ throw takeFromExternrefTable0(ret[1]);
11284
+ }
11285
+ return takeFromExternrefTable0(ret[0]);
11286
+ }
11287
+ /**
11288
+ * Query ECEF position and optional clock for many satellites at one epoch
11289
+ * against this sample-backed precise source.
11290
+ *
11291
+ * `epochJ2000S` is seconds since J2000 on the source time scale. The
11292
+ * returned plain object follows the same contract as
11293
+ * [`observableStatesAtJ2000S`](Self::observable_states_at_j2000_s).
11294
+ * @param {any} satellites
11295
+ * @param {number} epoch_j2000_s
11296
+ * @returns {any}
11297
+ */
11298
+ observableStatesAtSharedJ2000S(satellites, epoch_j2000_s) {
11299
+ const ret = wasm.preciseephemerissamplesource_observableStatesAtSharedJ2000S(this.__wbg_ptr, satellites, epoch_j2000_s);
11300
+ if (ret[2]) {
11301
+ throw takeFromExternrefTable0(ret[1]);
11302
+ }
11303
+ return takeFromExternrefTable0(ret[0]);
11304
+ }
11076
11305
  /**
11077
11306
  * Predict geometric ranges for many requests in one call. See the shared
11078
11307
  * [`predictRanges`](crate::precise_samples::predict_ranges_over) contract;
@@ -13142,6 +13371,44 @@ class Sp3 {
13142
13371
  }
13143
13372
  return Sp3Interpolation.__wrap(ret[0]);
13144
13373
  }
13374
+ /**
13375
+ * Query ECEF position and optional clock for parallel satellite and epoch
13376
+ * arrays against this parsed SP3 product.
13377
+ *
13378
+ * `satellites[i]` is evaluated at `epochsJ2000S[i]`, where epochs are
13379
+ * seconds since J2000 in the product time scale. The returned plain object
13380
+ * has aligned `positionsEcefM`, `clocksS`, `statuses`, and
13381
+ * `elementResults` arrays. Failed elements use the core missing-position
13382
+ * sentinel and carry the scalar engine error in `elementResults[i].error`.
13383
+ * @param {any} satellites
13384
+ * @param {any} epochs_j2000_s
13385
+ * @returns {any}
13386
+ */
13387
+ observableStatesAtJ2000S(satellites, epochs_j2000_s) {
13388
+ const ret = wasm.sp3_observableStatesAtJ2000S(this.__wbg_ptr, satellites, epochs_j2000_s);
13389
+ if (ret[2]) {
13390
+ throw takeFromExternrefTable0(ret[1]);
13391
+ }
13392
+ return takeFromExternrefTable0(ret[0]);
13393
+ }
13394
+ /**
13395
+ * Query ECEF position and optional clock for many satellites at one epoch
13396
+ * against this parsed SP3 product.
13397
+ *
13398
+ * `epochJ2000S` is seconds since J2000 in the product time scale. The
13399
+ * returned object follows the same contract as
13400
+ * [`observableStatesAtJ2000S`](Self::observable_states_at_j2000_s).
13401
+ * @param {any} satellites
13402
+ * @param {number} epoch_j2000_s
13403
+ * @returns {any}
13404
+ */
13405
+ observableStatesAtSharedJ2000S(satellites, epoch_j2000_s) {
13406
+ const ret = wasm.sp3_observableStatesAtSharedJ2000S(this.__wbg_ptr, satellites, epoch_j2000_s);
13407
+ if (ret[2]) {
13408
+ throw takeFromExternrefTable0(ret[1]);
13409
+ }
13410
+ return takeFromExternrefTable0(ret[0]);
13411
+ }
13145
13412
  /**
13146
13413
  * Predict geometric ranges for many `(satellite, receiver, epoch)` requests
13147
13414
  * against this ephemeris in one call. `requests` is an array of
@@ -15915,6 +16182,82 @@ function allanDeviation(series, tau0_s, averaging_factors) {
15915
16182
  }
15916
16183
  exports.allanDeviation = allanDeviation;
15917
16184
 
16185
+ /**
16186
+ * Alpha-beta measurement update applied to a predicted scalar state.
16187
+ *
16188
+ * `predicted` is `{ level, rate }`, `measurement` has the same unit as
16189
+ * `level`, `dt` is seconds, and `gains` is `{ alpha, beta }`.
16190
+ * @param {any} predicted
16191
+ * @param {number} measurement
16192
+ * @param {number} dt
16193
+ * @param {any} gains
16194
+ * @returns {any}
16195
+ */
16196
+ function alphaBetaApplyMeasurement(predicted, measurement, dt, gains) {
16197
+ const ret = wasm.alphaBetaApplyMeasurement(predicted, measurement, dt, gains);
16198
+ if (ret[2]) {
16199
+ throw takeFromExternrefTable0(ret[1]);
16200
+ }
16201
+ return takeFromExternrefTable0(ret[0]);
16202
+ }
16203
+ exports.alphaBetaApplyMeasurement = alphaBetaApplyMeasurement;
16204
+
16205
+ /**
16206
+ * Run one alpha-beta predict and measurement update.
16207
+ *
16208
+ * `state` is `{ level, rate }`, `measurement` has the same unit as `level`,
16209
+ * `dt` is seconds, and `gains` is `{ alpha, beta }`. Returns `{ predicted,
16210
+ * updated, innovation }`.
16211
+ * @param {any} state
16212
+ * @param {number} measurement
16213
+ * @param {number} dt
16214
+ * @param {any} gains
16215
+ * @returns {any}
16216
+ */
16217
+ function alphaBetaFilterStep(state, measurement, dt, gains) {
16218
+ const ret = wasm.alphaBetaFilterStep(state, measurement, dt, gains);
16219
+ if (ret[2]) {
16220
+ throw takeFromExternrefTable0(ret[1]);
16221
+ }
16222
+ return takeFromExternrefTable0(ret[0]);
16223
+ }
16224
+ exports.alphaBetaFilterStep = alphaBetaFilterStep;
16225
+
16226
+ /**
16227
+ * Alpha-beta constant-rate prediction.
16228
+ *
16229
+ * `state` is `{ level, rate }` and `dt` is the positive propagation interval in
16230
+ * seconds. Returns the predicted `{ level, rate }`.
16231
+ * @param {any} state
16232
+ * @param {number} dt
16233
+ * @returns {any}
16234
+ */
16235
+ function alphaBetaPredict(state, dt) {
16236
+ const ret = wasm.alphaBetaPredict(state, dt);
16237
+ if (ret[2]) {
16238
+ throw takeFromExternrefTable0(ret[1]);
16239
+ }
16240
+ return takeFromExternrefTable0(ret[0]);
16241
+ }
16242
+ exports.alphaBetaPredict = alphaBetaPredict;
16243
+
16244
+ /**
16245
+ * Steady-state alpha-beta gains from a positive tracking index.
16246
+ *
16247
+ * Returns `{ alpha, beta }`, where `alpha` is the level gain and `beta` maps
16248
+ * innovation to rate through `beta * innovation / dt`.
16249
+ * @param {number} tracking_index
16250
+ * @returns {any}
16251
+ */
16252
+ function alphaBetaSteadyStateGains(tracking_index) {
16253
+ const ret = wasm.alphaBetaSteadyStateGains(tracking_index);
16254
+ if (ret[2]) {
16255
+ throw takeFromExternrefTable0(ret[1]);
16256
+ }
16257
+ return takeFromExternrefTable0(ret[0]);
16258
+ }
16259
+ exports.alphaBetaSteadyStateGains = alphaBetaSteadyStateGains;
16260
+
15918
16261
  /**
15919
16262
  * On-sky angle in degrees between two direction vectors.
15920
16263
  * @param {Float64Array} a
@@ -16187,6 +16530,92 @@ function carrierFrequencyHz(system, band) {
16187
16530
  }
16188
16531
  exports.carrierFrequencyHz = carrierFrequencyHz;
16189
16532
 
16533
+ /**
16534
+ * CA-CFAR false alarm probability from searched-cell count, absolute
16535
+ * threshold, and mean noise level.
16536
+ * @param {number} searched_cells
16537
+ * @param {number} threshold
16538
+ * @param {number} noise_level
16539
+ * @returns {number}
16540
+ */
16541
+ function cfarCaFalseAlarmProbability(searched_cells, threshold, noise_level) {
16542
+ const ret = wasm.cfarCaFalseAlarmProbability(searched_cells, threshold, noise_level);
16543
+ if (ret[2]) {
16544
+ throw takeFromExternrefTable0(ret[1]);
16545
+ }
16546
+ return ret[0];
16547
+ }
16548
+ exports.cfarCaFalseAlarmProbability = cfarCaFalseAlarmProbability;
16549
+
16550
+ /**
16551
+ * CA-CFAR threshold multiplier from searched-cell count and target false alarm
16552
+ * probability.
16553
+ * @param {number} searched_cells
16554
+ * @param {number} false_alarm_probability
16555
+ * @returns {number}
16556
+ */
16557
+ function cfarCaMultiplierFromPfa(searched_cells, false_alarm_probability) {
16558
+ const ret = wasm.cfarCaMultiplierFromPfa(searched_cells, false_alarm_probability);
16559
+ if (ret[2]) {
16560
+ throw takeFromExternrefTable0(ret[1]);
16561
+ }
16562
+ return ret[0];
16563
+ }
16564
+ exports.cfarCaMultiplierFromPfa = cfarCaMultiplierFromPfa;
16565
+
16566
+ /**
16567
+ * CA-CFAR false alarm probability from searched-cell count and multiplier.
16568
+ * @param {number} searched_cells
16569
+ * @param {number} multiplier
16570
+ * @returns {number}
16571
+ */
16572
+ function cfarCaPfaFromMultiplier(searched_cells, multiplier) {
16573
+ const ret = wasm.cfarCaPfaFromMultiplier(searched_cells, multiplier);
16574
+ if (ret[2]) {
16575
+ throw takeFromExternrefTable0(ret[1]);
16576
+ }
16577
+ return ret[0];
16578
+ }
16579
+ exports.cfarCaPfaFromMultiplier = cfarCaPfaFromMultiplier;
16580
+
16581
+ /**
16582
+ * CA-CFAR absolute threshold from searched-cell count, target false alarm
16583
+ * probability, and mean noise level.
16584
+ * @param {number} searched_cells
16585
+ * @param {number} false_alarm_probability
16586
+ * @param {number} noise_level
16587
+ * @returns {number}
16588
+ */
16589
+ function cfarCaThreshold(searched_cells, false_alarm_probability, noise_level) {
16590
+ const ret = wasm.cfarCaThreshold(searched_cells, false_alarm_probability, noise_level);
16591
+ if (ret[2]) {
16592
+ throw takeFromExternrefTable0(ret[1]);
16593
+ }
16594
+ return ret[0];
16595
+ }
16596
+ exports.cfarCaThreshold = cfarCaThreshold;
16597
+
16598
+ /**
16599
+ * Compute the closed-form Chan-Ho seed used by [`locateSource`].
16600
+ *
16601
+ * `mode` is `"toa"`, `"tdoa"`, or `{ mode: "tdoa", referenceSensor }`.
16602
+ * Per-sensor speed overrides are not used by the closed-form equations, but
16603
+ * they are used by [`locateSource`] during iterative refinement.
16604
+ * @param {any} sensors
16605
+ * @param {any} arrival_times_s
16606
+ * @param {number} propagation_speed_m_s
16607
+ * @param {any} mode
16608
+ * @returns {any}
16609
+ */
16610
+ function chanHoInitialGuess(sensors, arrival_times_s, propagation_speed_m_s, mode) {
16611
+ const ret = wasm.chanHoInitialGuess(sensors, arrival_times_s, propagation_speed_m_s, mode);
16612
+ if (ret[2]) {
16613
+ throw takeFromExternrefTable0(ret[1]);
16614
+ }
16615
+ return takeFromExternrefTable0(ret[0]);
16616
+ }
16617
+ exports.chanHoInitialGuess = chanHoInitialGuess;
16618
+
16190
16619
  /**
16191
16620
  * Returns `true` when a diff has any findings.
16192
16621
  * @param {any} diff
@@ -17330,6 +17759,41 @@ function estimateDecayWithSpaceWeather(drag, table, request) {
17330
17759
  }
17331
17760
  exports.estimateDecayWithSpaceWeather = estimateDecayWithSpaceWeather;
17332
17761
 
17762
+ /**
17763
+ * Exponentially weighted moving-average update.
17764
+ *
17765
+ * `alpha` must be in `[0, 1]`; the returned value is
17766
+ * `previous + alpha * (sample - previous)`.
17767
+ * @param {number} previous
17768
+ * @param {number} sample
17769
+ * @param {number} alpha
17770
+ * @returns {number}
17771
+ */
17772
+ function ewmaUpdate(previous, sample, alpha) {
17773
+ const ret = wasm.ewmaUpdate(previous, sample, alpha);
17774
+ if (ret[2]) {
17775
+ throw takeFromExternrefTable0(ret[1]);
17776
+ }
17777
+ return ret[0];
17778
+ }
17779
+ exports.ewmaUpdate = ewmaUpdate;
17780
+
17781
+ /**
17782
+ * EWMA update with `alpha = 1 / 2^shift`.
17783
+ * @param {number} previous
17784
+ * @param {number} sample
17785
+ * @param {number} shift
17786
+ * @returns {number}
17787
+ */
17788
+ function ewmaUpdatePowerOfTwo(previous, sample, shift) {
17789
+ const ret = wasm.ewmaUpdatePowerOfTwo(previous, sample, shift);
17790
+ if (ret[2]) {
17791
+ throw takeFromExternrefTable0(ret[1]);
17792
+ }
17793
+ return ret[0];
17794
+ }
17795
+ exports.ewmaUpdatePowerOfTwo = ewmaUpdatePowerOfTwo;
17796
+
17333
17797
  /**
17334
17798
  * Find Moon elevation threshold crossings (moonrise / moonset) over a UTC
17335
17799
  * window.
@@ -18512,6 +18976,26 @@ function jarqueBera(x) {
18512
18976
  }
18513
18977
  exports.jarqueBera = jarqueBera;
18514
18978
 
18979
+ /**
18980
+ * Steady-state gains for a scalar constant-velocity Kalman filter.
18981
+ *
18982
+ * `trackingIndex`, `dt`, and `measurementVariance` must be positive. Returns
18983
+ * `{ positionGain, rateGain }`; `rateGain * dt` equals the alpha-beta `beta`
18984
+ * gain for the same tracking index.
18985
+ * @param {number} tracking_index
18986
+ * @param {number} dt
18987
+ * @param {number} measurement_variance
18988
+ * @returns {any}
18989
+ */
18990
+ function kalmanCvSteadyStateGains(tracking_index, dt, measurement_variance) {
18991
+ const ret = wasm.kalmanCvSteadyStateGains(tracking_index, dt, measurement_variance);
18992
+ if (ret[2]) {
18993
+ throw takeFromExternrefTable0(ret[1]);
18994
+ }
18995
+ return takeFromExternrefTable0(ret[0]);
18996
+ }
18997
+ exports.kalmanCvSteadyStateGains = kalmanCvSteadyStateGains;
18998
+
18515
18999
  /**
18516
19000
  * GPS broadcast Klobuchar ionospheric group delay in the model's native units
18517
19001
  * (positive metres).
@@ -19082,6 +19566,30 @@ function loadSp3(bytes) {
19082
19566
  }
19083
19567
  exports.loadSp3 = loadSp3;
19084
19568
 
19569
+ /**
19570
+ * Locate a source from sensor arrival times.
19571
+ *
19572
+ * `sensors` is an array of `{ positionM, propagationSpeedMS? }`; each
19573
+ * `positionM` is a 2D or 3D Cartesian metre vector and all sensors must share
19574
+ * the same dimension. `arrivalTimesS` is an aligned seconds array,
19575
+ * `propagationSpeedMS` is the call-level speed in metres per second, and
19576
+ * `options` may include `mode`, `referenceSensor`, `timingSigmaS`, `loss`,
19577
+ * `fScaleS`, `ftol`, `xtol`, `gtol`, and `maxNfev`.
19578
+ * @param {any} sensors
19579
+ * @param {any} arrival_times_s
19580
+ * @param {number} propagation_speed_m_s
19581
+ * @param {any} options
19582
+ * @returns {any}
19583
+ */
19584
+ function locateSource(sensors, arrival_times_s, propagation_speed_m_s, options) {
19585
+ const ret = wasm.locateSource(sensors, arrival_times_s, propagation_speed_m_s, options);
19586
+ if (ret[2]) {
19587
+ throw takeFromExternrefTable0(ret[1]);
19588
+ }
19589
+ return takeFromExternrefTable0(ret[0]);
19590
+ }
19591
+ exports.locateSource = locateSource;
19592
+
19085
19593
  /**
19086
19594
  * @param {bigint} start_unix_us
19087
19595
  * @param {bigint} end_unix_us
@@ -19136,6 +19644,35 @@ function lvlhRotation(position_km, velocity_km_s) {
19136
19644
  }
19137
19645
  exports.lvlhRotation = lvlhRotation;
19138
19646
 
19647
+ /**
19648
+ * Gaussian consistency factor applied by [`madSpread`].
19649
+ * @returns {number}
19650
+ */
19651
+ function madGaussianConsistency() {
19652
+ const ret = wasm.madGaussianConsistency();
19653
+ return ret;
19654
+ }
19655
+ exports.madGaussianConsistency = madGaussianConsistency;
19656
+
19657
+ /**
19658
+ * Median absolute deviation spread estimate.
19659
+ *
19660
+ * `values` is a JS number array. The returned spread is
19661
+ * `MAD_GAUSSIAN_CONSISTENCY * median(abs(value - median(values)))`, floored by
19662
+ * `scaleFloor`.
19663
+ * @param {any} values
19664
+ * @param {number} scale_floor
19665
+ * @returns {number}
19666
+ */
19667
+ function madSpread(values, scale_floor) {
19668
+ const ret = wasm.madSpread(values, scale_floor);
19669
+ if (ret[2]) {
19670
+ throw takeFromExternrefTable0(ret[1]);
19671
+ }
19672
+ return ret[0];
19673
+ }
19674
+ exports.madSpread = madSpread;
19675
+
19139
19676
  /**
19140
19677
  * @param {number} radius_km
19141
19678
  * @returns {number}
@@ -19568,6 +20105,69 @@ function nequickGStecTecu(_eval) {
19568
20105
  }
19569
20106
  exports.nequickGStecTecu = nequickGStecTecu;
19570
20107
 
20108
+ /**
20109
+ * Scalar normalized innovation squared statistic.
20110
+ * @param {number} innovation
20111
+ * @param {number} innovation_variance
20112
+ * @returns {number}
20113
+ */
20114
+ function nis(innovation, innovation_variance) {
20115
+ const ret = wasm.nis(innovation, innovation_variance);
20116
+ if (ret[2]) {
20117
+ throw takeFromExternrefTable0(ret[1]);
20118
+ }
20119
+ return ret[0];
20120
+ }
20121
+ exports.nis = nis;
20122
+
20123
+ /**
20124
+ * Bar-Shalom expected NIS value for `dof` measurement degrees of freedom.
20125
+ * @param {number} dof
20126
+ * @returns {number}
20127
+ */
20128
+ function nisExpectedValue(dof) {
20129
+ const ret = wasm.nisExpectedValue(dof);
20130
+ if (ret[2]) {
20131
+ throw takeFromExternrefTable0(ret[1]);
20132
+ }
20133
+ return ret[0];
20134
+ }
20135
+ exports.nisExpectedValue = nisExpectedValue;
20136
+
20137
+ /**
20138
+ * Test a scalar innovation against a chi-square NIS gate.
20139
+ *
20140
+ * Returns `{ nis, threshold, inGate, dof }`, with `confidence` in `(0, 1)`.
20141
+ * @param {number} innovation
20142
+ * @param {number} innovation_variance
20143
+ * @param {number} dof
20144
+ * @param {number} confidence
20145
+ * @returns {any}
20146
+ */
20147
+ function nisGate(innovation, innovation_variance, dof, confidence) {
20148
+ const ret = wasm.nisGate(innovation, innovation_variance, dof, confidence);
20149
+ if (ret[2]) {
20150
+ throw takeFromExternrefTable0(ret[1]);
20151
+ }
20152
+ return takeFromExternrefTable0(ret[0]);
20153
+ }
20154
+ exports.nisGate = nisGate;
20155
+
20156
+ /**
20157
+ * Chi-square NIS gate threshold for `dof` and confidence probability.
20158
+ * @param {number} dof
20159
+ * @param {number} confidence
20160
+ * @returns {number}
20161
+ */
20162
+ function nisGateThreshold(dof, confidence) {
20163
+ const ret = wasm.nisGateThreshold(dof, confidence);
20164
+ if (ret[2]) {
20165
+ throw takeFromExternrefTable0(ret[1]);
20166
+ }
20167
+ return ret[0];
20168
+ }
20169
+ exports.nisGateThreshold = nisGateThreshold;
20170
+
19571
20171
  /**
19572
20172
  * Parse bytes and return grouped epoch snapshots directly.
19573
20173
  * @param {Uint8Array} bytes
@@ -19655,6 +20255,21 @@ function normalCovariance(jacobian, m, n, variance_scale) {
19655
20255
  }
19656
20256
  exports.normalCovariance = normalCovariance;
19657
20257
 
20258
+ /**
20259
+ * Scalar normalized innovation `innovation / sqrt(innovationVariance)`.
20260
+ * @param {number} innovation
20261
+ * @param {number} innovation_variance
20262
+ * @returns {number}
20263
+ */
20264
+ function normalizedInnovation(innovation, innovation_variance) {
20265
+ const ret = wasm.normalizedInnovation(innovation, innovation_variance);
20266
+ if (ret[2]) {
20267
+ throw takeFromExternrefTable0(ret[1]);
20268
+ }
20269
+ return ret[0];
20270
+ }
20271
+ exports.normalizedInnovation = normalizedInnovation;
20272
+
19658
20273
  /**
19659
20274
  * Build the NTRIP connection request bytes for a config object.
19660
20275
  * @param {any} config
@@ -19671,6 +20286,24 @@ function ntripRequestBytes(config) {
19671
20286
  }
19672
20287
  exports.ntripRequestBytes = ntripRequestBytes;
19673
20288
 
20289
+ /**
20290
+ * Missing-position sentinel used in failed observable-state batch elements.
20291
+ *
20292
+ * The returned JS value is `[NaN, NaN, NaN]`, matching
20293
+ * `sidereon_core::ephemeris::OBSERVABLE_STATE_MISSING_POSITION_ECEF_M`. Always
20294
+ * check `elementResults[i].ok` or `statuses[i]` before using
20295
+ * `positionsEcefM[i]`.
20296
+ * @returns {any}
20297
+ */
20298
+ function observableStateMissingPositionEcefM() {
20299
+ const ret = wasm.observableStateMissingPositionEcefM();
20300
+ if (ret[2]) {
20301
+ throw takeFromExternrefTable0(ret[1]);
20302
+ }
20303
+ return takeFromExternrefTable0(ret[0]);
20304
+ }
20305
+ exports.observableStateMissingPositionEcefM = observableStateMissingPositionEcefM;
20306
+
19674
20307
  /**
19675
20308
  * Predict observables for one satellite from a broadcast ephemeris store.
19676
20309
  * Delegates to `sidereon_core::observables::predict`.
@@ -21892,6 +22525,78 @@ function solveWithFallback(precise, broadcast, request, policy) {
21892
22525
  }
21893
22526
  exports.solveWithFallback = solveWithFallback;
21894
22527
 
22528
+ /**
22529
+ * Compute the timing Cramer-Rao lower bound for a proposed source position.
22530
+ *
22531
+ * The covariance is `(H^T H)^-1 * timingSigmaS^2`; position blocks are square
22532
+ * metres and origin-time variance is square seconds.
22533
+ * @param {any} sensors
22534
+ * @param {any} source_position_m
22535
+ * @param {number} propagation_speed_m_s
22536
+ * @param {number} timing_sigma_s
22537
+ * @returns {any}
22538
+ */
22539
+ function sourceCrlb(sensors, source_position_m, propagation_speed_m_s, timing_sigma_s) {
22540
+ const ret = wasm.sourceCrlb(sensors, source_position_m, propagation_speed_m_s, timing_sigma_s);
22541
+ if (ret[2]) {
22542
+ throw takeFromExternrefTable0(ret[1]);
22543
+ }
22544
+ return takeFromExternrefTable0(ret[0]);
22545
+ }
22546
+ exports.sourceCrlb = sourceCrlb;
22547
+
22548
+ /**
22549
+ * Compute timing DOP for a proposed source position.
22550
+ *
22551
+ * `sourcePositionM` is a 2D or 3D Cartesian metre vector in the same frame as
22552
+ * the sensors. The returned DOP values multiply timing sigma in seconds to
22553
+ * produce metres in the caller's Cartesian axes.
22554
+ * @param {any} sensors
22555
+ * @param {any} source_position_m
22556
+ * @param {number} propagation_speed_m_s
22557
+ * @returns {any}
22558
+ */
22559
+ function sourceDop(sensors, source_position_m, propagation_speed_m_s) {
22560
+ const ret = wasm.sourceDop(sensors, source_position_m, propagation_speed_m_s);
22561
+ if (ret[2]) {
22562
+ throw takeFromExternrefTable0(ret[1]);
22563
+ }
22564
+ return takeFromExternrefTable0(ret[0]);
22565
+ }
22566
+ exports.sourceDop = sourceDop;
22567
+
22568
+ /**
22569
+ * Return the plain mode object for TDOA solves against `referenceSensor`.
22570
+ * @param {number} reference_sensor
22571
+ * @returns {any}
22572
+ */
22573
+ function sourceSolveModeTdoa(reference_sensor) {
22574
+ const ret = wasm.sourceSolveModeTdoa(reference_sensor);
22575
+ if (ret[2]) {
22576
+ throw takeFromExternrefTable0(ret[1]);
22577
+ }
22578
+ return takeFromExternrefTable0(ret[0]);
22579
+ }
22580
+ exports.sourceSolveModeTdoa = sourceSolveModeTdoa;
22581
+
22582
+ /**
22583
+ * Return the plain mode value for absolute time-of-arrival solves.
22584
+ * @returns {string}
22585
+ */
22586
+ function sourceSolveModeToa() {
22587
+ let deferred1_0;
22588
+ let deferred1_1;
22589
+ try {
22590
+ const ret = wasm.sourceSolveModeToa();
22591
+ deferred1_0 = ret[0];
22592
+ deferred1_1 = ret[1];
22593
+ return getStringFromWasm0(ret[0], ret[1]);
22594
+ } finally {
22595
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
22596
+ }
22597
+ }
22598
+ exports.sourceSolveModeToa = sourceSolveModeToa;
22599
+
21895
22600
  /**
21896
22601
  * Extract a parsed SP3 product as the canonical precise-ephemeris samples, one
21897
22602
  * per real position record in ascending epoch order.
@@ -23362,6 +24067,9 @@ const PppFixedSolutionFinalization = (typeof FinalizationRegistry === 'undefined
23362
24067
  const PppFloatSolutionFinalization = (typeof FinalizationRegistry === 'undefined')
23363
24068
  ? { register: () => {}, unregister: () => {} }
23364
24069
  : new FinalizationRegistry(ptr => wasm.__wbg_pppfloatsolution_free(ptr, 1));
24070
+ const PreciseEphemerisInterpolantFinalization = (typeof FinalizationRegistry === 'undefined')
24071
+ ? { register: () => {}, unregister: () => {} }
24072
+ : new FinalizationRegistry(ptr => wasm.__wbg_preciseephemerisinterpolant_free(ptr, 1));
23365
24073
  const PreciseEphemerisSampleSourceFinalization = (typeof FinalizationRegistry === 'undefined')
23366
24074
  ? { register: () => {}, unregister: () => {} }
23367
24075
  : new FinalizationRegistry(ptr => wasm.__wbg_preciseephemerissamplesource_free(ptr, 1));