Skip to main content

A data reduction package for echelle spectrographs

Project description

CI Documentation Status Python 3.13+

What's new?

Version 0.9b3 adds two pure-Python extraction backends, so PyReduce can run without a compiled C extension, and replaces PYREDUCE_USE_CHARSLIT with PYREDUCE_EXTRACTION (c, charslit, numba, numpy). See CHANGELOG.md for all changes.

PyReduce

A data reduction pipeline for echelle spectrographs (HARPS, UVES, XSHOOTER, CRIRES+, JWST/NIRISS, ANDES, MOSAIC, NEID, and more).

Based on the REDUCE package. See the papers:

Installation

# Using uv (recommended)
uv add pyreduce-astro

# Or pip
pip install pyreduce-astro

For development:

git clone https://github.com/ivh/PyReduce
cd PyReduce
uv sync
uv run reduce-build

No wheel for your platform, or the C extension won't build?

Extraction also runs in pure Python. Set PYREDUCE_EXTRACTION=numpy (or pass --extraction numpy) and nothing needs compiling — numpy and scipy are already core dependencies:

PYREDUCE_EXTRACTION=numpy uv run reduce run UVES -t HD132205

It is ~2x slower than the C extension and produces bit-identical output files. PYREDUCE_EXTRACTION=numba is ~1.5-1.8x with uv sync --extra numba installed. See Extraction Backends.

Quick Start

# Download sample data
uv run reduce download UVES

# Run reduction
uv run reduce run UVES -t HD132205 --steps bias,flat,trace,science

# Or run individual steps
uv run reduce bias UVES -t HD132205
uv run reduce flat UVES -t HD132205

Or use the Python API:

from pyreduce.pipeline import Pipeline

Pipeline.from_instrument(
    instrument="UVES",
    target="HD132205",
    night="2010-04-01",
    channel="middle",
    steps=("bias", "flat", "trace", "science"),
).run()

Plotting

Control plotting with environment variables:

# Save plots to files (headless/CI)
PYREDUCE_PLOT=1 PYREDUCE_PLOT_DIR=/tmp/plots PYREDUCE_PLOT_SHOW=off uv run reduce run ...

# Show all plots at end (browser via webagg)
MPLBACKEND=webagg PYREDUCE_PLOT=1 PYREDUCE_PLOT_SHOW=defer uv run reduce run ...

See How To for details.

Documentation

Full documentation at ReadTheDocs.

Output

PyReduce creates .fits files (standard FITS with binary table extension). Headers include original keywords plus PyReduce-specific ones prefixed with e_.

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

pyreduce_astro-0.9b3.tar.gz (4.4 MB view details)

Uploaded Source

Built Distributions

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

pyreduce_astro-0.9b3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyreduce_astro-0.9b3-cp314-cp314-macosx_11_0_arm64.whl (4.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyreduce_astro-0.9b3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyreduce_astro-0.9b3-cp313-cp313-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyreduce_astro-0.9b3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

pyreduce_astro-0.9b3-cp312-cp312-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file pyreduce_astro-0.9b3.tar.gz.

File metadata

  • Download URL: pyreduce_astro-0.9b3.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyreduce_astro-0.9b3.tar.gz
Algorithm Hash digest
SHA256 8a409b1b8443f0ea534e060475e1d6afc844612443ea62d55ef755b1b5502565
MD5 6cc2cfb33634f4f59804aff4ede77cf3
BLAKE2b-256 7d5fe9444e12cdbd8ddedca85996dbcebe0f89f0fb52f6ff453408302de899d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9b3.tar.gz:

Publisher: python-publish.yml on ivh/PyReduce

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

File details

Details for the file pyreduce_astro-0.9b3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9b3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9bdb911f6ae598e47db76d97a47740cf056821f230b86d7078b013dd194822b8
MD5 69e3ccc728005aef6d601d342ed82694
BLAKE2b-256 c765a77e29c082c73d22ca8f016675078626d151667bace52823c60288602016

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9b3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on ivh/PyReduce

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

File details

Details for the file pyreduce_astro-0.9b3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9b3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4c5e5370c7fc19382c06fe9e2a7b1372035956db33a6381bef8a48f732f25bd
MD5 e0b87a6df6d4413a0a9de252d3361044
BLAKE2b-256 fcb0c5b66749a127b3aeb9117875cb42f66f99da50bb4ef95e9b80192000c351

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9b3-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on ivh/PyReduce

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

File details

Details for the file pyreduce_astro-0.9b3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9b3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 064196d6025b4f333d6b2fc6b315633a2e167c452c57df23980ebacad9b97cd9
MD5 ac5cd48504b7e54b9e6e823f18d1eec2
BLAKE2b-256 bc34d95f884b2f98d5e6653047a7ca82c662e7975a8ef8867ffdf5bb621d4155

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9b3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on ivh/PyReduce

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

File details

Details for the file pyreduce_astro-0.9b3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9b3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ab3c5a8c7adbd5c6da0c159f475f6e07084b72ed2dbc8959cd992c33016bdff3
MD5 fccf6a71ae413ee24e7411f7006b2726
BLAKE2b-256 8f56a4aebc0e4f1534e9946e881f934fe9b35b11b42c23aaf1f2a4366834f057

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9b3-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on ivh/PyReduce

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

File details

Details for the file pyreduce_astro-0.9b3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9b3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ebc7f86807ede6f2fc1667ab642fd0968514b8cc770336480e61ec9f79168fb9
MD5 e1a770c4d0416b545b95c91990f54e04
BLAKE2b-256 f524d50083f59af0fd35617ced192bb84c93b942a78f60cb7d3585841ada3f73

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9b3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on ivh/PyReduce

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

File details

Details for the file pyreduce_astro-0.9b3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9b3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2bdff5a4e602afbd6fecbfc5d00b0448c6050c7fa9094c7ddd929090025738de
MD5 e8c474521b16f95113561feda1c4b122
BLAKE2b-256 1a2521c2b7e5d151830a673c70d810dc0c07e828e0d7a2351c34aace5ceb4b51

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9b3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on ivh/PyReduce

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