Skip to main content

Python implementation of fast azimuthal integration

Project description

Main development website: https://github.com/silx-kit/pyFAI

Build Status Appveyor Status myBinder Launcher Documentation Status Zenodo DOI

PyFAI is an azimuthal integration library that tries to be fast (as fast as C and even more using OpenCL and GPU). It is based on histogramming of the 2theta/Q positions of each (center of) pixel weighted by the intensity of each pixel, but parallel version uses a SparseMatrix-DenseVector multiplication. Neighboring output bins get also a contribution of pixels next to the border thanks to pixel splitting. Finally pyFAI provides also tools to calibrate the experimental setup using Debye-Scherrer rings of a reference compound.

References

  • The philosophy of pyFAI is described in the proceedings of SRI2012: doi:10.1088/1742-6596/425/20/202012 http://iopscience.iop.org/1742-6596/425/20/202012/

  • Implementation in parallel is described in the proceedings of EPDIC13: PyFAI: a Python library for high performance azimuthal integration on GPU. doi:10.1017/S0885715613000924

  • Benchmarks and optimization procedure is described in the proceedings of EuroSciPy2014: http://conference.scipy.org/category/euroscipy.html (accepted)

Installation

With PIP

As most Python packages, pyFAI is available via PIP:

pip install pyFAI[gui]

It is advised to run this in a vitural environment. Provide the –user to perform an installation local to your user (not recommended). Under UNIX, you may have to run the command via sudo to gain root access an perform a system wide installation (neither recommended).

With conda

pyFAI is also available via conda:

conda install pyfai -c conda-forge

To install conda please see either conda or Anaconda.

From source code

The latest release of pyFAI can be downloaded from Github. Presently the source code has been distributed as a zip package. Download it one and unpack it:

unzip pyFAI-master.zip

As developement is also done on Github, development branch is also available

All files are unpacked into the directory pyFAI-master:

cd pyFAI-master

Build it & test it:

python3 setup.py build -j 4
python3 run_tests.py

For its tests, pyFAI downloads test images from the internet. Depending on your network connection and your local network configuration, you may have to setup a proxy configuration like this (no more needed at ESRF):

export http_proxy=http://proxy.site.org:3128

Finally, install pyFAI in the virtualenv after testing it:

python3 setup.py bdist_wheel
pip install --upgrade .

The newest development version can also be obtained by checking out from the git repository:

git clone https://github.com/silx-kit/pyFAI.git
cd pyFAI
pip install --upgrade .

If you want pyFAI to make use of your graphic card, please install pyopencl

If you are using MS Windows you can also download a binary version packaged as executable installation files (choose the one corresponding to your python version).

For MacOSX users with MacOS version>10.7, the default compiler switched from gcc to clang and dropped the OpenMP support. Please refer to the installation documentation …

Documentation

Documentation can be build using this command and Sphinx (installed on your computer):

python3 setup.py build build_doc

Dependencies

Python 3.6, … 3.10 are well tested and officially supported. For full functionality of pyFAI the following modules need to be installed.

Those dependencies can simply be installed by:

pip install -r requirements.txt

Ubuntu and Debian-like Linux distributions

To use pyFAI on Ubuntu/Debian the needed python modules can be installed either through the Synaptic Package Manager (found in System -> Administration) or using apt-get on from the command line in a terminal:

sudo apt-get install pyfai

The extra Ubuntu packages needed are:

  • python3-numpy

  • python3-scipy

  • python3-matplotlib

  • python3-dev

  • python3-fabio

  • python3-pyopencl

  • python3-pyqt5

  • python3-silx

  • python3-numexpr

using apt-get these can be installed as:

sudo apt-get build-dep pyfai

MacOSX

One needs to install Python (>=3.6) and Xcode prior to start installing pyFAI. The compiled extension will use only one core due to the limitation of the compiler. OpenCL is hence greately adviced on Apple systems. Then install the missing dependencies with pip:

pip install -r requirements.txt

Windows

Under Windows, one needs to install Python (>=3.6) and the Visual Studio C++ compiler. Then install the missing dependencies with pip:

pip install  -r requirements.txt

Getting help

A mailing-list, pyfai@esrf.fr, is available to get help on the program and how to use it. One needs to subscribe by sending an email to sympa@esrf.fr with a subject “subscribe pyfai”.

Maintainers

  • Jérôme Kieffer (ESRF)

Contributors

  • Valentin Valls (ESRF)

  • Frédéric-Emmanuel Picca (Soleil)

  • Thomas Vincent (ESRF)

  • Dimitris Karkoulis (ESRF)

  • Aurore Deschildre (ESRF)

  • Giannis Ashiotis (ESRF)

  • Zubair Nawaz (Sesame)

  • Jon Wright (ESRF)

  • Amund Hov (ESRF)

  • Dodogerstlin @github

  • Gunthard Benecke (Desy)

  • Gero Flucke (Desy)

Indirect contributors (ideas…)

  • Peter Boesecke

  • Manuel Sánchez del Río

  • Vicente Armando Solé

  • Brian Pauw

  • Veijo Honkimaki

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyFAI-0.21.1.tar.gz (37.3 MB view hashes)

Uploaded Source

Built Distributions

pyFAI-0.21.1-cp310-cp310-win_amd64.whl (4.1 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyFAI-0.21.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyFAI-0.21.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (21.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

pyFAI-0.21.1-cp310-cp310-macosx_10_9_universal2.whl (8.5 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

pyFAI-0.21.1-cp39-cp39-win_amd64.whl (4.0 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyFAI-0.21.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyFAI-0.21.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (21.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ppc64le

pyFAI-0.21.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (16.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pyFAI-0.21.1-cp39-cp39-macosx_10_9_universal2.whl (8.5 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

pyFAI-0.21.1-cp38-cp38-win_amd64.whl (4.0 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyFAI-0.21.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyFAI-0.21.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (22.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ppc64le

pyFAI-0.21.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (17.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pyFAI-0.21.1-cp38-cp38-macosx_11_0_universal2.whl (8.3 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ universal2 (ARM64, x86-64)

pyFAI-0.21.1-cp37-cp37m-win_amd64.whl (3.9 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

pyFAI-0.21.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.7 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pyFAI-0.21.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (20.0 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ppc64le

pyFAI-0.21.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (16.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

pyFAI-0.21.1-cp36-cp36m-win_amd64.whl (4.2 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

pyFAI-0.21.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.8 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

pyFAI-0.21.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (16.7 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

pyFAI-0.21.1-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (16.0 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.5+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page