Skip to main content

package for x-ray diffraction data evaluation

Project description


[![Build Status Travis CI](]( [![Build Status AppVeyor](](

xrayutilities is a collection of scripts used to analyze and simulate x-ray diffraction data. It consists of a Python package and several routines coded in C. For analysis the package is especially useful for the reciprocal space conversion of diffraction data taken with linear and area detectors. For simulations code for X-ray reflectivity, kinematical and dynamical diffraction simulation of crystal truncation rods as well as fundamental parameters powder diffraction is included.

Copyright (C) 2009-2018 Dominik Kriegner <>

Copyright (C) 2009-2013 Eugen Wintersberger <>

Mailing list and issue tracker

To get in touch with us or report an issue please use the mailing list ( or the Github issue tracker ( When you want to follow announcements of major changes or new releases its recommended to [sign up for the mailing list](


  • examples: directory with example scripts and configurations
  • xrayutilities: directory with the sources for the Python package
  • tests: directory with the unittest scripts
  • distutils install script used for the package installation
  • xrayutilities.pdf: pdf-file with documentation of the package

Installation (pip)

Using the python package manager pip you can install xrayutilities by executing

pip install xrayutilities

or for a user installation (without admin access) use

pip install –user xrayutilities

If installation using above’s command fails due to missing OpenMP libraries, use

pip install –global-option=”–without-openmp” xrayutilities

Installation (source)

Installing xrayutilities from source is an easy process done by executing

python install


python install –prefix=<install_path>

in the source folder of xrayutilities on the command line/terminal. The first command installs in the systems default directories, whereas in the second command you can manually specify the installation path.

By default the script tries to use OpenMP. If you do not want to use OpenMP or do not have it available use the –without-openmp option for the installation:

python –without-openmp install –prefix=<install_path>


The following requirements are needed for installing and using xrayutilities:

  • Python (version 2.7 or >= 3.2)
  • C-compiler (preferential with OpenMP support)
  • h5py
  • scipy (version >= 0.13.0)
  • numpy (version >= 1.8)
  • lmfit (optional)
  • matplotlib (optional)
  • python-lzma (optional)

When building from source you also might need:

  • python dev headers
  • setuptools
  • unittest2 (optional - only if you want to run the tests)
  • sphinx (optional - only when you want to build the documentation)
  • numpydoc (optional - only when you want to build the documentation)

refer to your operating system documentation to find out how to install those packages. On Microsoft Windows refer to the Documentation for the easiest way of the installation (Python(x,y) or WinPython).

Python-2.7 and Python-3.X compatibility

The current development focuses on Python-3.X and we ask all users to update to Python-3 if possible, however, xrayutilities can be used with Python-2.7 as well. Care was taken to make this possible from the same code-base.

The Python package configuration

The following steps should only be necessary for user local installation to ensure the Python module is found by the Python interpreter: In this case the module is installed under <prefix>/lib[64]/python?.?/site-packages on Unix systems and <prefix>/Lib/site-packages on Windows systems.

If you have installed the Python package in a directory unknown to your local Python distribution, you have to tell Python where to look for the Package. There are several ways how to do this:

  • add the directory where the package is installed to your PYTHONPATH environment variable.

  • add the path to sys.path in the .pythonrc file placed in your home directory

    import sys sys.path.append(“path to the xrayutilities package”)

  • simply apply the previous method in every script where you want to use the xrayutilities package before importing the package

    import sys sys.path.append(“path to the xrayutilities package”) import xrayutilities

Obtaining the source code

The sources are hosted on sourceforge in git repository. Use

git clone

to clone the git repository. If you would like to have commit rights contact one of the administrators.


if you already installed xrayutilities you can update it by navigating into its source folder and obtain the new sources by

git pull

or download the new tarball from sourceforge ( if any code changed during the update you need to reinstall the Python package. To determine the path in which xrayutilities where installed previously use

python -c “import xrayutilities as xu; print xu.__file__”

if the output is e.g.: /usr/local/lib64/python2.7/site-packages/xrayutilities/ you previously installed xrayutilities in /usr/local, which should be used again as install path. Use

python install --prefix=<path to install directory>

to install the updated package.


Documentation for xrayutilities is found in the xrayutilities.pdf file or on the webpage

The API-documentation can also be browsed by

pydoc -p PORT

in any web-browser, after the installation is finished.

Project details

Download files

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

Files for xrayutilities, version 1.5.2
Filename, size & hash File type Python version Upload date
xrayutilities-1.5.2-cp27-cp27m-win32.whl (3.8 MB) View hashes Wheel cp27
xrayutilities-1.5.2-cp27-cp27m-win_amd64.whl (3.8 MB) View hashes Wheel cp27
xrayutilities-1.5.2-cp35-cp35m-win32.whl (3.8 MB) View hashes Wheel cp35
xrayutilities-1.5.2-cp35-cp35m-win_amd64.whl (3.8 MB) View hashes Wheel cp35
xrayutilities-1.5.2-cp36-cp36m-win32.whl (3.8 MB) View hashes Wheel cp36
xrayutilities-1.5.2-cp36-cp36m-win_amd64.whl (3.8 MB) View hashes Wheel cp36
xrayutilities-1.5.2-cp37-cp37m-win32.whl (3.8 MB) View hashes Wheel cp37
xrayutilities-1.5.2-cp37-cp37m-win_amd64.whl (3.8 MB) View hashes Wheel cp37
xrayutilities-1.5.2.tar.gz (14.8 MB) View hashes Source None
xrayutilities-1.5.2.win32-py2.7.exe (4.0 MB) View hashes Windows Installer 2.7
xrayutilities-1.5.2.win32-py3.5.exe (4.2 MB) View hashes Windows Installer 3.5
xrayutilities-1.5.2.win32-py3.6.exe (4.2 MB) View hashes Windows Installer 3.6
xrayutilities-1.5.2.win32-py3.7.exe (4.2 MB) View hashes Windows Installer 3.7 (4.0 MB) View hashes Windows Installer 2.7 (4.4 MB) View hashes Windows Installer 3.5 (4.4 MB) View hashes Windows Installer 3.6 (4.4 MB) View hashes Windows Installer 3.7

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page