@neilberkman/sidereon 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/pkg/sidereon.js CHANGED
@@ -910,6 +910,22 @@ export class BroadcastEphemeris {
910
910
  }
911
911
  return ret[0] === 0 ? undefined : BroadcastStoreEvaluation.__wrap(ret[0]);
912
912
  }
913
+ /**
914
+ * Run fault detection and exclusion against this broadcast ephemeris.
915
+ *
916
+ * `request` is the SPP solve request plus the RAIM/exclusion options, the
917
+ * same object accepted by `Sp3.fde`. Delegates to
918
+ * `sidereon_core::quality::fde_spp` over the broadcast store.
919
+ * @param {any} request
920
+ * @returns {FdeSolution}
921
+ */
922
+ fde(request) {
923
+ const ret = wasm.broadcastephemeris_fde(this.__wbg_ptr, request);
924
+ if (ret[2]) {
925
+ throw takeFromExternrefTable0(ret[1]);
926
+ }
927
+ return FdeSolution.__wrap(ret[0]);
928
+ }
913
929
  /**
914
930
  * Number of usable GLONASS records.
915
931
  * @returns {number}
@@ -14501,6 +14517,90 @@ export class RinexObsRepair {
14501
14517
  }
14502
14518
  if (Symbol.dispose) RinexObsRepair.prototype[Symbol.dispose] = RinexObsRepair.prototype.free;
14503
14519
 
14520
+ /**
14521
+ * Per-epoch results returned by `solveSppFromRinexObs`.
14522
+ */
14523
+ export class RinexSppSolutionBatch {
14524
+ static __wrap(ptr) {
14525
+ const obj = Object.create(RinexSppSolutionBatch.prototype);
14526
+ obj.__wbg_ptr = ptr;
14527
+ RinexSppSolutionBatchFinalization.register(obj, obj.__wbg_ptr, obj);
14528
+ return obj;
14529
+ }
14530
+ __destroy_into_raw() {
14531
+ const ptr = this.__wbg_ptr;
14532
+ this.__wbg_ptr = 0;
14533
+ RinexSppSolutionBatchFinalization.unregister(this);
14534
+ return ptr;
14535
+ }
14536
+ free() {
14537
+ const ptr = this.__destroy_into_raw();
14538
+ wasm.__wbg_rinexsppsolutionbatch_free(ptr, 0);
14539
+ }
14540
+ /**
14541
+ * Number of assembled RINEX epochs in the batch.
14542
+ * @returns {number}
14543
+ */
14544
+ get count() {
14545
+ const ret = wasm.rinexsppsolutionbatch_count(this.__wbg_ptr);
14546
+ return ret >>> 0;
14547
+ }
14548
+ /**
14549
+ * Original RINEX OBS epoch index for assembled batch item `index`.
14550
+ * @param {number} index
14551
+ * @returns {number}
14552
+ */
14553
+ epochIndex(index) {
14554
+ const ret = wasm.rinexsppsolutionbatch_epochIndex(this.__wbg_ptr, index);
14555
+ if (ret[2]) {
14556
+ throw takeFromExternrefTable0(ret[1]);
14557
+ }
14558
+ return ret[0] >>> 0;
14559
+ }
14560
+ /**
14561
+ * The solve error for assembled batch item `index`, or `undefined`.
14562
+ * @param {number} index
14563
+ * @returns {string | undefined}
14564
+ */
14565
+ error(index) {
14566
+ const ret = wasm.rinexsppsolutionbatch_error(this.__wbg_ptr, index);
14567
+ if (ret[3]) {
14568
+ throw takeFromExternrefTable0(ret[2]);
14569
+ }
14570
+ let v1;
14571
+ if (ret[0] !== 0) {
14572
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
14573
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
14574
+ }
14575
+ return v1;
14576
+ }
14577
+ /**
14578
+ * Whether assembled batch item `index` converged to a solution.
14579
+ * @param {number} index
14580
+ * @returns {boolean}
14581
+ */
14582
+ isOk(index) {
14583
+ const ret = wasm.rinexsppsolutionbatch_isOk(this.__wbg_ptr, index);
14584
+ if (ret[2]) {
14585
+ throw takeFromExternrefTable0(ret[1]);
14586
+ }
14587
+ return ret[0] !== 0;
14588
+ }
14589
+ /**
14590
+ * The SPP solution for assembled batch item `index`.
14591
+ * @param {number} index
14592
+ * @returns {SppSolution}
14593
+ */
14594
+ solution(index) {
14595
+ const ret = wasm.rinexsppsolutionbatch_solution(this.__wbg_ptr, index);
14596
+ if (ret[2]) {
14597
+ throw takeFromExternrefTable0(ret[1]);
14598
+ }
14599
+ return SppSolution.__wrap(ret[0]);
14600
+ }
14601
+ }
14602
+ if (Symbol.dispose) RinexSppSolutionBatch.prototype[Symbol.dispose] = RinexSppSolutionBatch.prototype.free;
14603
+
14504
14604
  /**
14505
14605
  * Stateful MSM lock-time tracker for deriving RINEX LLI continuity bits.
14506
14606
  */
