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

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 [--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:

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:

python setup.py 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=http://proxy.site.org:3128
python setup.py 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 https://github.com/silx-kit/pyFAI.git
cd pyFAI
python setup.py 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

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

python setup.py build build_doc

Dependencies

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

MacOSX

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 setup.py build --force-cython --no-openmp

Windows

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 www.edna-site.org -r requirements_appveyor.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)

  • Valentin Valls (ESRF)

Contributors

  • 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

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.15.0.tar.gz (20.3 MB view details)

Uploaded Source

Built Distributions

pyFAI-0.15.0-cp36-cp36m-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.6m Windows x86-64

pyFAI-0.15.0-cp36-cp36m-manylinux1_x86_64.whl (11.2 MB view details)

Uploaded CPython 3.6m

pyFAI-0.15.0-cp36-cp36m-macosx_10_6_intel.whl (6.7 MB view details)

Uploaded CPython 3.6m macOS 10.6+ intel

pyFAI-0.15.0-cp35-cp35m-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.5m Windows x86-64

pyFAI-0.15.0-cp35-cp35m-manylinux1_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.5m

pyFAI-0.15.0-cp35-cp35m-macosx_10_6_intel.whl (6.8 MB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

pyFAI-0.15.0-cp34-cp34m-manylinux1_x86_64.whl (11.5 MB view details)

Uploaded CPython 3.4m

pyFAI-0.15.0-cp27-cp27mu-manylinux1_x86_64.whl (10.3 MB view details)

Uploaded CPython 2.7mu

pyFAI-0.15.0-cp27-cp27m-win_amd64.whl (3.1 MB view details)

Uploaded CPython 2.7m Windows x86-64

pyFAI-0.15.0-cp27-cp27m-manylinux1_x86_64.whl (10.3 MB view details)

Uploaded CPython 2.7m

pyFAI-0.15.0-cp27-cp27m-macosx_10_7_x86_64.whl (4.4 MB view details)

Uploaded CPython 2.7m macOS 10.7+ x86-64

File details

Details for the file pyFAI-0.15.0.tar.gz.

File metadata

  • Download URL: pyFAI-0.15.0.tar.gz
  • Upload date:
  • Size: 20.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyFAI-0.15.0.tar.gz
Algorithm Hash digest
SHA256 7e12c429c7138410c923ad7fd059bbae8e5a4d10828636fc9ee01d3c0fcce287
MD5 3441811f53e6430acf94c94fb332de8c
BLAKE2b-256 9646edeb6ff386d13001a2da8246c8960c74255324eccd17cbb3c9a9fe769950

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9f893e4e9097515fc25b8cb5da40a87b46206d0fb5d50b763886edab805cf998
MD5 0ce795b7230510b4d1575b58966ec768
BLAKE2b-256 98115d70bc61874c8442392baeed3b57e6c3717e5d660c73d8de26aabbf07c2d

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cd5d222adb117b345f2db734e4cdb5b0fd866a6038346f8d7dec62dffacf9697
MD5 eb72e28c45a59e9ca64ec3bfa157e031
BLAKE2b-256 823e285d138132fd7be007551bdc525a0d316aad094080270e173dad250474b8

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp36-cp36m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 d7583f5521016ec2e8626eaed0b8b382763109a33f9d70b78dcf1e71b24540f3
MD5 c29d3b0a0ccaaef006549dbbf89f3969
BLAKE2b-256 92b274842a60eff27d37602f0e3193eb6191a8733146cc8c671f4c13e5500b03

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 42785db0e96d5266dc788a8b0b682e71ed62f0cbb37ca954a2744223e7e10daa
MD5 e696f1f5df7725e721caeb4856426d9b
BLAKE2b-256 a8814620ef3dc5973b2e7f9062aab6e6f9a9c7fd6a54acaad8a4515af7ba5f48

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1758752f04adb98d7886b21908d9a1ec5bf98bf194194a003e8dc26025c06a52
MD5 4d84e85ac1eee156d2e6d5fbaa03d4de
BLAKE2b-256 9b09b0d8d9e72b66a348536b63bb8593651a04dfd9f37c3b2cb610c81a60deca

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 17f65a0e892a01c9b130e15af588b3c4fb0d71f66ad5f6259f4c85191a8f785c
MD5 18e8d5f35e25e1b88b37fdb6379dcf18
BLAKE2b-256 05094dbf8b9f154b71de82e269384775cffd27c41a2368bf2dc7687b845d9f4e

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c1bff9813f394cb31dcc4f3318ee002bf8e771da39fda5395af5e3d9d143163d
MD5 0f74c31dd7a896f37fa5364854c63c26
BLAKE2b-256 446dd26b94dc4b77676c9bbe752a54aac00e2067342686f9e6d5d99c1b78fed9

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 286880ab22860ad73cabbe28b8c37fccde1fe0ad01de28c8cec318f61889909b
MD5 cbb369ef3cc70759e42c5ebd467d2773
BLAKE2b-256 c6bae4ff2d49365bdef494992e62c87235572c9bcf38bd31408dab204363590f

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 0535be4e3f05924589f4d6a65ef66f6423621706af8094b54f4ce86b613535b7
MD5 6adb1f1f2dc95f0d711310c4437d9d1a
BLAKE2b-256 191f9d5146916b240b7e2cef52ec1862a9fcc2b1493364718dcf5fd13692a813

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 88ab068cea7fcb326550623867e4447974fe4c07b53f7b34ae394e85555274b7
MD5 7a03fdbe8ee0fe179692403b8a6a09d3
BLAKE2b-256 7e0dd51e266c60ec7c9628856935f650a58a89cac3f1aa684f388ba518758461

See more details on using hashes here.

File details

Details for the file pyFAI-0.15.0-cp27-cp27m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pyFAI-0.15.0-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 1e44d86b3a5c6dbbd490bb7ec4a025d87cd5081f971215fad1eb04608c993256
MD5 0f10f5e0c838a16a5d9f904ea317ecb7
BLAKE2b-256 77e012b4f119c545f46155eeb9ecf332ec5da85f4adafa768735af0c699ab524

See more details on using hashes here.

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