Skip to main content

Asteria 🌌

PyPI version Python Versions CI Status License: MIT Documentation Status

Asteria is a lightweight, high-performance deep learning inference engine and instance deblender for stars in astronomical imaging, powered by boundary-aware UNet++ (Nested U-Net).

Designed for the Nancy Grace Roman Space Telescope, Asteria provides promptless, end-to-end star detection in a single neural forward pass.

Asteria segmentation example
Example of Asteria star detection on a simulated Roman WFI exposure.


Key Features

  • Lightweight & Self-Contained: Pure PyTorch UNet++ architecture without bulky dependencies or heavyweight vision foundation models.
  • Hardware Acceleration with Automatic Fallback: Auto-detects and optimizes execution across NVIDIA CUDA (with TF32 and AMP), Apple Silicon MPS (Metal Performance Shaders on macOS), and universal CPU.
  • Physical Boundary-Aware Deblending: Trained with 3-class supervision:
    • 0: Sky Background
    • 1: Source Interior / Core
    • 2: Deblending Boundary / Contact Interface
  • Seamless Tiled Dense Inference (predict_dense): Sliding-window 2D Hann/cosine window blending to process arbitrary image sizes (from local cutouts up to full $4088 \times 4088$ Roman WFI exposures) with bounded memory ($< 350$ MB VRAM).
  • Photometric LeakySB Stretch: Non-linear surface brightness transformation that preserves stellar point-spread functions (PSFs) while lifting faint, diffuse galactic wings.
  • Unified Astronomical I/O: Direct support for 2D astronomical FITS (.fits, .fits.gz), Roman ASDF (.asdf Level 2 calibrated exposures and Level 3 mosaics via roman_datamodels), and raw NumPy arrays. Automatically converts Level 2 exposures to surface brightness units ($\text{MJy/sr}$) using calibrated photometry and enables $\text{ZP}=20.472$.
  • Instant Deblending: Marker-controlled watershed expansion turning dense neural predictions into discrete celestial catalogs with centroids, bounding boxes, and photometry.

Installation

From PyPI

pip install asteria-roman

From Source

git clone https://github.com/PabloMSanAla/asteria.git
cd asteria
pip install -e .

Quickstart

1. Python API

import asteria

# 1. Load pre-trained model (auto-downloads weights on first run, auto-selects device)
segmentor = asteria.load_model("latest")

# 2. Run dense 3-class segmentation inference on a FITS or ASDF exposure
pred_mask, probs, stretched = segmentor.predict_dense(
    "scene_0001_F106.fits",
    tile_size=512,
    overlap=64,
)

# 3. Render publication-ready side-by-side 2-panel figure
fig = asteria.plot_two_panel(
    stretched=stretched,
    pred_mask=pred_mask,
    save_path="prediction.png",
)

# 4. Extract discrete, deblended astronomical sources (marker-controlled watershed)
catalog = segmentor.segment("scene_0001_F106.fits")
print(f"Extracted {len(catalog.masks)} distinct celestial objects!")
for idx, (cx, cy) in enumerate(catalog.centroids[:5]):
    print(f"Source #{idx + 1}: centroid=({cx:.1f}, {cy:.1f}), area={catalog.areas[idx]} px")

2. Command-Line Interface (CLI)

Asteria includes the asteria-predict CLI command:

# Basic prediction and display
asteria-predict scene.fits

# Full-field tiled inference with saving and FITS export
asteria-predict scene.fits \
    --tile_size 512 \
    --overlap 64 \
    --output results.png \
    --export_fits segmap.fits \
    --deblend \
    --no_display

Model Architecture & Weights History

Weight Version Backbone Resolution Training Set Epochs Interior IoU Edge IoU (tol=1px) Macro IoU Training cutouts Hardware
v0.1.0 (latest) UNet++ (32-512) $512 \times 512$ Roman WFI Synthetic 80 0.754 0.513 0.6335 2800 NASA NAS GH200

For comprehensive architectural details and benchmark comparisons, see the Asteria Documentation.


License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for asteria-roman 0.1.0

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

Source distribution (sdist)

Source distribution for asteria-roman 0.1.0
File Size Uploaded Provenance Actions
asteria_roman-0.1.0.tar.gz 10.1 MB With provenance Details for asteria_roman-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asteria-roman 0.1.0
File Interpreter ABI Platform Actions
asteria_roman-0.1.0-py3-none-any.whl Python 3 none any Details for asteria_roman-0.1.0-py3-none-any.whl

Total release size: 10.1 MB

Release files / asteria_roman-0.1.0.tar.gz

Download URL asteria_roman-0.1.0.tar.gz
Size 10.1 MB
Tags Source
SHA-256 checksum
How to use checksums
6cfd6e2bee2a2bbed2bf3768c3838a59366c4e19433517485e5e8a35cbedf8e1
BLAKE2b-256 checksum
How to use checksums
da6b303091749daee244716ff30e0132328c619d421e265dd44dd75a009dc89d
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 9, 2026.

Transparency log

Release files / asteria_roman-0.1.0-py3-none-any.whl

Download URL asteria_roman-0.1.0-py3-none-any.whl
Size 81.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b18638acf2606cd14ef9fd3c6d4be2d943442f6d7d4b7c0dfe72fcb5a8ec879
BLAKE2b-256 checksum
How to use checksums
501367921f92911966b8ccba4a14fc45a43521b182900371f7bb625877d55d50
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 9, 2026.

Transparency log

Security for asteria-roman 0.1.0

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 asteria_roman-0.1.0.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 9, 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.

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