Combine single-frequency/single-time FITS images into a FITS cube (Rust port of fitscube)
Project description
fitscube-rs
Documentation: Python API, CLI, and algorithm background at fitscube-rs.readthedocs.io; Rust API at docs.rs/fitscube-rs.
A Rust port of the fitscube Python package. Combines single-frequency/single-time FITS images into a FITS cube — building the spectral (or time) axis from the per-image headers, detecting even vs uneven spacing, preserving per-channel beams in a CASA BEAMS table — and extracts individual planes back out.
Note: This is an experiment in LLM-assisted coding with Claude. Do not trust this software as far as you can throw it.
Installation
Python library
pip install fitscube-rs
CLI binary
Requires Rust 1.85+.
cargo install fitscube-rs
Usage
- Python API and quickstart: fitscube-rs.readthedocs.io/en/latest/quickstart.html
- CLI reference: fitscube-rs.readthedocs.io/en/latest/cli.html
- Rust API: docs.rs/fitscube-rs
Development
Install in editable mode:
uv pip install -e .
After changing the Python-facing Rust API in src/python.rs, rebuild with the
stubgen feature (the default build omits _generate_stubs) and regenerate
the type stubs:
uv run maturin develop --features stubgen
uv run --no-sync python -c "from fitscube_rs._fitscube_rs import _generate_stubs; _generate_stubs()"
This overwrites fitscube_rs/_fitscube_rs.pyi from the Rust annotations and docstrings. Commit the result alongside any API changes.
Running tests
Python tests need the compiled extension and the test extra (pytest,
astropy), plus the upstream fitscube
package, which the parity tests validate against. uv sync builds the maturin
extension into .venv, so a plain uvx pytest won't work — it runs in an
isolated env with neither the module nor the deps:
uv sync --extra test # builds the extension + installs test deps
uv pip install fitscube # upstream package, for parity tests
uv run --no-sync pytest
Rust tests run with cargo test:
cargo test
Pre-commit hooks
Formatters and linters run via prek, a fast
drop-in pre-commit reimplementation. The hooks
(.pre-commit-config.yaml) are the same checks CI enforces: ruff lint +
format, ty type checking, cargo fmt, and
cargo clippy.
uv sync --extra dev # installs prek + ty into the venv
uvx prek install # install the git hook (runs on every commit)
uvx prek run --all-files # run all hooks manually
License
fitscube-rs is released under the BSD 3-Clause License.
It is a port of the fitscube Python
package by Alec Thomson (BSD 3-Clause), and validates its output against that
package in the test suite. See
NOTICE.md
for full attributions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fitscube_rs-1.2.1.tar.gz.
File metadata
- Download URL: fitscube_rs-1.2.1.tar.gz
- Upload date:
- Size: 194.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c9d0a49d1cd4c0177b8c22de2bc0fc5d5d46e5e9b85164bf959cebcd2ce1378
|
|
| MD5 |
0a39171b7e5909448f3c9319e44554dc
|
|
| BLAKE2b-256 |
8112556639ebc50ef792fe8b6eabce24a896d23fb4d24ec3224aa7bd9277f0b3
|
Provenance
The following attestation bundles were made for fitscube_rs-1.2.1.tar.gz:
Publisher:
cd.yml on AlecThomson/fitscube-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fitscube_rs-1.2.1.tar.gz -
Subject digest:
4c9d0a49d1cd4c0177b8c22de2bc0fc5d5d46e5e9b85164bf959cebcd2ce1378 - Sigstore transparency entry: 1889617934
- Sigstore integration time:
-
Permalink:
AlecThomson/fitscube-rs@83c160104781c1d185239d2c2dfad4dfe7e2262a -
Branch / Tag:
- Owner: https://github.com/AlecThomson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@83c160104781c1d185239d2c2dfad4dfe7e2262a -
Trigger Event:
release
-
Statement type:
File details
Details for the file fitscube_rs-1.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: fitscube_rs-1.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e1430a597681928308d2432fc0b7db94ab2868426857bf7637f8c35b0f4d6c2
|
|
| MD5 |
eb8ee6ec1b29aa437ccc20833e1ba6a4
|
|
| BLAKE2b-256 |
84a850d5be2e79c30911dd7aac136c8305295d4bd0dbe96d736e3345ff1841dc
|
Provenance
The following attestation bundles were made for fitscube_rs-1.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
cd.yml on AlecThomson/fitscube-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fitscube_rs-1.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
1e1430a597681928308d2432fc0b7db94ab2868426857bf7637f8c35b0f4d6c2 - Sigstore transparency entry: 1889618144
- Sigstore integration time:
-
Permalink:
AlecThomson/fitscube-rs@83c160104781c1d185239d2c2dfad4dfe7e2262a -
Branch / Tag:
- Owner: https://github.com/AlecThomson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@83c160104781c1d185239d2c2dfad4dfe7e2262a -
Trigger Event:
release
-
Statement type:
File details
Details for the file fitscube_rs-1.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: fitscube_rs-1.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22ab08078eb5e6ff79c2de817b4b019dcbc3d4006ca5dbc7ce6a0db59577b4dc
|
|
| MD5 |
5dd9c974378f422c37b79701af0ada0a
|
|
| BLAKE2b-256 |
78233a1cec85e669b777910438ffc31b5b4a846c7dd8a655aa96fa7f64ee7116
|
Provenance
The following attestation bundles were made for fitscube_rs-1.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
cd.yml on AlecThomson/fitscube-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fitscube_rs-1.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
22ab08078eb5e6ff79c2de817b4b019dcbc3d4006ca5dbc7ce6a0db59577b4dc - Sigstore transparency entry: 1889618282
- Sigstore integration time:
-
Permalink:
AlecThomson/fitscube-rs@83c160104781c1d185239d2c2dfad4dfe7e2262a -
Branch / Tag:
- Owner: https://github.com/AlecThomson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@83c160104781c1d185239d2c2dfad4dfe7e2262a -
Trigger Event:
release
-
Statement type:
File details
Details for the file fitscube_rs-1.2.1-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: fitscube_rs-1.2.1-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 995.2 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22e26b438fa944a98100e3fda896a9656e3342cdb658ffc98a1883857367fe16
|
|
| MD5 |
5b9ec469c97918a6cc1c255ac619c906
|
|
| BLAKE2b-256 |
bc1ff641e2f8056628fe36cacaebd97b464f5f7a6247804c10bb923500124393
|
Provenance
The following attestation bundles were made for fitscube_rs-1.2.1-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
cd.yml on AlecThomson/fitscube-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fitscube_rs-1.2.1-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
22e26b438fa944a98100e3fda896a9656e3342cdb658ffc98a1883857367fe16 - Sigstore transparency entry: 1889618004
- Sigstore integration time:
-
Permalink:
AlecThomson/fitscube-rs@83c160104781c1d185239d2c2dfad4dfe7e2262a -
Branch / Tag:
- Owner: https://github.com/AlecThomson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@83c160104781c1d185239d2c2dfad4dfe7e2262a -
Trigger Event:
release
-
Statement type: