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.6.tar.gz (15.7 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.6-cp312-cp312-manylinux_2_35_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.6-cp312-cp312-manylinux_2_35_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ ARM64

ruststartracker-0.2.6-cp311-cp311-manylinux_2_35_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.6-cp311-cp311-manylinux_2_35_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ ARM64

ruststartracker-0.2.6-cp310-cp310-manylinux_2_35_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

ruststartracker-0.2.6-cp310-cp310-manylinux_2_35_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ ARM64

File details

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

File metadata

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

File hashes

Hashes for ruststartracker-0.2.6.tar.gz
Algorithm Hash digest
SHA256 f42b608dd740785188be79b3e39355b4f35402a01ea357e17f0a9d89f9463202
MD5 5633d20eb4ff9c6f500ee93efe960d16
BLAKE2b-256 21ec3a37cf1bb2da0a100514f0b27865924c69419aefd4d543ca5eeb76e00343

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruststartracker-0.2.6-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 602a2ed48e174c5243eb1202b3ae9de682c422ec1dc4418c0285c9cbf1f0d5cd
MD5 8ee5de69d16db8b0716a58c51f025ce3
BLAKE2b-256 727971e207cdf31899a09a437decbf75f3cd8c8eeac88b69d0c724f25a244756

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruststartracker-0.2.6-cp312-cp312-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 a3579f74285d9ca2633383b8c0c1114686cb947130e71ec8cc8b4a7d6b611dff
MD5 8a22713ae0227285ca22171515191ef9
BLAKE2b-256 72fe4de818e61340cfbe449d808addc80d4525841c6fc030bf9d79f2aa666e68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruststartracker-0.2.6-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 40472da5818b646fa2ecc07fdeef2d88a7245c092d3e8bb5d2f429b3e0bad253
MD5 d629b499554cf6197ddab10d4f510c16
BLAKE2b-256 f547ee9c1d442659ea903183b2e16ddca1482da3229bfe7ca699559a975ee3b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruststartracker-0.2.6-cp311-cp311-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 35a0f26e6d220a2378d288e5483095d59ca461441fbf7ee0c1eff0e49b037c98
MD5 3e24d1317074db48fb7baa0a53a58220
BLAKE2b-256 edfc6b7f7901cf091774b8a80417a8165dd61613a3eabc8c56be9c65f0702e5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruststartracker-0.2.6-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 6dadde762267697f9b08255694f1c8055d0813f10912a873df525582f3784729
MD5 27b73bfa36dda15df75f674d2514fb72
BLAKE2b-256 096ab357fa32aa968b68a66ffa3176943b02f3c86573cd7c24bae600b9076da8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ruststartracker-0.2.6-cp310-cp310-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 b58ad518bdb3d70c538e2bb764026de3d8621729e527833a527000c3dc895ef0
MD5 f779cdcdf30fbd8a915b1052a2871faa
BLAKE2b-256 cc22f2681c4cad1e3b45eb7c95403b47817397ce2ecdc8275ca77db387dfa246

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