Skip to main content

imcombiners

(Image + Combiner + Rust(rs)), made for Python.

imcombiners logo

imcombiners combines astronomical image stacks with pixel rejection, normalization, masks, and diagnostics. It supports sigma clipping, a CCD noise model, and IRAF-style rejection rules. Stack reductions and built-in zero/scale statistics skip both NaN and inf.

Documentation: https://ysbach.github.io/imcombiners/ GitHub: https://github.com/ysBach/imcombiners

The Python API supports IRAF IMCOMBINE compatibility modes. Tests and benchmarks compare supported paths against IRAF, Astropy/NumPy, ccdproc, and bottleneck. The image results identify their measured inputs, builds, and settings. Use the recorded environment and reproduction commands when comparing timings.

First Look

The package has four usage modes:

  1. Recommended: Standard Combiner().combine() approach,
  2. CLI-friendly: compact ndcombine() wrapper,
  3. Deep-inspection: Chained Combiner(), and
  4. Advanced: direct kernel calls.

Start with standard Combiner usage for ordinary Python workflows.

import numpy as np
import imcombiners as imc

rng = np.random.default_rng(20250311)
stack = rng.normal(1000, 5, (15, 256, 256)).astype("float32")

cmb = imc.Combiner(stack)
out = cmb.combine(
    "median",  # final stack-combination method
    # 1. Optional pre-rejection threshold masking
    thresholds=(0.0, 65000.0),
    # 2. Optional per-image zero/scale normalization
    zero=None,
    scale="median",
    # 3. Optional pixel rejection before final combination
    rejectors=[
        imc.MinMaxClip(n_min=1, n_max=0.1),
        imc.SigClip(sigma=3.0, maxiters=5),
    ],
    diagnostics=None,  # output-only fast path
)

See docs/quarto/index.qmd for the detailed explanations, API-level guidance, and conventions behind this example.

Features

  • Stack combination: mean, median, lower median, percentiles, sum, min, max, variance, and weighted mean via weight=.
  • 1-D rejection helpers: imcombiners.kernels exposes _1d functions such as sigclip_mask_1d, pclip_1d, and minmax_combine_1d.
  • Pixel rejection: sigma, CCD noise-model, iterative linear, min/max, and IRAF-style percentile clipping. Rejection centers accept mean, median, and lower median (lmedian/lmed).
  • Pipeline helpers: threshold masking, zero/scale normalization, offset padding, masks, diagnostics=None|"simple"|"full", and output-only fast paths.
  • See documentations for details and examples.

Install

For Python projects:

uv add imcombiners

OR

uv pip install .

OR

uv pip install -e .

Source development uses a sibling ../reducers checkout at version 0.4.x. Python requires reducers>=0.4.0.

For Rust crate use:

[dependencies]
imcombiners = { version = "<version>", default-features = false }

The kernel module is available to Rust consumers without Python or NumPy. The library crate is named _core; for example, use _core::kernel::combine::{combine_axis0, CombineKind};. Stack-combination kernels expect contiguous C-order arrays shaped (N, H, W).

The default python Cargo feature enables the Python bindings. The extension-module feature also enables python and is selected automatically by the Maturin configuration.

To build, test, and inspect the Rust-only dependency graph:

cargo build --locked --no-default-features
cargo test --locked --no-default-features
cargo tree --locked --no-default-features --target all

Testing and Benchmarks

uv run --extra test pytest
uv run --extra bench python benchmarks/benchmark_combine.py
uv run --extra bench python benchmarks/benchmark_threads.py

For the saved image and IRAF measurements, see the result index and reproduction commands.

--quick runs the smoke benchmark matrix. Omit it to run the full table that backs the published benchmark documentation.

The test extra includes Matplotlib for the logo test. To use an already active development environment, run uv run --active --no-sync pytest after installing the test dependencies. Set IMC_PERF_TEST=1 to enable the performance checks. Benchmark environment tables report the compiled Rust reducers version and source separately from the installed Python distribution. Missing provenance is reported as unknown; an unavailable extension reports unavailable.

For version tags and automated PyPI/crates.io publishing, see the release procedure.

Building documentation

make docs-build       # Regenerate API pages and render the website.
make docs-tutorials   # Execute and render only the tutorials.

For an existing environment with documentation dependencies installed, set DOCS_PYTHON, for example make docs-build DOCS_PYTHON="uv run --active --no-sync --offline python".

Metadata

Release files for imcombiners 0.1.2

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

Source distribution (sdist)

Source distribution for imcombiners 0.1.2
File Size Uploaded Provenance Actions
imcombiners-0.1.2.tar.gz 67.5 kB Without provenance Details for imcombiners-0.1.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for imcombiners 0.1.2
File Actions
imcombiners-0.1.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for imcombiners-0.1.2-cp310-abi3-win_amd64.whl
imcombiners-0.1.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for imcombiners-0.1.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
imcombiners-0.1.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for imcombiners-0.1.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
imcombiners-0.1.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for imcombiners-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
imcombiners-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for imcombiners-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 2.7 MB

Release files / imcombiners-0.1.2.tar.gz

Download URL imcombiners-0.1.2.tar.gz
Size 67.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fa2eeb52de5bf666b4b1fcc689617a59cd9f32988c50f1faa65888a3445c7574
BLAKE2b-256 checksum
How to use checksums
db35fbd66464ce542d420c1a1d113a7319ec14271762cf7410ec8a1276f3c5c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / imcombiners-0.1.2-cp310-abi3-win_amd64.whl

Download URL imcombiners-0.1.2-cp310-abi3-win_amd64.whl
Size 464.4 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e3db469f521e7a6bcae7eb4e8dca2045e59c46e8916044eaae0c5ccf6a8b9d91
BLAKE2b-256 checksum
How to use checksums
44c81766ac1dd2808dd60bd221085285da04588c76deeb49e081582b5d047b8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / imcombiners-0.1.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL imcombiners-0.1.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 580.9 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
cc47d6f6b73e5462ac3e49eba54a8353acca985fd8446c93400a46e86ef1b40e
BLAKE2b-256 checksum
How to use checksums
fff560fefccb477e39e39f8d5e1ce1b54f9d5349644c0bb7e9234dcc2400f0f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / imcombiners-0.1.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL imcombiners-0.1.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 544.4 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
abad08df15420e147f0a22b59cfeaf4ed87b9ec8bd40e3c32808517a15c7735c
BLAKE2b-256 checksum
How to use checksums
cf4c2330bc5d58aa3088cd84ca71b710627250fd9fec1df067e83c320a108e25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / imcombiners-0.1.2-cp310-abi3-macosx_11_0_arm64.whl

Download URL imcombiners-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
Size 509.1 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cdb6430c29cbe5211e438021654aef4cb263e97eb01acafc88ec0dd2cb80751b
BLAKE2b-256 checksum
How to use checksums
55c0bed6598c42c767d085ea17034ed2c47a1508be341d7f8a019b38d1ee20f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / imcombiners-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl

Download URL imcombiners-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl
Size 541.2 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
30247da6feabfe4a9585e6283151b8f022a451f14453f075f94cfac022923966
BLAKE2b-256 checksum
How to use checksums
70e35a042cc1c7f67e84a1fae5a7fe415754a813c6f302be10eb6e09ff902eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for imcombiners 0.1.2

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.

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

Release history Release notifications | RSS feed

This release

0.1.2 This release

6 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