Skip to main content

Fornax Cutouts

Pluggable backend for async FITS image cutouts with FastAPI + Celery + Astrocut using the IVOA UWS standard.

Welcome

This repository is the codebase for a generalized astronomical image cutout service. The goal is to make it easier for archives and mission teams to stand up their own cutout services for their holdings without reimplementing async job handling, worker dispatch, and a standards-based REST API. You add mission-specific data sources and deploy to your own infrastructure. The framework supplies the cutout pipeline, UWS-based API and job metadata management. The library is meant to be used by archives and other teams to deploy and extend it for their own data. For example, MAST's cutouts service is one such deployment. Collaboration happens on GitHub: use issues to report problems or discuss changes that benefit others, and open pull requests to contribute improvements upstream. See Contributing to get started.

Overview

Fornax Cutouts provides a framework for building astronomical image cutout services. Define mission-specific data sources, register them with the cutout registry, and the framework handles job queuing, worker dispatch, result storage, and REST API exposure automatically.

Requirements

  • Python 3.12+
  • Redis 6.x or newer — used as the Celery broker/backend and for UWS job state.

Configure the broker/backend with the following CUTOUTS__REDIS__* settings for local development:

Variable Default Purpose
CUTOUTS__REDIS__HOST localhost Redis hostname
CUTOUTS__REDIS__PORT 6379 Redis port
CUTOUTS__REDIS__TIMEOUT 15.0 Connection timeout (seconds)

The API and workers must use the same Redis instance (and compatible TLS/cluster settings). See the configuration reference for the full list of settings.

Documentation

Full documentation is available at nasa-fornax.github.io/fornax-cutouts.

Use as a library

Install this package in your own service and point CUTOUTS__SOURCE_PATH at a directory of mission modules that register sources with cutout_registry.

With uv, you can add an editable path dependency if developing this project side by side with your mission sources:

[tool.uv.sources]
fornax-cutouts = { path = "../fornax-cutouts", editable = true }  # Only include if developing with fornax-cutouts source code

[project]
dependencies = [
    "fornax-cutouts",
]

Then run uv sync. Implement mission sources as described in Building a Source.

Quick Start

# Install
git clone https://github.com/nasa-fornax/fornax-cutouts
cd fornax-cutouts
uv sync

# Configure (minimum required)
export CUTOUTS__SOURCE_PATH=/path/to/your/sources
export CUTOUTS__REDIS__HOST=localhost

# Start Redis
docker run -d -p 6379:6379 valkey/valkey-bundle:9.1

# Start API
fornax-cutouts api

# Start worker (separate terminal)
fornax-cutouts worker

Visit http://localhost:8000/docs for the interactive API.

Contributing

Pre-commit is configured to lint and format all code:

uv sync
pre-commit install
pre-commit run --all-files

Use Conventional Commits in pull request titles (squash merges). That drives Semantic Versioning and the changelog via semantic-release. See the Contributing guide for types, scopes, and best practices.

Architecture

Cloud Infrastructure

architecture-beta
    service internet(internet)[Internet]

    group cloud(cloud)[Cloud IaC]
    group fornax(server)[Fornax Cutouts] in cloud

    service gateway(internet)[Gateway] in cloud
    service load_balancer(server)[Load Balancer] in cloud

    service api(server)[REST API] in fornax
    service worker(server)[Celery Workers] in fornax

    service redis(database)[Redis] in cloud
    service s3(disk)[Storage] in cloud

    internet:R -- L:gateway
    gateway:R -- L:load_balancer
    load_balancer:B -- T:api
    api:B -- T:worker

    junction j1 in cloud
    redis:B -- T:j1

    redis:R -- L:api
    j1:R -- L:worker

    s3:L -- R:worker

User sequence

sequenceDiagram
    actor U as User
    participant R as REST API
    participant C as Cutouts
    participant RD as Redis

    U->>+R: Request cutout
    R->>RD: Add request to queue
    R->>-U: Request Ack + Job ID

    par For each cutout
        RD->>+C: Perform cutout
        C->>-RD: Write results
    end

    loop Poll job status for complete
        U->>+R: Request job status
        RD->>R: .
        R->>-U: .
    end

    U->>+R: Get cutout results
    R->>-U: .

Issues

Report bugs and request features on GitHub Issues.

License

This project is licensed under the terms of the BSD 3-Clause license.

Metadata

Release files for fornax-cutouts 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 fornax-cutouts 0.1.0
File Size Uploaded Provenance
fornax_cutouts-0.1.0.tar.gz 49.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fornax-cutouts 0.1.0
File Interpreter ABI Platform
fornax_cutouts-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 113.7 kB

Release files / fornax_cutouts-0.1.0.tar.gz

Download URL fornax_cutouts-0.1.0.tar.gz
Size 49.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e90e9bf03baea8036abd28709deba65cb1fe5d846ffcfe59766f490539e482e6
BLAKE2b-256 checksum
How to use checksums
1a3b4a0ae7a256dbbdd17acd6b43fa595e49618405ef8129b13bc80b4a7f329a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

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

Download URL fornax_cutouts-0.1.0-py3-none-any.whl
Size 64.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b0dc0ed272c7e0a91c28feb2e0429545c2cde7b1e6291bc0b0ddef7f1b27e6d
BLAKE2b-256 checksum
How to use checksums
f2dc6b7bac81322797980d272c48db84de86362b721bba96885ccd519d6736c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Security for fornax-cutouts 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No 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