star-wahba 0.1.0
Attitude from vector observations
Public state: Released & Verified. The registry label is RELEASED. What the states mean →
Apache-2.0 Released & Verified single file
Summary
Attitude from vector observations: TRIAD for two directions and Davenport's q-method (Wahba's problem) for 2 to 1000 weighted directions, with the eigenproblem solved by Jacobi rotations in the standard library; conversion to the attitude matrix and the Wahba loss; within 7e-15 of SciPy's SVD solution and 5e-16 of ahrs TRIAD on 401 attitudes.
Run in your browser
Edit the code and press Run (or Ctrl+Enter). Python runs in your browser with this package's published code. The first run downloads Python once (about 12 MB).
Runs in the browser: all 31 tests pass in the browser's Python (Pyodide 314.0.7, Python 3.14.2), measured on 20 October 2026.
Use it on your computer
No account and no GitHub needed. Download, then install with one command:
- Install file · star_wahba-0.1.0-py3-none-any.whl 4 kB
- Single file — copy it alongside your code · star_wahba.py 9 kB
- Source code (.zip) 26 kB
python -m pip install star_wahba-0.1.0-py3-none-any.whlIn Python: import star_wahba
Cite it, and its bill of materials
For a paper, a report or a supplier file: the citation in two formats, and the software bill of materials (SBOM) in the two standard formats, with the fingerprint of the wheel.
@software{cavazzini_star_wahba_0_1_0,
author = {Cavazzini, Andrea},
title = {{star-wahba}: Attitude from vector observations},
version = {0.1.0},
year = {2026},
url = {https://andrea07072000.github.io/S.T.A.R.-/software/star_wahba/},
note = {Apache-2.0. Source: https://github.com/Andrea07072000/S.T.A.R.-, commit dc09f61d}
}
For developers
Install directly from the public repository:
python -m pip install "star-wahba @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_wahba"
Technical sheet
Requirements
- R1
triad(r1, r2, b1, b2)returns the attitude matrix A (reference to body, b = A r) that matches the first pair exactly;q_method(refs, bodies, weights)returns the unit quaternion (w, x, y, z), w >= 0, that minimises Wahba's loss;rotation_matrix(q)converts it to A;wahba_lossevaluates 0.5 Σ w |b - A r|² with the weights normalised to sum 1. - R2 TRIAD by two orthonormal triads; the q-method by the eigenvector of the largest eigenvalue of Davenport's K matrix, found with Jacobi rotations. Vectors need not be unit: only their directions are used.
- R3 Measured on 401 attitudes with 2 to 8 weighted directions, half of them with 0.01 rad of noise: the q-method agrees with the singular-value solution of SciPy within 7e-15 in every element of the matrix, TRIAD with the TRIAD of ahrs within 5e-16.
- R4 Every function returns floats or raises
ValueError: vectors that are not three finite numbers or are zero, fewer than 2 or more than 1000 pairs, weights that are not positive, directions that do not fix an attitude (parallel), a zero quaternion.
Limits (what is not claimed)
A single-frame estimate: no filtering over time, no gyro, no covariance of the estimate, no bias estimation, no QUEST or ESOQ variants (they solve the same problem faster; this one favours robustness over speed). TRIAD and the q-method give different answers on noisy data by design: TRIAD trusts the first observation entirely. Nearly parallel observations are accepted down to 1e-12 and give an attitude that is very sensitive to noise about their common direction: the functions do not warn about it. No published numerical example is reproduced: the references (Wahba 1965, Black 1964, Davenport 1968, Markley and Crassidis) are cited for the method.
Release gate
Computed by the registry from the result files, with the same function that decides RELEASED.
- Mutation score, latest measure of each module (needs at least 0.850)
- star_wahba.py 0.954 (2026-10-07)
- Independent implementations written by others (needs 2)
- ahrs TRIAD, scipy Rotation.align_vectors (SVD)
- Result
- Released & Verified
Evidence in the registry
| Check | Status | Recorded | What was observed |
|---|---|---|---|
| Clean install from the release tag | VERIFIED | 2026-10-07 | pytest outside the tree: 31 passed in 1.86s |
| Unit tests | VERIFIED | 2026-10-07 | 31 passed in 2.06s |
| Review | VERIFIED | 2026-10-07 | Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed |
| Review | VERIFIED | 2026-10-07 | Re-running the cross-check gives a byte-identical evidence file |
| Reference value | VERIFIED | 2026-10-07 | triad((1,0,0), (0,1,0), (0,-1,0), (1,0,0)) = ((0.0, 1.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, 1.0)); q_method of the same = (0.7071067811865476, 0.0, 0.0, 0.7071067811865476) (suite: 31 passed in 2.06s) |
| Cross-check with independent libraries | VERIFIED | 2026-10-07 | star_wahba returns the same attitude as an SVD solution of Wahba's problem (q-method) and as an independent TRIAD, with and without measurement noise |
| Benchmark | VERIFIED | 2026-10-07 | largest element difference from SciPy: 6.1e-15; from ahrs: 4.4e-16 |
Fingerprints (SHA-256)
| star_wahba-0.1.0-py3-none-any.whl | 1822bb8f136e7080bb1bd923bccaec1fc6c00eb5259250b2bbbd8e1e731745ad |
| star_wahba.py | 57b35fe5a36575980d5786d657acbbf2c919dff6f7ed5034b7875fd530c2533b |
| star_wahba-0.1.0-source.zip | d30a7ca28b4a986a49d2b03c16b0ad184919f99cccc553a7aece2ab75b8a12c2 |
