Atomic Structure Analysis in Python with DiffPy project

DiffPy is a free and open source library of Python software modules targeted at the study of atomic structure of materials and analysis of diffraction data. The project contains DiffPy-CMI Complex Modeling framework or storage and manipulation of structure data and calculation of structure-based quantities.

DiffPy - Atomic Structure Analysis in PythonDiffPy is a free and open source library of Python software modules targeted at the study of atomic structure of materials and analysis of diffraction data. Most DiffPy modules were developed by the diffraction part of the DANSE project. DANSE is a NSF-funded software construction project that develops data analysis tools for neutron scattering experiments. At the moment DiffPy is centered at Brookhaven National Laboratory, a US Department of Energy, Office of Basic Energy Sciences funded laboratory.


DiffPy contains the first public release of DiffPy Complex Modeling framework. It is still under the intense development, authors promise that scope and documentation of the project will be developed quickly.

DiffPy-CMI is open source and free to use. It is a modular software framework for:

  • robust and extensible modeling of nanostructures in crystals, nanomaterials, and amorphous materials;
  • storage and manipulation of structure data;
  • complex modeling and atomic structure optimization;
  • calculation of structure-based quantities, such as pair distribution functions (PDFs), small angle scattering (SAS) data, bond valence sums, atom overlaps, bond lengths, coordinations, and more.

All of the above functionality is provided by the DiffPy-CMI module set of extremely flexible Python frameworks and fitting structure models programs. For example, SrFit is a complex modeling framework for combining multiple experimental inputs in a single optimization problem.

PDFfit2 and PDFgui

The DiffPy library has been used to build two end-user applications for the work with pair distribution functions. The first of them is PDFfit2 - a program for real space structure refinement to atomic PDF from crystal structure model. PDFfit2 has command-line application and launches Python interactive session with several preloaded libraries and functions.

Though this program is suitable for interactive use, some scripts require fair Python knowledge. So those who do not have the expertise or necessity for command line analysis can use PDFgui. It is a graphical interface built on PDFfit2 calculation engine. Due to its PDF fitting and structure visualization capabilities PDFgui is incorporated in the powerful end-to-end x-ray PDF analysis package xPDFsuite.

Interested in more?

The DiffPy library is a modular collection of packages that are mainly concerned with real-space structure analysis from atomic pair distribution function data. To get more information on DiffPy project visit its website or browse through the source code on Github.

Connect with our experts Let's talk