← All projects

Star Tracker Simulator

adcsattitude-determinationcentroidinghipparcospythonspacecraftsstar-tracker

Synthetic star-image simulator and visualization layer for spacecraft attitude determination

Python · updated Aug 2026

From the repository

Startracker Simulator for Attitude Determination of Spacecraft

<p align="center"> <b>A testbed for the spacecraft "lost-in-space" star tracker problem: synthetic star image generation, centroiding, star identification, and attitude determination.</b> </p>

Table of Contents


Overview

A software testbed for the "lost-in-space" star tracker problem: simulate a synthetic star field image for a given spacecraft pointing direction, extract star positions from that image, identify which stars they are against a catalog, and recover the spacecraft's attitude (pointing direction and roll) from that identification. This project was built to have an end-to-end, inspectable pipeline for experimenting with each stage of that problem independently rather than treating star tracking as a single opaque step.

A minimal Flask UI is included to generate and inspect synthetic star images interactively.

What's Original vs. Adapted

Being upfront about this because it matters for anyone evaluating the code:

ComponentStatus
Synthetic star image generator (PSF rendering, noise model, RA/Dec/Roll to sensor projection)Original: our own implementation
Interactive web UI (Flask app for generating and viewing star images)Original: our own implementation
Star pattern catalog construction & centroidingAdapted from tetra3 (ESA), itself based on the original Tetra algorithm (Brown, Stubis & Cahoy, 2017), not written by us
Pyramid star identification (geometric alternative to tetra3's hash-based matching)Original, unfinished, utility code (camera model, quaternion calculation) is complete; the core matching logic is stubbed out

The main identification algorithm this project runs on is tetra3's, used largely as-is. Our contribution is the simulation and visualization layer built around it, generating synthetic imagery with known ground truth to test the pipeline against, plus an in-progress attempt at an alternative, geometry-based identification method.

Theoretical Background

Star Tracker Operating Principle

  1. Image Acquisition: capture a star field image via an optical sensor
  2. Star Extraction: detect and centroid bright spots (stars) in the image
  3. Star Identification: match the observed pattern of stars against an onboard catalog
  4. Attitude Estimation: compute the rotation that aligns catalog vectors with observed body-frame vectors

Pyramid Star Identification

A lost-in-space identification method that builds a triangle (and then a confirming fourth star, forming a "pyramid") from observed stars, using angular separations as invariant descriptors, and checks the triangle for a unique, non-specular match against the catalog.

D. Mortari, M. A. Samaan, C. Bruccoleri, and J. L. Junkins, "The Pyramid Star Pattern Recognition Algorithm," IEEE Transactions on Aerospace and Electronic Systems, 2004.

This project's pyramid algorithm/ module documents and partially implements this technique as an alternative to tetra3's hash-based approach.

K-Vector Search

A technique for constant-time range searches on a sorted database, relevant to fast catalog lookups during star identification.

D. Mortari and B. Neta, "k-Vector Range Searching Techniques," Advances in the Astronautical Sciences, 2000.

startrack-demo/kvector.py in this repo is a small worked example illustrating how a k-vector is constructed from a sorted dataset, it's a standalone teaching illustration, not (yet) wired into the identification pipeline itself.

Results

Some of the output generated from our image generator are as shown below:

RA=30RA = 30^\circ
DE=70DE = 70^\circ
Roll=30Roll = 30^\circ
FOV=17FOV = 17^\circ Ra30_de70_roll30_1024x1024_FOV17_noise0.05

RA=23.953284595193427RA = 23.953284595193427^\circ
DE=3.243865320346328e05DE = 3.243865320346328e-05^\circ
Roll=77.7014685399641Roll = 77.7014685399641^\circ
FOV=25FOV = 25^\circ

ra23.953284595193427_de3.243865320346328e-05_roll77.7014685399641_FOV25

Star Image Comparison Star Image comparison

Setup

pip install -r requirements.txt
python "Custom Catalog/generator.py"
python UI/app.py

Background Reading

  • D. Mortari, M. A. Samaan, C. Bruccoleri, and J. L. Junkins, "The Pyramid Star Pattern Recognition Algorithm," IEEE Transactions on Aerospace and Electronic Systems, 2004.
  • D. Mortari and B. Neta, "k-Vector Range Searching Techniques," Advances in the Astronautical Sciences, 2000.
  • J. A. Christian and J. L. Crassidis, "Star Identification and Attitude Determination With Projective Cameras."
  • J. Brown, K. Stubis, and K. Cahoy, "TETRA: Star Identification with Hash Tables," AIAA/USU Conference on Small Satellites, 2017.

Acknowledgments

The catalog generation and centroiding modules build directly on tetra3 (© 2019 European Space Agency, Apache License 2.0), itself based on the original Tetra algorithm by J. Brown, K. Stubis, and K. Cahoy. See the header of each file in Custom Catalog/ and Centroiding algorithm/ for the original license text.