Skip to main content

SENPAI

CI Tests Coverage

A classic star detector and astrometry tool.

senpai

SENPAI is built off of the algorithm descriptions in Gazak et al. 2026, PASP, 138, 014502 — see Citation below if you use this software.

Is SENPAI the tool I'm looking for? SENPAI processes FITS imagery from ground-based telescopes and provides:

  • ✔️ Astrometric fitting (WCS) — from a sidereal image, a list of extracted star positions, a sidereal + rate-track series, or a single or series of rate-track images with no prior WCS
  • ✔️ Point source detection — stars in sidereal frames, satellites in rate-track frames
  • ✔️ Streak detection — satellite/debris trail detection and measurement, with multi-frame confirmation
  • ✔️ Photometry — aperture photometry with star catalog cross-matching (Gaia, SDSS, SSTRC7)
  • ✔️ Batch processing — process whole directories of imagery via CLI or REST API
  • ✔️ ML dataset export — export detections as COCO-format datasets for model training

Dependencies

  • astroeasy - Handles all Astrometry.net considerations (installation, index files). See its README for setup and getting your config right
  • Star catalogs - See senpai/catalog/README.md for setup and usage

Install

Install from PyPI (package name astro-senpai, imports as senpai):

pip install astro-senpai

Development install

This repo uses uv to manage python dependencies. First, install uv. Then,

make sync

or

uv sync --all-extras

then

source .venv/bin/activate

Run SENPAI

When you run the SENPAI api, it loads a config file, which you can specify on command line (or use default senpai/resources/config/local.yaml)

Run SENPAI CLI

you can always provide your own config.yaml with --config <your_config.yaml> flag.

I want to:

  1. fit a single sidereal image:
python -m senpai.cli.single --image <your_fits_file> --output_dir <your_output_directory> --plot

Run SENPAI API

When you run the SENPAI api, it loads a config file, which you can specify on command line (or use default senpai/resources/config/local.yaml)

  • the default config is senpai/resources/config/local.yaml
  • on startup, SENPAI will check for downloaded indices files

Cache and log files are written outside the install tree, under $XDG_CACHE_HOME/senpai (or ~/.cache/senpai). Override with SENPAI_CACHE_DIR and SENPAI_LOG_DIR — useful in containers, where $HOME may not be writable.

local SENPAI API

make run

or

uv run python -m senpai.api.main --config senpai/resources/config/local.yaml

containerized SENPAI API

Build container

docker build -t senpai .

Or, if you have a custom base image:

docker build --build-arg BASE_IMAGE=<your-custom-base-image> -t senpai .

run container

  • config this container builds with senpai/resources/config/containerized.yaml
  • port runs on 8000 in container

Run like this, noting that target is the path to your indices in the container, and must match your config file (containerized.yaml by default).

docker run -p 8000:8000 --mount type=bind,source=/path/to/indices/5000/5200,target=/home/starman/indices/5000/5200 senpai:latest

If you want to use a different config file (to specify different indices or other settings), you can do so like this:

docker run -p 8000:8000 \
    --mount type=bind,source=/path/to/indices/5000/5200,target=/home/starman/indices/5000/5200 \
    --mount type=bind,source=/path/to/your/config.yaml,target=/app/resources/config/containerized.yaml \
    senpai:latest

This will mount your custom config file in place of the default containerize.yaml. Make sure your custom config file follows the same format as the default configuration.

http://localhost:8000/docs

Citation

SENPAI implements the algorithms described in:

Gazak, J. Z., Fisher, L., Phelps, M., Swindle, R., Baruela, L., & Fletcher, J. 2026, "SENPAI: Sidereal Enriched Rate-track Astrometry in Deep Imagery of Solar System Bodies", PASP, 138, 014502. doi:10.1088/1538-3873/ae2b35

If you use SENPAI in your research, please cite this paper:

@article{Gazak2026SENPAI,
  title   = {SENPAI: Sidereal Enriched Rate-track Astrometry in Deep Imagery of Solar System Bodies},
  author  = {Gazak, J. Zachary and Fisher, Lauren and Phelps, Matthew and Swindle, Ryan and Baruela, Leonard and Fletcher, Justin},
  journal = {Publications of the Astronomical Society of the Pacific},
  volume  = {138},
  number  = {1},
  pages   = {014502},
  year    = {2026},
  doi     = {10.1088/1538-3873/ae2b35}
}

Download files

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

Source Distribution

astro_senpai-2.7.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

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

astro_senpai-2.7.0-py3-none-any.whl (635.2 kB view details)

Uploaded Python 3

File details

Details for the file astro_senpai-2.7.0.tar.gz.

File metadata

  • Download URL: astro_senpai-2.7.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for astro_senpai-2.7.0.tar.gz
Algorithm Hash digest
SHA256 f2375a86ad40b853438c7248017bc5c45c5bb95f4c1b8f567a8c019fd6b22c68
MD5 1130c2c70cb2496499d089f3453581dc
BLAKE2b-256 72da2c72cfea6d4a4067f36265bc7d48ba37f7640c8a2dd3c5a3caae69695cdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for astro_senpai-2.7.0.tar.gz:

Publisher: python-publish.yml on ssc-ai/senpai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file astro_senpai-2.7.0-py3-none-any.whl.

File metadata

  • Download URL: astro_senpai-2.7.0-py3-none-any.whl
  • Upload date:
  • Size: 635.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for astro_senpai-2.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3282de8059f2c9f981168a03cb08281dfdae67b144a9fa6c58670212c2578416
MD5 f6be3f87eb04b9fe41ed95a0cc1a4ae8
BLAKE2b-256 e6c2f5b2354e7db3b1609f200090463668fa40c47c164b1a96f39e09401d9866

See more details on using hashes here.

Provenance

The following attestation bundles were made for astro_senpai-2.7.0-py3-none-any.whl:

Publisher: python-publish.yml on ssc-ai/senpai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.8.2

2 files

2.8.0

2 files

This release

2.7.0 This release

2 files

2.6.0

2 files

2.4.0

2 files

2.3.1

2 files

2.3.0

2 files

0.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page