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. The accepted manuscript is included in this repo: docs/gazak2026_senpai_pasp.pdf — 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:

pip install senpai

Releases up to 2.9.0 were published as astro-senpai. That name still works: it now installs senpai at the same version. If you upgrade an old astro-senpai install with pip and senpai is then broken (for example, it has no __version__), run pip install --force-reinstall --no-deps senpai, or switch cleanly with pip uninstall astro-senpai && pip install 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

Acknowledgments

Thanks to sangarshanan for handing over the senpai name on PyPI.

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

The accepted manuscript is available here: docs/gazak2026_senpai_pasp.pdf. This is the author-accepted version; the version of record is at the DOI above. IOP Publishing Ltd is not responsible for any errors or omissions in this version of the manuscript or any version derived from it.

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}
}

Metadata

Release files for senpai 2.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for senpai 2.9.1
File Size Uploaded Provenance Actions
senpai-2.9.1.tar.gz 2.2 MB With provenance Details for senpai-2.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for senpai 2.9.1
File Interpreter ABI Platform Actions
senpai-2.9.1-py3-none-any.whl Python 3 none any Details for senpai-2.9.1-py3-none-any.whl

Total release size: 2.9 MB

Release files / senpai-2.9.1.tar.gz

Download URL senpai-2.9.1.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
8820eb46bfc5e977893c412f54de5f4880feb5905532bf6b83f7b77d14285068
BLAKE2b-256 checksum
How to use checksums
04f7c317f4def9b1f0bdb5092b25a5b02e2bfcfe9931ca16ba5ac3ee66c06314
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / senpai-2.9.1-py3-none-any.whl

Download URL senpai-2.9.1-py3-none-any.whl
Size 662.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e6fcc57c12561c01ea3bd6cb5d5b0125b31dc771c8a0ef4c9a1e9ec9a608ebc
BLAKE2b-256 checksum
How to use checksums
606d80a09ebb2873598ecfd4318c7ca451e1f7af476576f194098771350a8c65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for senpai 2.9.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for senpai-2.9.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.9.1 This release

2 release files Full provenance

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