Skip to main content

PyXRD

PyXRD is a python implementation of the matrix algorithm for computer modeling of X-ray diffraction (XRD) patterns of disordered lamellar structures. It's goals are to:

  • provide an easy user-interface for end-users
  • provide basic tools for displaying and manipulating XRD patterns
  • produce high-quality (publication-grade) figures
  • make modelling of XRD patterns for mixed-layer clay minerals 'easy'
  • be free and open-source (open box instead of closed box model)

PyXRD was written with the multi-specimen full-profile fitting method in mind. A direct result is the ability to 'share' parameters among similar phases. This allows for instance to have an air-dry and a glycolated illite-smectite share their coherent scattering domain size, but still have different basal spacings and interlayer compositions for the smectite component. Or play with the di/tri-octahedral composition of a chlorite with ease.

Other features are (incomplete list):

  • Import/export several common XRD formats (.RD, .RAW, .CPI, ASCII)
  • Simple background subtraction/addition (linear or custom patterns)
  • Smoothing patterns and adding noise to patterns
  • Peak finding and annotating (markers)
  • Peak stripping and peak area calculation tools
  • Custom line colors, line widths, pattern positions, ...
  • Goniometer settings (wavelengths, geometry settings, ...)
  • Specimen settings (sample length, absorption, ...)
  • Automatic parameter refinement using several algorithms, e.g.:
    • L BFGS B
    • Brute Force
    • Covariation Matrix Adapation Evolutionary Strategy (CMA-ES; using DEAP 1.0)
    • Multiple Particle Swarm Optimization (MPSO; using DEAP 1.0)
    • Particle-swarm CMA-ES (PS-CMA-ES; using DEAP 1.0)
  • Scripting support

DISCLAIMER

PyXRD is still very much work in progress. Currently there is no strict development cycle as it is still a one-man project. This also means little time is going into testing and adding new tests for new features. Most of the codebase therefore remains untested at this point and Things May Break as a result.

If you encounter bugs please:

  • create a new issue or;
  • send me an e-mail

INSTALLATION

As of version 0.5.0 PyXRD (finally) supports standard python packaging, meaning it is available from the Python package index and has become very easy to install for most Python users once the dependencies are installed.

If you're not used to (installing) Python software, see below for specific instructions.

Dependencies

This is what should be present on your system.

  • Python 3.4 or later
  • Setuptools
  • GTK3 and pygobject 3.2 or later
  • cairocffi
  • Numpy 1.11 or later
  • Scipy 1.1 or later
  • Matplotlib 2.2 or later
  • Pyro4 4.41 or later
  • DEAP 1.0 or later

Additionally, to be able to run the unit tests, you'll need to install pyton-mock (>= 1.3.0). To just run PyXRD, you won't need it though.

Windows

PyXRD is developed on Ubuntu Linux, and thus has a number of dependencies which are not native to windows. Because of the difficulties in installing these correctly, from version 0.8 onwards an all-in-one stand alone installer is provided for windows users. Previous installations should not interfere, but it's better to remove them (including python, numpy, scipy and pygtk installed along with pre-v0.8 versions).

You can choose for a local installation or a portable (single-folder) installation. The latter is just a zip-file which can be extracted e.g. onto an usb-drive. The downside is you don't get start menu entries.

The installers are made available here:

https://github.com/mathijs-dumon/PyXRD/releases

After installation there should be a start menu entry available.

If PyXRD does not launch, run cmd.exe (the command prompt), enter the following and send me the output (right-click to copy after selecting):

"C:\Program Files (x86)\PyXRD\bin\python3.exe" -m pyxrd

Linux

It should be as easy as:

python3 -m ensurepip --upgrade
python3 -m pip install pyxrd

To run PyXRD:

python3 -m pyxrd

Mac OS X

Currently no support is given for iOS. If anyone is interested in getting this to work feel free to contact me.

CREDITS

  • xylib - Has been a great help at unravelling some common XRD formats

Metadata

Release files for PyXRD 0.8.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyXRD 0.8.4
File Size Uploaded
PyXRD-0.8.4.linux-x86_64.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyXRD 0.8.4
File Interpreter ABI Platform
PyXRD-0.8.4-py3-none-any.whl Python 3 none any Details

Total release size: 2.2 MB

Release files / PyXRD-0.8.4.linux-x86_64.tar.gz

Download URL PyXRD-0.8.4.linux-x86_64.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
31b0476fd5f15c2b3fb0ad54f6f1b9c1b642fffd35f7675f56d57c2f4ff99cb2
BLAKE2b-256 checksum
How to use checksums
82df03984961d2af47c41f9d199230f0645f7131ca148e061f9870bf5606edfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

Release files / PyXRD-0.8.4-py3-none-any.whl

Download URL PyXRD-0.8.4-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8a5dd147cccdf87e0ab515d84ded567006ac979401f227cb9154cba405b72c0d
BLAKE2b-256 checksum
How to use checksums
3cfc98fd49a2745ae2d1bee28eef1b3dcb8cf139bc19a357ddd0f578cc8c6b20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.8.4 This release

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

1 release file

0.6.9

4 release files

v0.6.8

4 release files

0.6.7

4 release files

v0.6.6

1 release file

0.6.6

3 release files

0.6.5

3 release files

0.6.4

4 release files

0.6.3

4 release files

0.6.2

4 release files

0.6.1

4 release files

0.6.0

4 release files

0.5.10

4 release files

0.5.9

4 release files

0.5.8

4 release files

0.5.7

4 release files

0.5.6

4 release files

0.5.5

4 release files

0.5.4

3 release files

0.5.3

4 release files

0.5.2

4 release files

0.5.1

3 release files

0.5.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page