Skip to main content

Note: This readme is best viewed as part of the PyAbel Documentation.

Introduction

PyAbel is a Python package that provides functions for the forward and inverse Abel transforms. The forward Abel transform takes a slice of a cylindrically symmetric 3D object and provides the 2D projection of that object. The inverse Abel transform takes a 2D projection and reconstructs a slice of the cylindrically symmetric 3D distribution.

https://raw.githubusercontent.com/PyAbel/PyAbel/master/doc/overview.svg

Inverse Abel transforms play an important role in analyzing the projections of angle-resolved photoelectron/photoion spectra, plasma plumes, flames, and solar occultation.

PyAbel provides efficient implementations of several Abel transform algorithms, as well as related tools for centering images, symmetrizing images, and calculating properties such as the radial intensity distribution and the anisotropy parameters.

Transform Methods

The outcome of the numerical Abel transform depends on the exact method used. So far, PyAbel includes the following transform methods:

  1. basex – Gaussian basis set expansion of Dribinski and co-workers.

  2. hansenlaw – recursive method of Hansen and Law.

  3. direct – numerical integration of the analytical Abel transform equations.

  4. two_point – the “two point” method of Dasch and co-workers.

  5. three_point – the “three point” method of Dasch and co-workers.

  6. onion_peeling – the “onion peeling” deconvolution method of Dasch and co-workers.

  7. onion_bordas – “onion peeling” or “back projection” method of Bordas et al. based on the MatLab code by Rallis and Wells et al.

  8. linbasex – the 1D-spherical basis set expansion of Gerber et al.

  9. rbasex – a pBasex-like method formulated in terms of radial distributions.

  10. daun – the regularized deconvolution method by Daun and co-workers, with additional capabilities.

Installation

PyAbel requires Python 3.7–3.13. (Note: PyAbel is also currently tested to work with Python 2.7, but Python 2 support will be removed soon.) NumPy and SciPy are also required, and Matplotlib is required to run the examples. If you don’t already have Python, we recommend an “all in one” Python package such as the Anaconda Python Distribution, which is available for free.

The latest release can be installed from PyPI with

pip install PyAbel

If you prefer the development version from GitHub, download it here (clicking the [Code ▾] button), cd to the PyAbel directory, and use

pip install .

Or, if you wish to edit the PyAbel source code without re-installing each time,

pip install -e .

Before uninstalling

Some transform methods can save generated basis sets to disk. If you want to uninstall PyAbel completely, these files need to be removed as well. To do so, please first run the following script:

import abel
import shutil
shutil.rmtree(abel.transform.get_basis_dir())

and then proceed with the usual module uninstallation process (for example, pip uninstall PyAbel if it was installed using pip).

Example of use

Using PyAbel can be simple. The following Python code imports the PyAbel package, generates a sample image, performs a forward transform using the Hansen–Law method, and then an inverse transform using the Three Point method:

import abel
original = abel.tools.analytical.SampleImage(name='Gerber').func
forward_abel = abel.Transform(original, direction='forward',
                              method='hansenlaw').transform
inverse_abel = abel.Transform(forward_abel, direction='inverse',
                              method='three_point').transform

Note: the abel.Transform() class returns a Python class object, where the 2D Abel transform is accessed through the .transform attribute.

The results can then be plotted using Matplotlib:

import matplotlib.pyplot as plt
import numpy as np

fig, axs = plt.subplots(1, 2, figsize=(6, 3))

axs[0].imshow(forward_abel, clim=(0, None), cmap='ocean_r')
axs[1].imshow(inverse_abel, clim=(0, None), cmap='ocean_r')

axs[0].set_title('Forward Abel transform')
axs[1].set_title('Inverse Abel transform')

plt.tight_layout()
plt.show()

Output:

example Abel transform

Documentation

General information about the various Abel transforms available in PyAbel is available at the links above. The complete documentation for all of the methods in PyAbel is hosted at https://pyabel.readthedocs.io.

Conventions

