Metadata-Version: 2.4
Name: asterope
Version: 0.1.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Dist: numpy>=1.22
Summary: Star tracker software: find where a camera points from the stars in its image
Keywords: star tracker,attitude determination,astrometry,plate solving,cubesat
License: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/SpaceEngineerSS/asterope/blob/main/docs/python.md
Project-URL: Repository, https://github.com/SpaceEngineerSS/asterope

# asterope for Python

Find where a camera points from the stars in its image.

```python
import asterope

tracker = asterope.StarTracker(1024, 1024, fov_deg=14.0)
fix = tracker.solve(frame)            # frame: 2-D numpy array of uint16
if fix.locked:
    print(fix.quaternion)             # (x, y, z, w), ICRS to sensor
    print(fix.ra_deg, fix.dec_deg, fix.roll_deg)
    print([match.star for match in fix.matches])
```

`tracker.update(frame, dt)` follows a sequence of frames, tracking from the
last solution. `asterope.solve_image(frame)` solves a photograph whose field
of view is not known and returns the lens it found. `asterope.simulate(...)`
renders a frame to try things on. With a rate gyro, `enable_gyro`, `gyro`
and `update_aided` carry the attitude through frames without stars.

A frame is a C-contiguous `uint16` array, top row first. The quaternion
turns ICRS vectors into the sensor frame, whose +Z is the boresight, +X
image right and +Y image down. The catalog built in holds the Hipparcos
stars to V 6.5; pass the bytes of another `.astc` file as `catalog=` for a
deeper one.

`docs/python.md` in the repository describes every call.

Build from the repository root with [maturin](https://www.maturin.rs):

```
pip install maturin
maturin build --release -m crates/asterope-py/Cargo.toml
pip install target/wheels/asterope-*.whl
pytest crates/asterope-py/tests
```

