Skip to main content

Rust port of beamcon from RACS-tools: smooth FITS images and cubes to a common beam via UV-plane (FFT) convolution

Project description

convolve-rs

Docs docs.rs PyPI crates.io

Documentation: Python API, CLI, and algorithm background at convolve-rs.readthedocs.io; Rust API at docs.rs/convolve-rs.

A Rust port of beamcon from RACS-tools. Smooths FITS images and spectral cubes to a common beam using UV-plane (FFT) convolution to avoid numerical issues with undersampled kernels.

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 convolve-rs

CLI binary

Requires Rust 1.85+.

cargo install convolve-rs

Usage

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 convolve_rs._convolve_rs import _generate_stubs; _generate_stubs()"

This overwrites convolve_rs/_convolve_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, radio-beam, astropy). 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 run --no-sync pytest

Rust tests run with cargo test. One integration test compares output against MIRIAD; point MIRIAD_BIN at a MIRIAD bin directory to enable it (it is skipped when unset):

cargo test
MIRIAD_BIN=/path/to/miriad/bin cargo test   # include the MIRIAD comparison

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

convolve-rs is released under the BSD 3-Clause License.

It builds on prior work in the radio-astronomy community: the UV-plane convolution and cube handling are ported from RACS-tools, and the common-beam computation follows radio_beam (both BSD). The Gaussian beam algebra implements the standard formulae of Wild (1970), and MIRIAD (GPL) serves as a validation reference in the test suite. See NOTICE.md for full attributions.

Project details


Download files

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

Source Distribution

convolve_rs-1.1.4.tar.gz (531.4 kB view details)

Uploaded Source

Built Distributions

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

convolve_rs-1.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

convolve_rs-1.1.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (816.8 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

convolve_rs-1.1.4-cp310-abi3-macosx_11_0_arm64.whl (734.4 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file convolve_rs-1.1.4.tar.gz.

File metadata

  • Download URL: convolve_rs-1.1.4.tar.gz
  • Upload date:
  • Size: 531.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for convolve_rs-1.1.4.tar.gz
Algorithm Hash digest
SHA256 984baaf244da38ad04ec6000e26c2dd84c753b81d0f33932a13fd8f4680f2562
MD5 734eff95e68e21f24a3a9d6dffc204da
BLAKE2b-256 7c18efbdc06c4e26d020a5ce5cb407392a2c259df229470e887dd0f283b3056d

See more details on using hashes here.

Provenance

The following attestation bundles were made for convolve_rs-1.1.4.tar.gz:

Publisher: cd.yml on AlecThomson/convolve-rs

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

File details

Details for the file convolve_rs-1.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for convolve_rs-1.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 964deccdaa06fef93590f6a4c880d6840f9022371bc81e7422fc82a005f90e78
MD5 fa2e9d2010744f711327b065c0a514f8
BLAKE2b-256 ff8d35bade956bd9c3ed2dbf267c6d3a8e2b9fd5dc4731ac89dd3be17d84c3a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for convolve_rs-1.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: cd.yml on AlecThomson/convolve-rs

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

File details

Details for the file convolve_rs-1.1.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for convolve_rs-1.1.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5f95c33b14ed1d44348f3739fe1d7ccf81ac40cc65b483dc2ed17a3a81e44390
MD5 9d20271481aa31a23e8e177caee0f12e
BLAKE2b-256 f8f1cfe2d95d670d1ce85bed928d3d5a8cbfb8b849aae175d634891a00a44b69

See more details on using hashes here.

Provenance

The following attestation bundles were made for convolve_rs-1.1.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: cd.yml on AlecThomson/convolve-rs

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

File details

Details for the file convolve_rs-1.1.4-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for convolve_rs-1.1.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 093ae27aeeaf777e6a29dfc8a55884269e3e2106134e54ca08131ea77affcbda
MD5 f9c47bc532ad5c577a0a81a98e1873ce
BLAKE2b-256 733ab804e0070f74567d12e8ea5d323e9267fa9c9371872a158ffd26bc38af9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for convolve_rs-1.1.4-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: cd.yml on AlecThomson/convolve-rs

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page