Skip to main content

Lightweight Python Star Tracker With Rust Backend

Project description

Lightweight Python Star Tracker With Rust Backend

Based on the methodology used in https://github.com/nasa/COTS-Star-Tracker, with following improvements:

  • Reduced dependencies to opencv and numpy for lightweight usage in a Raspberry Pi.
  • Reimplemented computationally expensive parts in rust. This includes most parts that are not image processing related.
  • Added quadratic inter star angle index look up polynomial for faster triangle search.
  • Added spatial index to look up neighboring stars.

Features:

  • Attitude estimation from image and camera calibration parameters.
  • Attitude estimation from list of star observation coordinates.
  • Star catalog creation with temporal corrections.

Example

Rust

See examples/basic.rs

// Get catalog positions
let catalog: StarCatalog = StarCatalog::from_gaia(max_magnitude: ...).unwrap();
let stars_xyz: Vec<[f32; 3]> = catalog.normalized_positions(epoch: ..., observer_position: ...);
let stars_mag: Vec<f32> = catalog.magnitudes();

// Create StarTracker instance (reuse this)
let star_matcher = StarMatcher::new(
    stars_xyz,
    stars_mag,
    max_lookup_magnitude: ...
    max_inter_star_angle: ...,
    inter_star_angle_tolerance: ...,
    min_matches: ...,
    timeout: ...
);

// Normalized observation in the camera frame
let obs_xyz_camera: Vec<[f32; 3]> = ...

let result = star_matcher.find(&obs_xyz_camera);
println!("Result: {:?}", result);

Python

import ruststartracker

# Get catalog positions
catalog = ruststartracker.StarCatalog(max_magnitude=...)
star_catalog_vecs = catalog.normalized_positions(epoch=...)

# Define opencv camera parameters, see https://docs.opencv.org/4.x/dc/dbb/tutorial_py_calibration.html
camera_params = ruststartracker.CameraParameters(
    camera_matrix=...,
    cam_resolution=...,
    dist_coefs=...,
)

# Create StarTracker instance (reuse this)
st = ruststartracker.StarTracker(
    star_catalog_vecs,
    camera_params,
    max_inter_star_angle=...,
    inter_star_angle_tolerance=...,
    n_minimum_matches=...,
    timeout_secs=...,
)

# Obtain numpy array image
img = ...

# Find attitude from given image
result = st.process_image(img)

print(result)
# StarTrackerResult(quat=[-0.43977802991867065, -0.439766526222229, -0.4398997128009796, 0.6478340029716492], match_ids=[1435, 1272, 1140, 2035, 1070, 1438, 1338, 903, 260, 2141, 1771, 1727, 385, 1717, 2204, 2062, 1989, 1634, 708, 1357], n_matches=20, duration_s=0.0003700880042742938)

Installation

  • Install with pip install ruststartracker (Currently only ARM/x86 Linux wheels available).

Attributions

Gaia Data

This project includes data from the European Space Agency (ESA) mission Gaia, processed by the Gaia Data Processing and Analysis Consortium (DPAC). Funding for the DPAC has been provided by national institutions, in particular the institutions participating in the Gaia Multilateral Agreement.

Gaia DR3 data is © European Space Agency and is released under the Creative Commons Attribution 4.0 International License (CC BY 4.0).

Gaia Collaboration, Vallenari et al. (2022), A&A 674, A1. DOI: 10.1051/0004-6361/202243940

Hipparcos and Tycho Data

This project includes data from the European Space Agency (ESA) mission Hipparcos.

The Hipparcos and Tycho Catalogues were processed by the Hipparcos and Tycho Data Analysis Consortium.

The Hipparcos and Tycho Catalogues are © European Space Agency and are released under the Creative Commons Attribution 3.0 IGO (CC BY 3.0 IGO) license.

Perryman, M. A. C., et al. (1997), Astronomy & Astrophysics 323, L49-L52. 1997A&A...323L..49P

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruststartracker-0.2.8.tar.gz (16.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ruststartracker-0.2.8-cp312-cp312-manylinux_2_35_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.8-cp312-cp312-manylinux_2_35_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ ARM64

ruststartracker-0.2.8-cp311-cp311-manylinux_2_35_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.8-cp311-cp311-manylinux_2_35_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ ARM64

ruststartracker-0.2.8-cp310-cp310-manylinux_2_35_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.8-cp310-cp310-manylinux_2_35_aarch64.whl (4.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ ARM64

File details

Details for the file ruststartracker-0.2.8.tar.gz.

File metadata

  • Download URL: ruststartracker-0.2.8.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ruststartracker-0.2.8.tar.gz
Algorithm Hash digest
SHA256 c70b409df39da4d136c9739ebc093c9277316f26e1c1af8dbeb9b481637c7d20
MD5 e563db94ab2515d17177ca57d0149c56
BLAKE2b-256 7ef01d4f53210b6e431b2ec2e54a2b3e126e93531e8c576beff5caed5683990e

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.8-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.8-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 f4907c92f970aa63a2b8efffb21b796bfd6b5a5cbf420f5bb7b9a5227c44c7da
MD5 6bd07c71f79d82033f6a383c49ee774d
BLAKE2b-256 dc8fb5544bb9c53bf73a4bacdf693472f1cf4f7397a623b3ac05fa86011d3b38

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.8-cp312-cp312-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.8-cp312-cp312-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 cb2301fcd524cba221904dd6ac7493b2bab31908b3cf62ae3a0a42a747147ba9
MD5 87e33d9225b7728728c9a835719e6734
BLAKE2b-256 d590b3a3308885bdced4c386dea5b754d3028c18a4c86c2cbedae495c6ce2f1d

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.8-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.8-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 622f4231d0523e23c4e1eaa55274872a1b5c79beea6bfdec2f394730e0c9b732
MD5 4daae4d55a98b5b9d889d4be8a4628b4
BLAKE2b-256 218b920d407c2de9ec75a785676334fab3c7d2123f1056ae9802a2acdc554578

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.8-cp311-cp311-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.8-cp311-cp311-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 bcab47a698f63f74f00e7622e93e0eb68bee69218d5da7e05b314d176ee721ea
MD5 e0e86ccf39fefac5532f512639aaada6
BLAKE2b-256 698664f6458553b0e047a0f716620cb0c5645d7080bd76443dcb32e162799aeb

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.8-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.8-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 b4940033c0a2e70a0db3ce9bcd7af509f660472d87c8a7a8ed8ff60fcdf5147a
MD5 9b7c3ec4194782a679b1dc74eb2fed95
BLAKE2b-256 aaece40a47371608d12fc26739752f8c0d5d34773a09acb6844d9bb37af8c9fa

See more details on using hashes here.

File details

Details for the file ruststartracker-0.2.8-cp310-cp310-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for ruststartracker-0.2.8-cp310-cp310-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 f768a2708b131aff461da67023b06104f908a71f2c1a69772cd6310f4641af3c
MD5 03380e596c7aae15d704f5e46144e821
BLAKE2b-256 2c7427243b54e607d1b6a9f4ec2ef00453f15a792617ff4d2ae2d51eada08e8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page