Skip to main content

A data reduction package for echelle spectrographs

Project description

CI Documentation Status Python 3.13+

What's new?

Version 0.9 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

This version

0.9

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.9.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.9-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.9-cp314-cp314-macosx_11_0_arm64.whl (4.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

pyreduce_astro-0.9-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.9-cp313-cp313-macosx_11_0_arm64.whl (4.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

pyreduce_astro-0.9-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.9-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.9.tar.gz.

File metadata

  • Download URL: pyreduce_astro-0.9.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.9.tar.gz
Algorithm Hash digest
SHA256 12173697c66538882829fce320dbebec1a93995bb658fbe1a5197bcd651ab3f3
MD5 88fd2af0bb56503987fab1a2b9132ca2
BLAKE2b-256 65873ee05fa9d96f43a4f65909a66fbbef04990cb23bfa751dbf57de0bb21cca

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9.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.9-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.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f6e040972db7407a8b97758510c70c62c1ffd3a5026839e70671aa5000a8f256
MD5 3c30bb3d9424896103a51f085fe092f8
BLAKE2b-256 aa55f3e8e56cce7235d4eba87cff3e3dba5456d00a90912852b5ddbcbf6f009b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9-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.9-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04e46b833caeb1e6a74af58f70003198259c9bc9132eab381834bd2123af7195
MD5 e1d945a5c19a54f6d70bb1ff7380be2e
BLAKE2b-256 2bb6410fb292796f810e3df1b45b83e962fa8096791cf9bdc663cb2cc8f141d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9-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.9-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.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 695a67e2053b975ed548126f2be33729022a7fa82442f52540e05744f0bb378d
MD5 b69f8a291b86ff9138246d935aa8a51b
BLAKE2b-256 63e046736d88a20313fbec8757e3cbad4165ce33573afafcdc6a66eebd4cccb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9-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.9-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 761c159fd86c01e4317d6673cc97e9147bf003d64cf9f47f2a9c73ea37b45eef
MD5 1f0051f541350370775253eb2fafa669
BLAKE2b-256 a48537aa58e499fd82a0a0356e0d359ce3cbef69b145be2cbc6e2cac10bc7c59

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9-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.9-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.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dc02f0057aa11f9d13ad7ecc8ef59fdd46a7770943cdd9ac61927933d82c55dc
MD5 1a8d0f493fa110d77142a24b4c9a33a3
BLAKE2b-256 9b533b0b01e16eca2403a1d8ca820686d07f7723ceb75b62f55fb91917773c45

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9-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.9-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyreduce_astro-0.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3729ed5b7c35f48be5274e6d624e9dd9d5e8da80a8654d16f8034f6dd3a04d7
MD5 53fd79e3ee0d9a1aa37423763eacb487
BLAKE2b-256 1bf641181ad6243d2ab8ff58449c78dc073a8d57b3d5c50e1a17c89599545e23

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyreduce_astro-0.9-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