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.

Other features are (incomplete):

- 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)
- 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)
- Multiple Particle Swarm Optimization (MPSO; using DEAP)
- scripting support

INSTALLATION
============

As of version 0.5.0 PyXRD (finally) supports standard python packaging, meaning
it is available from the [Python package index](https://pypi.python.org/pypi)
and has become very easy to install for most Python users.

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 2.7.4 (other version may also work, or may not)
* PyGTK 2.24.2 or later
* Numpy 1.7.0 or later
* Scipy 0.11.0 or later
* Matplotlib 1.2.1 or later
* PyParsing 1.5.7 or later
* (optional) DEAP 0.9.1 or later

Windows
-------

There are numereous ways to install python 'packages' or software. If you're a
first-time Python user and don't really care about what way it is installed,
just download and install these, in the order given:

1. [Python 2.7.4](http://www.python.org/ftp/python/2.7.4/python-2.7.4.msi)
2. [PyGTK 2.24.2](http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/pygtk-all-in-one-2.24.2.win32-py2.7.msi)
3. [Numpy 1.7.0](http://sourceforge.net/projects/numpy/files/NumPy/1.7.0/numpy-1.7.0-win32-superpack-python2.7.exe/download)
4. [Scipy 0.11.0](http://sourceforge.net/projects/scipy/files/scipy/0.11.0/scipy-0.11.0-win32-superpack-python2.7.exe/download)
5. [Matplotlib 1.2.1](https://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.2.1/matplotlib-1.2.1.win32-py2.7.exe)
6. [PyParsing 1.5.7](http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-1.5.7/pyparsing-1.5.7.win32-py2.7.exe/download)
7. [PyXRD](https://github.com/mathijs-dumon/PyXRD/releases)

At this point you should have a working version of PyXRD installed (with a desktop shortcut).

If you want to use the evolutionary algorithms for parameter refinement, you'll
need to install DEAP as well. There is currently no windows installer available
for DEAP, so you'll need to instruct Python to fetch it from the Python package index:

* Open a command line (Start button -> Search -> enter 'cmd.exe' -> press enter)
* Type in the following command (no quotes):
```
easy_install deap
```
* If all went well you should have the latest version of DEAP installed now.

Linux
-----

You'll need a working version of Python 2.7 and then install all the other
dependencies. PyGTK is currently not easily installable from the Python package
index, as it needs to be compiled manually (it's a binding to the GTK libs after all...).

So install these two packages from your systems package manager, terminal commands
are given below to achieve that, but you can use your systems package manager
if you like that better:

* Debian/Ubuntu/...:
```sudo apt-get install python python-gtk2```
* Fedora/Red Hat/... (not tested, gime some feedback if this works!):
```sudo yum install python python-gtk```
* OpenSuSE (not tested, gime some feedback if this works!):
```sudo zypper install python python-gtk```

Once this has been completed, keep the terminal open and issue these commands:

```
sudo easy_install pip
pip install --user 'pyxrd>=0.5.0'
```

This will install everyting under your '~/.local' folder.

To run PyXRD type in the following:

```
~/.local/bin/PyXRD
```

Mac OS X
--------

Currently no support is given for Mac's. The main problem is getting PyGTK
to work under Mac. There has been some succes using MacPorts and the like (from
what I can read & tell online), but your milage may vary, and I recommend novice
users to switch to either a Windows or Linux PC.

CREDITS
=======

- [xylib](http://github.com/wojdyr/xylib/) - Has been a great help at unravelling some common XRD formats

Release files for PyXRD 0.5.1

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.5.1
File Size Uploaded
PyXRD-0.5.1.zip 1.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for PyXRD 0.5.1
File Interpreter ABI Platform
PyXRD-0.5.1.win32-py2.7.exe Details
PyXRD-0.5.1-py2.7.egg Legacy Egg format - - Details

Total release size: 3.7 MB

Release files / PyXRD-0.5.1.zip

Download URL PyXRD-0.5.1.zip
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
1f2d279e224097af24df930fafe4c3791f2ecd5de50ab2efc06ddfd8752ad623
BLAKE2b-256 checksum
How to use checksums
84afedf752a7f3b51b13a9f0bfd3ede07ac7821a37ab611b66c072795843f4a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PyXRD-0.5.1.win32-py2.7.exe

Download URL PyXRD-0.5.1.win32-py2.7.exe
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
582ab47575522893e787f2be4c84e2de663f469d975b92a0ee2493eb632c49c5
BLAKE2b-256 checksum
How to use checksums
92e36e7fcae651c4159ca6d02607c78bf412c5a98b0190ae71783ba63471dc98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / PyXRD-0.5.1-py2.7.egg

Download URL PyXRD-0.5.1-py2.7.egg
Size 1.5 MB
Tags Egg
SHA-256 checksum
How to use checksums
f3b90625d03417f2985958aa601acbd5591e775a3710ea24c424e8cb01156b22
BLAKE2b-256 checksum
How to use checksums
441e41a57f6a399c1f1f8e1c3d44273e2c8ee17f6702a59e42ed97194e6d0f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.8.4

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

This release

0.5.1 This release

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