Skip to main content

Position-Velocity Diagram Extractor

Full docs are available here

Tool to slice through data cubes and extract position-velocity (or other) slices.

There are a few utilities related to header trimming & parsing. Otherwise, there’s one main function, pvextractor, that takes a data cube and a series of points and returns a PV array. It is based on scipy’s map_coordinates.

For an example use case, see [this notebook] (http://nbviewer.ipython.org/urls/raw.github.com/radio-astro-tools/pvextractor/main/examples/IRAS05358Slicing.ipynb) (for a permanent, compiled version, look here)

Minimal Install Instructions

pip install pvextractor

To install the latest development version instead:

pip install https://github.com/ericmandel/pyds9/archive/main.zip
pip install https://github.com/radio-astro-tools/spectral-cube/archive/main.zip
pip install https://github.com/radio-astro-tools/pvextractor/archive/main.zip

The pvextractor GUI

Run it like this:

from pvextractor.gui import PVSlicer
pv = PVSlicer('L1448_13CO.fits')
pv.show()

Click to select “control points” along the path, then press “enter” to expand the width of the slice, then click. Optionally, “y” will show the exact regions extracted.

Using pvextractor in ds9

There is a python script that will be installed along with pvextractor. You can invoke it from the command line, but the preferred approach is to load the tool into ds9. First, determine the path to ds9_pvextract.ans; it is in scripts/ds9_pvextract.ans. Then start up ds9 with the analysis tool loaded

ds9 -analysis load /path/to/pvextractor/scripts/ds9_pvextract.ans  &

Then load any cube in ds9, draw a line, and press ‘x’ or press “PV Extractor” in the menu.

Example DS9 use

Example DS9 use

Build status

Build Status Powered by Astropy Badge

Metadata

Release files for pvextractor 0.5

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

Source distribution (sdist)

Source distribution for pvextractor 0.5
File Size Uploaded Provenance Actions
pvextractor-0.5.tar.gz 1.5 MB With provenance Details for pvextractor-0.5.tar.gz

Built distribution (wheel)

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

Total release size: 1.5 MB

Release files / pvextractor-0.5.tar.gz

Download URL pvextractor-0.5.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
04019430bca5e66af762dd21f230dd292c87c5934a64774912c18da70a071ea2
BLAKE2b-256 checksum
How to use checksums
f7f1b88ee8ffc9bf96edea639203e1c337883145883e31423753916d29ab9eff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 17, 2026.

Transparency log

Release files / pvextractor-0.5-py3-none-any.whl

Download URL pvextractor-0.5-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ded2cb5ba775b63fdfc2fd3d96712f92e65492e6e63bdab908b49ca54b0382be
BLAKE2b-256 checksum
How to use checksums
71e6ba9bc25a645f781e17f3d256cbfedc59ebd5746b9373c9c312c3e35cc514
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 17, 2026.

Transparency log

Security for pvextractor 0.5

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pvextractor-0.5.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 Sep 17, 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