Skip to main content

DOI Documentation Status Build Status Coverage Status

python-specex

Extract spectra from fits cubes

SETUP

To install the latest stable version of specex, just use pip:

$ pip install specex

Some functionalities are enabled only if some optional packages are installed, these packages can be installed by pip when installing Specex by specifying the desired configuration, for example

$ pip install specex[animations]

will install the packages required to use the command specex-cube-anim, while with the command

$ pip install specex[animations,regions]

you install packages required for animations and region file handling, and

$ pip install specex[advanced]

installs reproject for external weightmap reprojection. To install all the optional dependencies use

$ pip install specex[all]

To install the bleeding edge version, clone the github repository then use pip:

$ git clone 'https://github.com/mauritiusdadd/python-specex.git'
$ cd python-specex
$ pip install .

COMMAND-LINE TOOLS

Specex provides the following CLI entry points:

  • specex: Extract IVOA-compliant 1D FITS spectra from datacubes using a source catalog or region file, with optional spatial weighting, background annulus subtraction (--anulus-size), air/vacuum wavelength detection and header propagation, --from-air/--from-vac overrides, and --to-vac [METHOD] air-to-vacuum conversion (specutils).
  • specex-cubestack: Create 2D white-light images by stacking a datacube over optional wavelength intervals.
  • specex-cutout: Extract spatial cutouts from datacubes, grayscale images, or RGB images using sky/pixel coordinates or region files.
  • specex-smooth: Apply spatial and/or spectral smoothing to datacubes and variance extensions.
  • specex-plot: Plot extracted 1D spectra with optional smoothing, cutouts, and redshifted spectral line overlays.
  • specex-cube-anim: Generate animated GIFs scanning datacube slices around spectral lines.

DOCUMENTATION

To build the documentation, install the requirements and run sphinx:

$ pip install -r docs/requirements.txt
$ sphinx-build -b html docs/ docs/_build/html

The full documentation is also available here: [https://python-specex.readthedocs.io/en/latest/index.html]

ACKNOWLEDGMENTS

If you used this software for your research, please consider to cite the following article

https://doi.org/10.1051/0004-6361/202349060

@ARTICLE{DAddona2024,
  title     = "The powerful lens galaxy cluster {PLCK} G287.0+32.9
               ({$\vartheta$E} $\sim 43$ ′′)",
  author    = "D'Addona, M and Mercurio, A and Rosati, P and Grillo, C and
               Caminha, G and Acebron, A and Angora, G and Bergamini, P and
               Bozza, V and Granata, G and Annunziatella, M and Gargiulo, A and
               Gobat, R and Tozzi, P and Girardi, M and Lombardi, M and
               Meneghetti, M and Schipani, P and Tortorelli, L and Vanzella, E",
  journal   = "Astron. Astrophys.",
  publisher = "EDP Sciences",
  month     =  feb,
  year      =  2024,
}

Metadata

Release files for specex 1.1.1

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

Source distribution (sdist)

Source distribution for specex 1.1.1
File Size Uploaded Provenance Actions
specex-1.1.1.tar.gz 2.4 MB With provenance Details for specex-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for specex 1.1.1
File Interpreter ABI Platform Actions
specex-1.1.1-py3-none-any.whl Python 3 none any Details for specex-1.1.1-py3-none-any.whl

Total release size: 2.5 MB

Release files / specex-1.1.1.tar.gz

Download URL specex-1.1.1.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
d286a607761b4ea0bb8d476a150ef581f9f814aeeb0ef79cb8de32fb6279e6c3
BLAKE2b-256 checksum
How to use checksums
224403d9ac01cb5a84e5029bff39d7a4a2a86031192d9382a91033774ddcca49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / specex-1.1.1-py3-none-any.whl

Download URL specex-1.1.1-py3-none-any.whl
Size 93.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7173aef8f6434ad01c916aff88dc7f6afe57484816cf81235c6c983dfab9e62
BLAKE2b-256 checksum
How to use checksums
8429f6baf35c7de162a3f77050473ece8f849bab668ba50bb7965ba399e4920a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for specex 1.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for specex-1.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

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.

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