The PyAbel code adheres to the following conventions:

  • Image orientation: The cylindrical symmetry axis in PyAbel is always vertical; if your data is instead symmetric around the horizontal axis, the image must be transposed or rotated by 90° before applying any Abel transform (and then back, to recover the original orientation). PyAbel adopts the “television” convention, where IM[0, 0] refers to the upper left corner of the image. (This means that plt.imshow(IM) should display the image in the proper orientation, without the need to use the origin='lower' keyword.) Image coordinates are in the (row, column) format, consistent with NumPy array indexing, and negative values are interpreted as relative to the end of the corresponding axis. For example, (-1, 0) refers to the lower left corner (last row, 0th column). Cartesian coordinates can also be generated if needed. For example, the x, y grid for a centered 5×5 image:

    x = np.linspace(-2, 2, 5)
    X, Y = np.meshgrid(x, -x)  # notice the minus sign in front of the y coordinate

    The abel.tools.polar.index_coords function does this for images of any shape with any origin.

  • Angle: All angles in PyAbel are measured in radians. When an absolute angle is defined, zero angle corresponds to the upwards vertical direction. Positive values are on the right side, and negative values on the left side. The range of angles is from −π to +π. The polar grid for a centered 5×5 image can be generated (following the code above) using

    R = np.sqrt(X**2 + Y**2)
    THETA = np.arctan2(X, Y)

    where the usual (Y, X) convention of arctan2 has been reversed in order to place zero angle in the vertical direction. Consequently, to convert the angular grid back to the Cartesian grid, we use

    X = R * np.sin(THETA)
    Y = R * np.cos(THETA)

    The abel.tools.polar.cart2polar and abel.tools.polar.polar2cart functions are available for conversion between these Cartesian and polar grids.

  • Image origin: Fundamentally, the forward and inverse Abel transforms in PyAbel consider the origin of the image to be located in the center of a pixel. This means that, for a symmetric image, the image will have a width that is an odd number of pixels. (The central pixel is effectively “shared” between both halves of the image.) In most situations, the image origin is specified using the origin keyword in abel.Transform (or directly using abel.tools.center.center_image to find the origin (the center of symmetry) of your image). This processing step takes care of shifting the origin of the image to the middle of the central pixel. However, if the individual Abel transforms methods are used directly, care must be taken to supply a properly centered image. Some methods also provide low-level functions for transforming only the right half of the image (with the origin located in the middle of a 0th-column pixel).

  • Intensity: The pixel intensities can have any value (within the floating-point range). However, the intensity scale must be linear. Keep in mind that cameras and common image formats often use gamma correction and thus provide data with nonlinear intensity encoding. Thus, if possible, it is recommended to disable the gamma correction on cameras used to record images that will be inverse Abel-transformed. If this is not possible, then it is necessary to apply the appropriate intensity transformations before the analysis. Most PyAbel methods also assume intensities to be floating-point numbers, and when applied to integer types, can return inappropriately rounded results. The abel.Transform class recasts the input image to float64 by default, but if you wish to call the transform methods directly or use other tools, you might need to perform the conversion yourself (as IM.astype(float), for example).

Support

If you have a question about using PyAbel, the best way to contact the PyAbel Developers Team is through GitHub discussions. To report a bug or make a suggestion, please open a new issue.

Contributing

We welcome suggestions for improvement, together with any interesting images that demonstrate application of PyAbel.

Either open a new issue or make a pull request.

CONTRIBUTING.rst has more information on how to contribute, such as how to run the unit tests and how to build the documentation.

License

PyAbel is licensed under the MIT license, so it can be used for pretty much whatever you want! Of course, it is provided “as is” with absolutely no warranty.

Citation

First and foremost, please cite the paper(s) corresponding to the implementation of the Abel transform that you use in your work. The references can be found at the links above.

If you find PyAbel useful in you work, it would bring us great joy if you would cite the project. You can find the DOI for the lastest verison at Zenodo.

https://zenodo.org/badge/30170345.svg

Additionally, we have written a scientific paper comparing various Abel transform methods. You can find the manuscript at the Review of Scientific Instruments (DOI: 10.1063/1.5092635) or on arxiv (arxiv.org/abs/1902.09007).

Have fun!

Metadata

Release files for PyAbel 0.9.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 PyAbel 0.9.1
File Size Uploaded
pyabel-0.9.1.tar.gz 164.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for PyAbel 0.9.1
File
pyabel-0.9.1-cp313-cp313-win_arm64.whl CPython 3.13 CPython 3.13 Windows ARM64 Details
pyabel-0.9.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pyabel-0.9.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
pyabel-0.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
pyabel-0.9.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
pyabel-0.9.1-cp313-cp313-macosx_10_13_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.13+ x86-64 Details
pyabel-0.9.1-cp312-cp312-win_arm64.whl CPython 3.12 CPython 3.12 Windows ARM64 Details
pyabel-0.9.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pyabel-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
pyabel-0.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
pyabel-0.9.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pyabel-0.9.1-cp312-cp312-macosx_10_13_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.13+ x86-64 Details

Total release size: 3.0 MB

Release files / pyabel-0.9.1.tar.gz

Download URL pyabel-0.9.1.tar.gz
Size 164.3 kB
Tags Source
SHA-256 checksum
How to use checksums
59652a2d8474d53523617c8fa442b18e5384c525f1895a3c43eb1261bb2a339c
BLAKE2b-256 checksum
How to use checksums
3994d7b8abe006fd4a2b6bff2ca63e1d11dc164d39e072dc030dc3ebbea252ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp313-cp313-win_arm64.whl

