pyFAI/README.rst

239 lines
7.6 KiB
ReStructuredText
Raw Normal View History

2014-10-03 03:30:03 +08:00
pyFAI: Fast Azimuthal Integration in Python
===========================================
2012-06-08 03:37:21 +08:00
2016-06-28 20:18:01 +08:00
Main development website: https://github.com/silx-kit/pyFAI
2015-09-04 03:02:25 +08:00
2019-05-15 21:15:08 +08:00
|Build Status| |Appveyor Status| |myBinder Launcher|
2015-09-04 03:02:25 +08:00
2012-09-19 03:59:35 +08:00
pyFAI is an azimuthal integration library that tries to be fast (as fast as C
2014-10-03 03:30:03 +08:00
and even more using OpenCL and GPU).
It is based on histogramming of the 2theta/Q positions of each (center of)
2016-04-12 00:46:19 +08:00
pixel weighted by the intensity of each pixel, but parallel version uses a
2014-10-03 03:56:25 +08:00
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.
2012-06-08 03:43:28 +08:00
2017-05-23 15:18:58 +08:00
References
----------
2014-10-03 03:30:03 +08:00
* 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)
2012-06-08 03:43:28 +08:00
Installation
2015-09-04 03:10:00 +08:00
------------
2014-10-03 03:30:03 +08:00
2017-05-23 15:18:58 +08:00
With PIP
........
2016-04-12 00:46:19 +08:00
As most Python packages, pyFAI is available via PIP::
2016-04-13 16:04:21 +08:00
pip install pyFAI [--user]
2016-04-12 00:46:19 +08:00
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.
2017-05-23 15:18:58 +08:00
With conda
..........
2017-05-23 11:37:43 +08:00
pyFAI is also available via conda (for Linux and Mac, currently)::
conda install pyfai -c conda-forge
To install conda please see either `conda <https://conda.io/docs/install/quick.html>`_ or `Anaconda <https://www.continuum.io/downloads>`_.
2017-05-23 15:18:58 +08:00
From source code
................
2015-11-05 15:01:12 +08:00
The latest release of pyFAI can be downloaded from
2017-05-23 11:37:43 +08:00
`Github <https://github.com/silx-kit/pyFAI/archive/master.zip>`_.
2015-11-05 15:01:12 +08:00
Presently the source code has been distributed as a zip package.
Download it one and unpack it::
2012-06-08 03:43:28 +08:00
2016-04-13 16:07:21 +08:00
unzip pyFAI-master.zip
2015-09-04 03:10:00 +08:00
2015-11-05 15:01:12 +08:00
As developement is also done on Github,
2016-06-28 20:18:01 +08:00
`development branch is also available <https://github.com/silx-kit/pyFAI/archive/master.zip>`_
2015-09-04 03:10:00 +08:00
2015-11-05 15:01:12 +08:00
All files are unpacked into the directory pyFAI-master::
2015-09-04 03:10:00 +08:00
2015-11-05 15:01:12 +08:00
cd pyFAI-master
2014-01-13 17:07:54 +08:00
2015-09-04 03:27:39 +08:00
Build it & test it::
2015-09-04 03:10:00 +08:00
2014-10-03 03:56:25 +08:00
python setup.py build test
2012-06-08 03:43:28 +08:00
2015-09-04 03:02:25 +08:00
For its tests, pyFAI downloads test images from the internet.
Depending on your network connection and your local network configuration,
2015-09-04 03:27:39 +08:00
you may have to setup a proxy configuration like this::
2016-04-12 00:46:19 +08:00
2015-09-04 03:21:38 +08:00
export http_proxy=http://proxy.site.org:3128
2015-07-20 17:38:26 +08:00
python setup.py build test
2015-09-04 03:02:25 +08:00
This is especially true at ESRF, where you will have to phone the hotline
2015-07-20 17:38:26 +08:00
(24-24) to get this information or grab it from the intranet.
2015-09-04 03:02:25 +08:00
Finally, install pyFAI computer-wise if you have local root access.
2015-09-04 03:27:39 +08:00
This command may request your password to gain root-access::
2015-09-04 03:10:00 +08:00
2015-09-04 03:27:39 +08:00
sudo pip install . --upgrade
2012-06-08 03:43:28 +08:00
2015-09-04 03:02:25 +08:00
If you prefer a local installation (only you will have access to the
2015-09-04 03:27:39 +08:00
installed version)::
2015-09-04 03:10:00 +08:00
2016-04-11 23:41:02 +08:00
pip install . --upgrade --user
2012-06-08 03:43:28 +08:00
2015-11-05 15:01:12 +08:00
The newest development version can also be obtained by checking out from the git
2016-04-12 00:46:19 +08:00
repository::
2015-09-04 03:10:00 +08:00
git clone https://github.com/silx-kit/pyFAI.git
2014-10-03 03:56:25 +08:00
cd pyFAI
2015-09-04 03:21:38 +08:00
python setup.py build bdist_wheel
2016-04-11 23:41:02 +08:00
sudo pip install . --upgrade
2012-06-08 03:43:28 +08:00
2015-11-05 15:01:12 +08:00
If you want pyFAI to make use of your graphic card, please install
`pyopencl <http://mathema.tician.de/software/pyopencl>`_
2012-09-19 03:59:35 +08:00
2012-10-23 15:54:32 +08:00
If you are using MS Windows you can also download a binary version packaged as executable
2012-09-19 03:59:35 +08:00
installation files (Chose the one corresponding to your python version).
2012-06-08 03:43:28 +08:00
2014-07-19 20:17:06 +08:00
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 ...
2014-07-19 20:17:06 +08:00
2013-03-23 01:51:06 +08:00
Documentation
-------------
2015-09-04 03:27:39 +08:00
Documentation can be build using this command and Sphinx (installed on your computer)::
2013-03-23 01:51:06 +08:00
2016-04-12 00:46:19 +08:00
python setup.py build build_doc
2013-03-23 01:51:06 +08:00
2012-06-08 03:43:28 +08:00
Dependencies
2015-09-04 03:10:00 +08:00
------------
2012-06-08 03:43:28 +08:00
2018-10-26 17:46:57 +08:00
Python 2.7, 3.4, 3.5, 3.6 and 3.7 are well tested.
2016-04-11 23:41:02 +08:00
Python 2.6, 3.2 and 3.3 are no more supported since pyFAI 0.12
2012-06-08 03:43:28 +08:00
For full functionality of pyFAI the following modules need to be installed.
2019-05-16 15:17:56 +08:00
* ``numpy`` - http://www.numpy.org
* ``scipy`` - http://www.scipy.org
* ``matplotlib`` - http://matplotlib.sourceforge.net/
* ``fabio`` - http://sourceforge.net/projects/fable/files/fabio/
* ``h5py`` - http://www.h5py.org/
* ``pyopencl`` - http://mathema.tician.de/software/pyopencl/
* ``pyqt5`` - http://www.riverbankcomputing.co.uk/software/pyqt/intro
* ``silx`` - http://www.silx.org
* ``numexpr`` - https://github.com/pydata/numexpr
2012-06-08 03:43:28 +08:00
2015-09-04 03:21:38 +08:00
Those dependencies can simply be installed by::
2016-04-12 00:46:19 +08:00
pip install -r requirements.txt
2015-09-04 03:21:38 +08:00
2017-05-23 15:18:58 +08:00
Ubuntu and Debian-like Linux distributions
------------------------------------------
2014-07-19 20:17:06 +08:00
To use pyFAI on Ubuntu/Debian the needed python modules
2016-04-12 00:46:19 +08:00
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
2017-05-15 22:05:10 +08:00
The extra Ubuntu packages needed are:
2012-06-08 03:43:28 +08:00
2019-05-16 15:17:56 +08:00
* ``python-numpy``
* ``python-scipy``
* ``python-matplotlib``
* ``python-dev``
* ``python-fabio``
* ``python-pyopencl``
* ``python-pyqt5``
* ``python-silx``
* ``python-numexpr``
2012-06-08 03:43:28 +08:00
2017-09-14 15:54:21 +08:00
and the same with python3
2015-09-04 03:27:39 +08:00
using apt-get these can be installed as::
2015-09-04 03:10:00 +08:00
2017-09-14 15:54:21 +08:00
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
2014-07-19 20:17:06 +08:00
MacOSX
------
2016-04-12 00:46:19 +08:00
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
2015-11-05 15:01:12 +08:00
in binary modules.
You will also need *cython* to re-generate the C-files and delete *src/histogram.c*
before running::
2016-04-12 00:46:19 +08:00
pip install cython --user --upgrade
rm pyFAI/ext/histogram.c
2017-09-14 15:54:21 +08:00
python setup.py build --force-cython --no-openmp
2015-11-05 15:01:12 +08:00
2014-07-19 20:17:06 +08:00
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
2016-04-12 00:46:19 +08:00
under windows, is easily reached.
2015-11-05 15:01:12 +08:00
With 64 bits windows, the Visual Studio C++ compiler is the only one known to
work correctly.
2012-06-08 03:43:28 +08:00
2015-09-04 03:21:38 +08:00
Dependencies for windows have been regrouped in our wheelhouse, just use::
2016-04-12 00:46:19 +08:00
pip install --trusted-host www.edna-site.org -r requirements_appveyor.txt
2015-09-04 03:21:38 +08:00
2014-10-16 21:12:47 +08:00
Getting help
2015-09-04 03:10:00 +08:00
------------
2014-10-16 21:12:47 +08:00
2014-10-24 04:19:47 +08:00
A mailing-list, pyfai@esrf.fr, is available to get help on the program and how to use it.
2014-10-16 21:12:47 +08:00
One needs to subscribe by sending an email to sympa@esrf.fr with a subject "subscribe pyfai".
2016-06-28 20:18:01 +08:00
Maintainers
-----------
2015-09-04 03:10:00 +08:00
2019-05-16 15:09:43 +08:00
* Jérôme Kieffer (ESRF)
* Valentin Valls (ESRF)
2012-12-06 20:35:04 +08:00
Contributors
2015-09-04 03:10:00 +08:00
------------
2019-05-16 15:09:43 +08:00
* 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)
2014-07-19 20:17:06 +08:00
2017-05-23 15:18:58 +08:00
Indirect contributors (ideas...)
--------------------------------
2015-09-04 03:10:00 +08:00
2019-05-16 15:09:43 +08:00
* Peter Boesecke
* Manuel Sánchez del Río
* Vicente Armando Solé
* Brian Pauw
* Veijo Honkimaki
2015-09-04 03:02:25 +08:00
.. |Build Status| image:: https://travis-ci.org/silx-kit/pyFAI.svg?branch=master
:target: https://travis-ci.org/silx-kit/pyFAI
.. |Appveyor Status| image:: https://ci.appveyor.com/api/projects/status/github/silx-kit/pyfai?svg=true
:target: https://ci.appveyor.com/project/ESRF/pyfai
2019-05-16 00:47:36 +08:00
.. |myBinder Launcher| image:: https://mybinder.org/badge_logo.svg
2019-05-15 21:15:08 +08:00
:target: https://mybinder.org/v2/gh/silx-kit/pyFAI/master?filepath=binder%2Findex.ipynb