← All packages

Frames & geometry

star-horizon 0.1.0

Hour angle and declination ⇄ azimuth and elevation

Public state: Released & Verified. The registry label is RELEASED. What the states mean →

Apache-2.0 Released & Verified single file

Summary

Azimuth and elevation from hour angle, declination and latitude, the inverse, and the parallactic angle; agrees with ERFA and a SPICE rotation to 1.1e-13 deg on 600 cases in both directions and refuses out-of-range input.

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 37 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:

python -m pip install star_horizon-0.1.0-py3-none-any.whl

In Python: import star_horizon

Get started →

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_horizon_0_1_0,
  author  = {Cavazzini, Andrea},
  title   = {{star-horizon}: Hour angle and declination ⇄ azimuth and elevation},
  version = {0.1.0},
  year    = {2026},
  url     = {https://andrea07072000.github.io/S.T.A.R.-/software/star_horizon/},
  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-horizon @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_horizon"

README · tests · evidence (GitHub)

Technical sheet

Package
star-horizon
Import name
star_horizon
Version
0.1.0
Licence
Apache-2.0
Python
>=3.9
Dependencies
none (standard library only)
Capability
star.frames.horizon
Maturity
Released & Verified (RELEASED)
Published commit
dc09f61d

Requirements

  • R1 hadec_to_azel(ha, dec, lat) returns azimuth from North through East in [0, 360) and elevation; hour angle is positive West of the meridian. Reproduces Meeus Example 13.b.
  • R2 azel_to_hadec(az, el, lat) is its inverse, with the hour angle in (-180, 180]; parallactic_angle_deg(ha, dec, lat) is the angle at the object between the pole and the zenith, in (-180, 180].
  • R3 Measured on 600 cases (100 down to 1e-6 deg from the zenith, 100 at latitudes down to 1e-6 deg from a pole), in both directions: within 1.1e-13 deg of ERFA and of a SPICE rotation; parallactic angle identical to ERFA.
  • R4 Every function returns finite floats or raises ValueError: non-numeric, boolean, NaN or infinite input, hour angle or azimuth outside [-360, 360], declination, elevation or latitude outside [-90, 90].

Limits (what is not claimed)

No refraction, parallax, aberration, polar motion or deflection of the vertical: this is the geometric direction. The parallactic angle is compared with one library (ERFA), with the same formula: the agreement shows the same convention, not an independent derivation. The SPICE lineage uses SPICE routines composed in the driver. At the zenith or nadir the azimuth is undefined, at a celestial pole the hour angle is undefined, at the zenith the parallactic angle is undefined: 0 is returned there.

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_horizon.py 0.973 (2026-10-06)
Independent implementations written by others (needs 2)
ERFA hd2ae / ae2hd / hd2pa (C), SPICE latrec / rotvec / reclat (rotation composed in the driver)
Also compared with, not counted
published values: Meeus, Astronomical Algorithms, Example 13.b
Result
Released & Verified

Evidence in the registry

CheckStatusRecordedWhat was observed
Clean install from the release tagVERIFIED2026-10-06pytest outside the tree: 37 passed in 0.22s
Unit testsVERIFIED2026-10-0637 passed in 0.40s
ReviewVERIFIED2026-10-06Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed
ReviewVERIFIED2026-10-06Re-running the cross-check gives a byte-identical evidence file
Reference valueVERIFIED2026-10-06(248.033693, 15.124874): within 2.7e-5 deg of the printed values (printed to 1e-4) (suite: 37 passed in 0.40s)
Cross-check with independent librariesVERIFIED2026-10-06star_horizon converts hour angle and declination to azimuth and elevation, and back, as ERFA and a SPICE rotation do
BenchmarkVERIFIED2026-10-06largest difference by lineage: erfa: 1.0e-13 deg; spice: 5.5e-14 deg

Fingerprints (SHA-256)

star_horizon-0.1.0-py3-none-any.whlda8f0206eddaa2cf077394930ec6bb09d86023882dfa8f17a708780c75115fed
star_horizon.pyff7979c40689f8ca534d3e396c77dbe9c1838bdecdbe88188bd4223903534534
star_horizon-0.1.0-source.zip3a52f81b255cbe94d493453bbeb952e259bb5e797b0798832c5c63d915347bf0

results