Download URL pyabel-0.9.1-cp313-cp313-win_arm64.whl
Size 214.4 kB
Tags CPython 3.13 Windows ARM64
SHA-256 checksum
How to use checksums
8626e9aae6b5e82e9c8cc982f8b730540d849db6f27a314dc7baa8682a7dc287
BLAKE2b-256 checksum
How to use checksums
181e4e1f3c7439c6b6375491e6a836d260bb599e96d54893eed9ab4a24d27ce9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp313-cp313-win_amd64.whl

Download URL pyabel-0.9.1-cp313-cp313-win_amd64.whl
Size 226.3 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
903a60c66440f0b5a4a57a1f89faa2ddeb47c216893e333f7d0c3afe3242ac17
BLAKE2b-256 checksum
How to use checksums
2d5a3a98e5e2494f4535754557e492fd5924ccbed6be7eb4facf504ea381048c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyabel-0.9.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 251.0 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
005745341f20532fb04a4e6506d324eb6a5bf08db73278fb322b373586e91a98
BLAKE2b-256 checksum
How to use checksums
bb7e8d99629053fb3a935467974b11831cc6d93769c2c7b10b14ee2ca5039c95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pyabel-0.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 246.1 kB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
f4c5e847052e80c11be9c9b8261640c589b5d0376e6a6d86467248fa61be997f
BLAKE2b-256 checksum
How to use checksums
6dc8c003f0c4273c3a049f601241e799855c7b5597a950716a4e78c7ad4d4302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL pyabel-0.9.1-cp313-cp313-macosx_11_0_arm64.whl
Size 229.2 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
82b8bdb367e55f4ae2d046763ad468b24a744767099776182c51a705f4e6e65c
BLAKE2b-256 checksum
How to use checksums
038cef74b0dfbefc9ad0918836f83e57eb663143a1ce9ab9e920f09063d6d356
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp313-cp313-macosx_10_13_x86_64.whl

Download URL pyabel-0.9.1-cp313-cp313-macosx_10_13_x86_64.whl
Size 231.1 kB
Tags CPython 3.13 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
2e2214d026b7b8a51497a48a8114ec9ff6ce62b95e3b8e6fb607ffd6f91987df
BLAKE2b-256 checksum
How to use checksums
9656052c58f58b4b092f5f55ebf242ca942709782a0989e107989b4faae3decf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp312-cp312-win_arm64.whl

Download URL pyabel-0.9.1-cp312-cp312-win_arm64.whl
Size 214.5 kB
Tags CPython 3.12 Windows ARM64
SHA-256 checksum
How to use checksums
187bfb6aea9b19f2a465857b915c075011c12de97a6f4ea2bce6166e6fda8182
BLAKE2b-256 checksum
How to use checksums
4a9f033fc073459493cc75297e9a6932be3081524176aebb985fdcce608bd5df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp312-cp312-win_amd64.whl

Download URL pyabel-0.9.1-cp312-cp312-win_amd64.whl
Size 226.4 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
e550da7d48a2209282e5ea62bd524144d5d5f480db97b9a0b891e1f9337ebc47
BLAKE2b-256 checksum
How to use checksums
ce6717c0d341c2668532816b8984baa80fbe6cf0688865e381c02d57e0787de6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyabel-0.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 252.2 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
46f6c6919b1b9e04e8a146b78da6172c63e8b38d3e4e4a1f9e7b6cf5464ccbf8
BLAKE2b-256 checksum
How to use checksums
6f75c66c3baf90df8d00992957ecad9d83c3da0b9d540ebe89035e5ebe738a13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pyabel-0.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 246.6 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
c513bc4d29e0c3cbe4f725af4276cb573f45d27b50b3fdbbc689366dcc78e92c
BLAKE2b-256 checksum
How to use checksums
254ff2b0dce4c5915f5af1670170f0d262c5b28e8cc9a92dfce8d74230f26ece
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL pyabel-0.9.1-cp312-cp312-macosx_11_0_arm64.whl
Size 230.2 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4af8b6cafcdddae068e998cef3a32121b11bbe9a6b341636a990a52e663a927f
BLAKE2b-256 checksum
How to use checksums
890c7d8809010268d23ab114ba670a0e9992e10519d7cd8ea868eea0169396a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log

Release files / pyabel-0.9.1-cp312-cp312-macosx_10_13_x86_64.whl

Download URL pyabel-0.9.1-cp312-cp312-macosx_10_13_x86_64.whl
Size 232.0 kB
Tags CPython 3.12 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
1b247e205ca438b91d7af76509fed524fd53c4eca0b198522d4be2ecc68895d8
BLAKE2b-256 checksum
How to use checksums
5309c263a431c8f44eadc89417db8c31d5cbc89c30a7218073accc280785a527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 23, 2025.

Transparency log
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