@@ -20985,6 +21085,20 @@ export function atmosphereSpaceWeatherDefaults() {
20985
21085
  return SpaceWeatherDefaults.__wrap(ret);
20986
21086
  }
20987
21087
 
21088
+ /**
21089
+ * Circular autocorrelation over all lags for a bipolar code vector.
21090
+ * @param {Int8Array} code
21091
+ * @returns {Int32Array}
21092
+ */
21093
+ export function autocorrelation(code) {
21094
+ const ptr0 = passArray8ToWasm0(code, wasm.__wbindgen_malloc);
21095
+ const len0 = WASM_VECTOR_LEN;
21096
+ const ret = wasm.autocorrelation(ptr0, len0);
21097
+ var v2 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
21098
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
21099
+ return v2;
21100
+ }
21101
+
20988
21102
  /**
20989
21103
  * Solar beta angle in degrees from orbit normal and Sun vectors.
20990
21104
  * @param {Float64Array} orbit_normal
@@ -21429,6 +21543,48 @@ export function correlate(iq, prn, options) {
21429
21543
  return CorrelationResult.__wrap(ret[0]);
21430
21544
  }
21431
21545
 
21546
+ /**
21547
+ * Coherently correlate interleaved IQ samples against an explicit bipolar code.
21548
+ *
21549
+ * `iq` is `[i0, q0, i1, q1, ...]`. The coherent sum follows the core
21550
+ * `zip(iq, code)` semantics and therefore uses the shorter non-empty input.
21551
+ * @param {Float64Array} iq
21552
+ * @param {Int8Array} code
21553
+ * @param {number} sample_rate_hz
21554
+ * @param {number} doppler_hz
21555
+ * @returns {CorrelationResult}
21556
+ */
21557
+ export function correlateAgainst(iq, code, sample_rate_hz, doppler_hz) {
21558
+ const ptr0 = passArrayF64ToWasm0(iq, wasm.__wbindgen_malloc);
21559
+ const len0 = WASM_VECTOR_LEN;
21560
+ const ptr1 = passArray8ToWasm0(code, wasm.__wbindgen_malloc);
21561
+ const len1 = WASM_VECTOR_LEN;
21562
+ const ret = wasm.correlateAgainst(ptr0, len0, ptr1, len1, sample_rate_hz, doppler_hz);
21563
+ if (ret[2]) {
21564
+ throw takeFromExternrefTable0(ret[1]);
21565
+ }
21566
+ return CorrelationResult.__wrap(ret[0]);
21567
+ }
21568
+
21569
+ /**
21570
+ * Single-lag circular correlation for two equal-length bipolar codes.
21571
+ * @param {Int8Array} code_a
21572
+ * @param {Int8Array} code_b
21573
+ * @param {bigint} lag
21574
+ * @returns {number}
21575
+ */
21576
+ export function correlationAt(code_a, code_b, lag) {
21577
+ const ptr0 = passArray8ToWasm0(code_a, wasm.__wbindgen_malloc);
21578
+ const len0 = WASM_VECTOR_LEN;
21579
+ const ptr1 = passArray8ToWasm0(code_b, wasm.__wbindgen_malloc);
21580
+ const len1 = WASM_VECTOR_LEN;
21581
+ const ret = wasm.correlationAt(ptr0, len0, ptr1, len1, lag);
21582
+ if (ret[2]) {
21583
+ throw takeFromExternrefTable0(ret[1]);
21584
+ }
21585
+ return ret[0];
21586
+ }
21587
+
21432
21588
  /**
21433
21589
  * Fitted parameter covariance from a converged solve, scaling `(J^T J)^-1` by
21434
21590
  * the post-fit reduced chi-square `s_sq = 2 * cost / (m - n)` (the same scale
@@ -21512,6 +21668,26 @@ export function coverageLookAngles(satellites, stations, epoch_unix_us) {
21512
21668
  return CoverageGrid.__wrap(ret[0]);
21513
21669
  }
21514
21670
 
21671
+ /**
21672
+ * Circular cross-correlation over all lags for two equal-length bipolar codes.
21673
+ * @param {Int8Array} code_a
21674
+ * @param {Int8Array} code_b
21675
+ * @returns {Int32Array}
21676
+ */
21677
+ export function crossCorrelation(code_a, code_b) {
21678
+ const ptr0 = passArray8ToWasm0(code_a, wasm.__wbindgen_malloc);
21679
+ const len0 = WASM_VECTOR_LEN;
21680
+ const ptr1 = passArray8ToWasm0(code_b, wasm.__wbindgen_malloc);
21681
+ const len1 = WASM_VECTOR_LEN;
21682
+ const ret = wasm.crossCorrelation(ptr0, len0, ptr1, len1);
21683
+ if (ret[3]) {
21684
+ throw takeFromExternrefTable0(ret[2]);
21685
+ }
21686
+ var v3 = getArrayI32FromWasm0(ret[0], ret[1]).slice();
21687
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
21688
+ return v3;
21689
+ }
21690
+
21515
21691
  /**
21516
21692
  * @param {any} rel
21517
21693
  * @param {number} n_rad_s
@@ -26454,6 +26630,26 @@ export function pseudorangeVariance(elevation_deg, options) {
26454
26630
  return ret[0];
26455
26631
  }
26456
26632
 
26633
+ /**
26634
+ * Run direct post-solve residual RAIM.
26635
+ *
26636
+ * `input` is `{ usedSats, residualsM }`. Use `options` fields `pFa`,
26637
+ * `nSystems`, and either `weights` or `weightEntries` with `varianceOptions`.
26638
+ * The result has the fault flag, chi-square statistic, threshold, largest
26639
+ * normalized residual satellite, reduced chi-square, normalized residual map,
26640
+ * RMS residual, and degrees of freedom.
26641
+ * @param {any} input
26642
+ * @param {any} options
26643
+ * @returns {any}
26644
+ */
26645
+ export function raim(input, options) {
26646
+ const ret = wasm.raim(input, options);
26647
+ if (ret[2]) {
26648
+ throw takeFromExternrefTable0(ret[1]);
26649
+ }
26650
+ return takeFromExternrefTable0(ret[0]);
26651
+ }
26652
+
26457
26653
  /**
26458
26654
  * Run standalone range RAIM/FDE over a linearized measurement set.
26459
26655
  *
@@ -26462,9 +26658,10 @@ export function pseudorangeVariance(elevation_deg, options) {
26462
26658
  * estimated state dimension). `options` is an optional `{ pFa?, maxExclusions?,
26463
26659
  * minRedundancy? }` object (pass `undefined` for the core defaults). Returns the
26464
26660
  * protected state correction, covariance, global chi-square test, the excluded
26465
- * ids, the per-measurement diagnostics, and the exclusion count. Delegates to
26466
- * `sidereon_core::quality::raim_fde_design`. Throws a `TypeError` for malformed
26467
- * input and an `Error` for a rank-deficient or otherwise rejected set.
26661
+ * ids, the per-measurement diagnostics, and the exclusion count. FDE
26662
+ * computation runs in `sidereon_core::quality::raim_fde_design`.
26663
+ * Malformed input throws a `TypeError`; a rank-deficient or rejected set throws
26664
+ * an `Error`.
26468
26665
  * @param {any} rows
26469
26666
  * @param {any} options
26470
26667
  * @returns {any}
@@ -26477,6 +26674,25 @@ export function raimFdeDesign(rows, options) {
26477
26674
  return takeFromExternrefTable0(ret[0]);
26478
26675
  }
26479
26676
 
26677
+ /**
26678
+ * Run residual chi-square RAIM directly over an existing SPP solution.
26679
+ *
26680
+ * `solution` is a `SppSolution` from `solveSpp`, `solveBroadcast`, fallback,
26681
+ * or a RINEX OBS convenience result. `options` is the same `RaimOptions` object
26682
+ * accepted by `raim`; omit it for the core defaults.
26683
+ * @param {SppSolution} solution
26684
+ * @param {any} options
26685
+ * @returns {any}
26686
+ */
26687
+ export function raimForSolution(solution, options) {
26688
+ _assertClass(solution, SppSolution);
26689
+ const ret = wasm.raimForSolution(solution.__wbg_ptr, options);
26690
+ if (ret[2]) {
26691
+ throw takeFromExternrefTable0(ret[1]);
26692
+ }
26693
+ return takeFromExternrefTable0(ret[0]);
26694
+ }
26695
+
26480
26696
  /**
26481
26697
  * Convert a pseudorange rate in metres per second to Doppler shift in hertz.
26482
26698
  * @param {number} range_rate_m_s
@@ -27750,6 +27966,28 @@ export function solveRtkFloat(config) {
27750
27966
  return RtkFloatSolution.__wrap(ret[0]);
27751
27967
  }
27752
27968
 
27969
+ /**
27970
+ * Solve parsed RINEX OBS epochs serially against a broadcast ephemeris store.
27971
+ *
27972
+ * `rinexOptions` controls observation assembly; `solveOptions` accepts
27973
+ * `withGeodetic`, `maxPdop`, and `coarseSearchSeeds`. The returned batch keeps
27974
+ * per-epoch solve failures, so use `isOk(index)` before `solution(index)`.
27975
+ * @param {BroadcastEphemeris} source
27976
+ * @param {RinexObs} obs
27977
+ * @param {any} rinex_options
27978
+ * @param {any} solve_options
27979
+ * @returns {RinexSppSolutionBatch}
27980
+ */
27981
+ export function solveSppFromRinexObs(source, obs, rinex_options, solve_options) {
27982
+ _assertClass(source, BroadcastEphemeris);
27983
+ _assertClass(obs, RinexObs);
27984
+ const ret = wasm.solveSppFromRinexObs(source.__wbg_ptr, obs.__wbg_ptr, rinex_options, solve_options);
27985
+ if (ret[2]) {
27986
+ throw takeFromExternrefTable0(ret[1]);
27987
+ }
27988
+ return RinexSppSolutionBatch.__wrap(ret[0]);
27989
+ }
27990
+
27753
27991
  /**
27754
27992
  * Solve SPP using an SBAS-corrected broadcast source and optional SBAS iono.
27755
27993
  *
@@ -28099,6 +28337,27 @@ export function splitJdToJ2000Seconds(jd_whole, jd_fraction) {
28099
28337
  return ret;
28100
28338
  }
28101
28339
 
28340
+ /**
28341
+ * Assemble parsed RINEX OBS epochs into broadcast-backed SPP solve inputs.
28342
+ *
28343
+ * `source` is a parsed RINEX NAV broadcast store. `options` accepts
28344
+ * `signalPolicy`, `corrections`, `initialGuess`, `satellites`, `met`, and
28345
+ * `robust`; omit it for the core default policy for the observation file.
28346
+ * @param {BroadcastEphemeris} source
28347
+ * @param {RinexObs} obs
28348
+ * @param {any} options
28349
+ * @returns {any}
28350
+ */
28351
+ export function sppInputsFromRinexObs(source, obs, options) {
28352
+ _assertClass(source, BroadcastEphemeris);
28353
+ _assertClass(obs, RinexObs);
28354
+ const ret = wasm.sppInputsFromRinexObs(source.__wbg_ptr, obs.__wbg_ptr, options);
28355
+ if (ret[2]) {
28356
+ throw takeFromExternrefTable0(ret[1]);
28357
+ }
28358
+ return takeFromExternrefTable0(ret[0]);
28359
+ }
28360
+
28102
28361
  /**
28103
28362
  * @param {BroadcastEphemeris} broadcast
28104
28363
  * @param {SsrCorrectionStore} store
@@ -29722,6 +29981,9 @@ const RinexObsFinalization = (typeof FinalizationRegistry === 'undefined')
29722
29981
  const RinexObsRepairFinalization = (typeof FinalizationRegistry === 'undefined')
29723
29982
  ? { register: () => {}, unregister: () => {} }
29724
29983
  : new FinalizationRegistry(ptr => wasm.__wbg_rinexobsrepair_free(ptr, 1));
29984
+ const RinexSppSolutionBatchFinalization = (typeof FinalizationRegistry === 'undefined')
29985
+ ? { register: () => {}, unregister: () => {} }
29986
+ : new FinalizationRegistry(ptr => wasm.__wbg_rinexsppsolutionbatch_free(ptr, 1));
29725
29987
  const RtcmLockTimeTrackerFinalization = (typeof FinalizationRegistry === 'undefined')
29726
29988
  ? { register: () => {}, unregister: () => {} }
29727
29989
  : new FinalizationRegistry(ptr => wasm.__wbg_rtcmlocktimetracker_free(ptr, 1));
Binary file