skip to navigation
skip to content

pyFAI 0.14.2

Python implementation of fast azimuthal integration

Main development website:

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.


  • The philosophy of pyFAI is described in the proceedings of SRI2012: doi:10.1088/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: (accepted)


With PIP

As most Python packages, pyFAI is available via PIP:

pip install pyFAI [--user]

Provide the –user to perform an installation local to your user. Under UNIX, you may have to run the command via sudo to gain root access an perform a system wide installation.

With conda

pyFAI is also available via conda (for Linux and Mac, currently):

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:


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:

python build test

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:

export http_proxy=
python build test

This is especially true at ESRF, where you will have to phone the hotline (24-24) to get this information or grab it from the intranet.

Finally, install pyFAI computer-wise if you have local root access. This command may request your password to gain root-access:

sudo pip install . --upgrade

If you prefer a local installation (only you will have access to the installed version):

pip install . --upgrade --user

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

git clone
cd pyFAI
python build bdist_wheel
sudo 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 (Chose 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 can be build using this command and Sphinx (installed on your computer):

python build build_doc


Python 2.7, 3.4, 3.5 and 3.6 are well tested. Python 2.6, 3.2 and 3.3 are no more supported since pyFAI 0.12 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:

  • python-numpy
  • python-scipy
  • python-matplotlib
  • python-dev
  • python-fabio
  • python-pyopencl
  • python-pyqt5
  • python-silx
  • python-numexpr

and the same with python3 using apt-get these can be installed as:

sudo apt-get install python-numpy python-scipy python-matplotlib  python-dev python-fabio python-pyopencl python-pyqt5 python-silx python-numexpr
sudo apt-get install python3-numpy python3-scipy python3-matplotlib  python3-dev python3-fabio python3-pyopencl python3-pyqt5 python3-silx python3-numexpr


You are advised to build pyFAI with the GCC compiler, as the compiler provided by Apple with XCode (a derivative of clang) lakes the support of OpenMP. If you use Xcode5 or newer, append the “–no-openmp” option to deactivate multithreading in binary modules. You will also need cython to re-generate the C-files and delete src/histogram.c before running:

pip install cython --user --upgrade
rm pyFAI/ext/histogram.c
python build --force-cython --no-openmp


Under 32 bits windows, pyFAI can be built using The MinGW compiler. Unfortunately, pyFAI will be limited to small images as the memory consumption, limited to 2GB under windows, is easily reached. With 64 bits windows, the Visual Studio C++ compiler is the only one known to work correctly.

Dependencies for windows have been regrouped in our wheelhouse, just use:

pip install --trusted-host -r requirements_appveyor.txt

Getting help

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


  • Jérôme Kieffer (ESRF)
  • 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
File Type Py Version Uploaded on Size
pyFAI-0.14.2-cp27-cp27m-macosx_10_11_intel.whl (md5) Python Wheel cp27 2017-09-14 6MB
pyFAI-0.14.2-cp27-cp27m-macosx_10_7_x86_64.whl (md5) Python Wheel cp27 2017-09-14 4MB
pyFAI-0.14.2-cp27-cp27m-manylinux1_x86_64.whl (md5) Python Wheel cp27 2017-09-14 9MB
pyFAI-0.14.2-cp27-cp27m-win_amd64.whl (md5) Python Wheel cp27 2017-09-14 2MB
pyFAI-0.14.2-cp27-cp27mu-manylinux1_x86_64.whl (md5) Python Wheel cp27 2017-09-14 9MB
pyFAI-0.14.2-cp34-cp34m-manylinux1_x86_64.whl (md5) Python Wheel cp34 2017-09-14 10MB
pyFAI-0.14.2-cp35-cp35m-macosx_10_6_intel.whl (md5) Python Wheel cp35 2017-09-14 6MB
pyFAI-0.14.2-cp35-cp35m-macosx_10_7_x86_64.whl (md5) Python Wheel cp35 2017-09-14 3MB
pyFAI-0.14.2-cp35-cp35m-manylinux1_x86_64.whl (md5) Python Wheel cp35 2017-09-14 10MB
pyFAI-0.14.2-cp35-cp35m-win_amd64.whl (md5) Python Wheel cp35 2017-09-14 2MB
pyFAI-0.14.2-cp36-cp36m-macosx_10_6_intel.whl (md5) Python Wheel cp36 2017-09-14 6MB
pyFAI-0.14.2-cp36-cp36m-macosx_10_7_x86_64.whl (md5) Python Wheel cp36 2017-09-14 3MB
pyFAI-0.14.2-cp36-cp36m-manylinux1_x86_64.whl (md5) Python Wheel cp36 2017-09-14 10MB
pyFAI-0.14.2-cp36-cp36m-win_amd64.whl (md5) Python Wheel cp36 2017-09-14 2MB
pyFAI-0.14.2_src.tar.gz (md5, pgp) Source 2017-09-18 28MB