Skip to main content

package for x-ray diffraction data evaluation

Project description

xrayutilities is a collection of scripts used to analyze x-ray diffraction data. It consists of a python package and several routines coded in C. It especially useful for the reciprocal space conversion of diffraction data taken with linear and area detectors.

Copyright (C) 2009-2013 Dominik Kriegner <>

Copyright (C) 2009-2013 Eugen Wintersberger <>


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


Installing xrayutilities 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 use –without-openmp option for the installation

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

For the installation the following requirements need to be installed on your system

  • Python
  • C-compiler (preferential with OpenMP support)
  • HDF5
  • pytables
  • scipy
  • numpy
  • matplotlib (optionally)

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)).

On Microsoft Windows with python(x,y) it is furthermore necessary to manually specify the C compiler used for building the extension modules using

$> python build -c mingw32

before the installation can be performed as described above.

Installation for Python-3.X

The current developement is still focues mainly on Python-2.7, however xrayutilies can be used with Python-3.X versions when the 2to3 tool is used to patch the Python sources. We suggest to use

$> 2to3 -p xrayutilities >> xrayutilities-python3.patch

to create the necessary patch. or

$> 2to3 -p -w xrayutilities

to change the source tree directly for use with Python3.X.

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 git:// xrayutilities

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.


Documention 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.

To build the PDF documentation from the docu-sources use:

python build_doc -b latex cd build/sphinx/latex; make

You will need sphinx and pdflatex including latex-recommended, latex-extra and fonts-recommended.

Or generate a texinfo file using

python build_doc -b texinfo cd build/sphinx/texinfo; make


create a tarball for redistribution of xrayutilities without the use of git

$> python sdist

creates a tarball in the directory dist, which contains everything needed for the installation of xrayutilities

Project details

Release history Release notifications

History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
xrayutilities-1.0.6.tar.gz (8.6 MB) Copy SHA256 hash SHA256 Source None Apr 15, 2014
xrayutilities-1.0.6.win32-py2.7.exe (5.4 MB) Copy SHA256 hash SHA256 Windows Installer 2.7 Apr 15, 2014 (5.4 MB) Copy SHA256 hash SHA256 Windows Installer 2.7 Apr 16, 2014

Supported by

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