xrayutilities
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-2026 Dominik Kriegner dominik.kriegner@gmail.com
Copyright (C) 2009-2013 Eugen Wintersberger eugen.wintersberger@desy.de
Mailing list and issue tracker
To get in touch with us or report an issue please use the mailing list (https://sourceforge.net/p/xrayutilities/mailman/xrayutilities-users/) or the Github issue tracker (https://github.com/dkriegner/xrayutilities/issues). When you want to follow announcements of major changes or new releases its recommended to sign up for the mailing list
Contents
- doc: documentation source files
- examples: directory with example scripts and configurations
- lib/xrayutilities: directory with the sources for the Python package
- src: directory with the C extension for improved performance
- tests: directory with the unittest scripts
- pyproject.toml, meson*: packaging configuration and build files
Installation
xrayutilities can be installed in several ways depending on your operating system and preference.
Installation (pip)
Using the python package manager pip you can install xrayutilities by executing
pip install xrayutilities
Note that on recent Linux distributions
pip install outside of a virtual environment might fail with an
externally-managed-environment error. In this case, it is recommended to
use a virtual environment or one of the other installation methods below.
Installation (Conda)
xrayutilities is available via the conda-forge channel:
conda install -c conda-forge xrayutilities
Installation (Linux system packages)
On Debian-based distributions (Debian, Ubuntu, Mint, ...) xrayutilities is available as a system package:
sudo apt install python3-xrayutilities
Installation (source)
Installing xrayutilities from source is an easy process done by executing
pip install .
By default the installation procedure enables OpenMP support (recommended). It fails if no OpenMP support is available. It can be disabled by using the the following custom meson option for the installation:
pip install . --config-settings=setup-args="-Duse_openmp=disabled"
To allow to proceed with the installation without OpenMP but use it if available use:
pip install . --config-settings=setup-args="-Duse_openmp=auto"
Requirements
The following requirements are needed for installing and using xrayutilities:
- Python (>= 3.10)
- h5py
- scipy (version >= 0.18.0)
- numpy (version >= 2.1.0)
- lmfit (>= 1.0.1)
- odrpack
- matplotlib (optional, version >= 3.1.0)
- mayavi (optional, only used optionally in
Crystal.show_unitcell)
When building from source you also might need:
- C-compiler (with OpenMP support)
- Python dev headers
- meson-python
- pytest (optional - only if you want to run the test environment)
- sphinx (optional - only when you want to build the documentation)
- numpydoc (optional - only when you want to build the documentation)
- latex (optional - only when you want to build the PDF documentation)
- sphinx_rtd_theme (optional - only when you want to build the documentation)
- sphinx-pyproject (optional - only when you want to build the documentation)
- svglib (optional - only when you want to build the pdf 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 (Anaconda, Python(x,y), or WinPython).
Supported Python versions
The table below summarizes the Python versions supported by recent xrayutilities release intervals. For exact packaging details of older releases, refer to the corresponding release tag.
| xrayutilities version | Python support | Notes |
|---|---|---|
| current development | >= 3.10 | Current development and tests target Python 3.10 and newer. NumPy >= 2.1.0 is required. |
| 1.7.8 - 1.7.x | >= 3.7 | NumPy 2 support was added for PyPI wheels in 1.7.8. |
| 1.7.0 - 1.7.7 | >= 3.6 | Python 3.6 became required in 1.7.0 due to f-strings. |
| 1.6.x | Python 3 only | Python 2 code paths were removed in 1.6.0. |
| <= 1.5.4 | Python 2.7 and Python 3 | 1.5.4 was the final Python 2 compatible release. |
The Python package configuration
The following steps should only be necessary when using non-default installation locations to ensure the Python module is found by the Python interpreter. In this case the module is installed under /lib[64]/python?.?/site-packages on Unix systems and /Lib/site-packages on Windows systems.
If you have installed the Python package in a directory unknown to your 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 https://github.com/dkriegner/xrayutilities.git
to clone the git repository. If you would like to have commit rights contact one of the administrators.
Update
If you installed xrayutilities via pip, you can update it by:
pip install -U xrayutilities
If you installed via conda:
conda update xrayutilities
If you installed via apt:
sudo apt update
sudo apt install python3-xrayutilities
If you installed from source, 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 (https://sf.net/projects/xrayutilities) if any code changed during the update you need to reinstall the Python package. Thats easiest achieved by
pip install .
In case you are not certain about the installation location it can be determined by
python -c "import xrayutilities as xu; print(xu.__file__)"
/usr/local/lib64/python3.10/site-packages/xrayutilities/__init__.py
if the output is e.g.: /usr/local/lib64/python3.10/site-packages/xrayutilities/init.py you previously installed xrayutilities in /usr/local, which should be used again as install path. Use ::
pip install --prefix=<path to install directory> .
to install the updated package.
Documentation
Documentation for xrayutilities is found on the webpage https://xrayutilities.sourceforge.io
The API-documentation can also be browsed by
pydoc -p PORT
in any web-browser, after the installation is finished.
Release files for xrayutilities 1.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| xrayutilities-1.8.0.tar.gz | 9.1 MB | Details |
Built distributions (wheels)
Total release size: 179.6 MB
Release files / xrayutilities-1.8.0.tar.gz
| Download URL | xrayutilities-1.8.0.tar.gz |
|---|---|
| Size | 9.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4840d3d746ef7655317eb44d57ec4e99e9792c6ab2b87397ba276e6ea8a9dc18
|
|
BLAKE2b-256 checksum How to use checksums |
2877db5b3f3cb7b22014f0c6107ea80849582e6df46f2e5e671d6738ae978c28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp314-cp314-win_amd64.whl
| Download URL | xrayutilities-1.8.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 8.8 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3f8317e8e0471fc6cfc1dcf36b712f564cfa0e5f72f167d90b296f788d7f5477
|
|
BLAKE2b-256 checksum How to use checksums |
cd4a8d25e20cf6a97826ff8812019c1663fab15829a00bea785aca5b703c8c18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a48420f107d68e03f14809737ba15ea997bc99d7588462b60a3c4c6ef017e98c
|
|
BLAKE2b-256 checksum How to use checksums |
d54bb2aec81019975f90167b704b0244c875a97b0165cc0d45e3edab57b3a62d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | xrayutilities-1.8.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.5 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3938cfbdb6be0f1daa1714fe23c524ec7fb338df06a5b2bd5be315cb51ada1c7
|
|
BLAKE2b-256 checksum How to use checksums |
62629fb771e95f38608943020d5bf4fc17158121728eb6b0837c2c1990353f5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp314-cp314-macosx_10_15_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp314-cp314-macosx_10_15_x86_64.whl |
|---|---|
| Size | 8.5 MB |
| Tags | CPython 3.14 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
c7afcda368bc0db7278dc6558790a25eb4cd2a0698659099866d15bb53989b37
|
|
BLAKE2b-256 checksum How to use checksums |
b61d0c1fc40142f8e611b77ef32e4a08049f1deae5f5071b628ac7925fe54906
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp313-cp313-win_amd64.whl
| Download URL | xrayutilities-1.8.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
401befab47e48ea6b786ee02c880da60b7fd81545c21d59f0b2f9cab5dd6cf5a
|
|
BLAKE2b-256 checksum How to use checksums |
d4a4ae37224e5bfcd39c5f355ad9faace000808944a440a193d2339b3c4abbb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2f9d68d9a33caeb235f8b4dd267a003e74fde40e8db26f6f3e59296fc1d11466
|
|
BLAKE2b-256 checksum How to use checksums |
cff165c0cc10f35d10425ad3305f01e83fd7d69188cb603f3b3a3ce88dffc4a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | xrayutilities-1.8.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.5 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
35dc320c1727d9f6739f62c05ae79b3077cb04deb9cdd1d2c84a22da63057544
|
|
BLAKE2b-256 checksum How to use checksums |
3b6455a59c39b340dce191d64ba2662e95e6fd2041b3621ee86d36a65269e1cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 8.5 MB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
171bfedb59c22e30d70f0a3da4b5ed3a89a9792f387ce76c9878de59b5fd35e6
|
|
BLAKE2b-256 checksum How to use checksums |
4bb0e820a0513a5d3f41c310d85f776941e3cccbb629351a4c128bbf73a459dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp312-cp312-win_amd64.whl
| Download URL | xrayutilities-1.8.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1a9f53079f165988d76889c9e1ec7d17dbeeb7309dc1017cb9dd4337408b8b1a
|
|
BLAKE2b-256 checksum How to use checksums |
7bd965f5391925f03c887630d517af654ac89e321b1d63afcb7f50d6dbbc56fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e4c602ef15dea0f0837891baaa4baa503b67b982a59986f3689a4f2b1f70b7dd
|
|
BLAKE2b-256 checksum How to use checksums |
d8c2f60a6b67505e53907bb657678169780d2f7e43e7fa9eba8e47926318c7d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | xrayutilities-1.8.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.5 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
db687f6694b7baac9d7b695036ff0ac7808cd79f568052d93ae6be43c0624dcb
|
|
BLAKE2b-256 checksum How to use checksums |
35edbdbcccfbbcee572094d3407632a726891b5aac7d46790cdabd583e409615
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 8.5 MB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
0cd4fb00d26efa8c2d19ab5318488789dfec859cc4edff3a65fc03a5c0a3fa63
|
|
BLAKE2b-256 checksum How to use checksums |
68e961863d91ae0a2e55403375d3fc52aae1aad3bfd9cba7f526f0dffdf61d54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp311-cp311-win_amd64.whl
| Download URL | xrayutilities-1.8.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
314ebe801deadbe6c0adc37200660c588aad25088ce6fe57242d0ad7c1bcec22
|
|
BLAKE2b-256 checksum How to use checksums |
d74698a2ca0be4fa7de28399c52b21f74a48ff79682f0c41aa2f561b4b6abce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
758d3f3ea6c70a6c86f8a4f179eb5e956f28a1e20d425a72fd477cc374fa605b
|
|
BLAKE2b-256 checksum How to use checksums |
b2fe0e936326f8c811130644e636d1aadd2e39fb2ba74cb202303d7c8f861c05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | xrayutilities-1.8.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.4 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
600925299b663bb745b70adcf9f786534fcdddc9aaf73be9a2de6d7a5f9acc3c
|
|
BLAKE2b-256 checksum How to use checksums |
36579d411699e90174c9d1899c1e64b2a51f69f8af4828b3de2535d3b5ab4ba4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 8.4 MB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
2272abcfd4387c6060dd6a99d2dca0083deb9db41f7a4e85f2ef07cb4cfc3321
|
|
BLAKE2b-256 checksum How to use checksums |
2998ea3d164c57c1b8937b41e1ea1c523a408d959351e708f0a2252272b69da9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp310-cp310-win_amd64.whl
| Download URL | xrayutilities-1.8.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 8.5 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ab82f1d9d82d1c059296cf966a033d608248f13e18f80c6c8e2a92187ba89326
|
|
BLAKE2b-256 checksum How to use checksums |
1a344bbe003a86d763baf9c9df8314555e7eab15a89e23726b19a9950a7bdfb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 8.6 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
354e7a1e216a1e220a8a2b741d13a6d29c9152dd3130d7825167715097e1a464
|
|
BLAKE2b-256 checksum How to use checksums |
2a658204a3f481bbb2af8f6a4c7ebf98dab09f25aa7ce44b1cc489472c98e794
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | xrayutilities-1.8.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 8.4 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1aab5ca4daeec83f0f37d3581f955ae0c17b01443dee030293efb1162107104f
|
|
BLAKE2b-256 checksum How to use checksums |
4d5ea5f05b4ac1a087dfa8e007513a368fbe8c22fea5d56bacbe7dcfd02e9406
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / xrayutilities-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | xrayutilities-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 8.4 MB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
b9771153f775c6e1615395720f34ba18aa7ff8277f924b9b08973827b422a300
|
|
BLAKE2b-256 checksum How to use checksums |
94671f59a7ea65dd2bde3d5954d053327854c3e9d0de6787349a62b00fc5f538
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|