Skip to main content

Tools for magnetic PDF analysis.

Project description

diffpy.mpdf

Framework for comprehensive magnetic PDF analysis.

This package aims to provide a convenient method for computing the magnetic PDF (mPDF) from magnetic structures, performing fits to neutron total scattering data, and generating the experimental mPDF signal from magnetic scattering data. The mPDF is calculated by an MPDFcalculator object, which extracts the spin positions and spin vectors from a MagStructure object that the MPDFcalculator takes as input. The MagStructure object in turn can contain multiple MagSpecies objects, which generate magnetic configurations based on a diffpy.Structure object and a set of propagation vectors and basis vectors either provided by the user or read in directly from an MCIF file. Alternatively, the user can manually define a magnetic unit cell that will be used to generate the magnetic structure, or the magnetic structure can be defined simply as lists of spin positions and spin vectors provided by the user. The MPDFtransformer class is used to generate mPDF data from magnetic scattering data.

Please cite: Frandsen et al., "diffpy.mpdf: open-source software for magnetic pair distribution function analysis", J. Appl. Cryst. (2022) 55, 1377-1382. https://doi.org/10.1107/S1600576722007257

Requirements

This package requires Python 3.7 and the following software:

numpy, matplotlib, scipy, diffpy.Structure, diffpy.srreal

Recommended software:

Full diffpy-cmi suite.

Current supported platforms are Linux (64- and 32-bit) and MacOS (64-bit). With some effort, it may also be possible to run the program on Windows using the Linux Subsystem available for Windows 10. Perhaps a better option if you have a Windows PC is to install a virtual machine with a Linux distribution. Here's a useful guide on how to do that for Ubuntu using VirtualBox: https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualbox#1-overview .

Installation

The recommended way to install this package is first to install diffpy-cmi through conda using the Anaconda python distribution, then install diffpy.mpdf using pip. See https://www.anaconda.com/distribution for instructions about installing the Anaconda python distribution. See also https://www.diffpy.org/products/diffpycmi/index.html for the diffpy-cmi installation instructions (reproduced here for convenience).

Step 1 (recommended): Create and activate a conda environment for diffpy + diffpy.mpdf.

>>> conda create --name diffpy python=3.7
>>> conda activate diffpy

Note that you can name the environment anything you choose by passing it a different name after the --name flag in the first command.

Step 2: Install diffpy-cmi through conda.

>>> conda install -c diffpy diffpy-cmi

Make sure you are installing this in the environment you created in the previous step.

Step 3: Install diffpy.mpdf with pip

Making sure you have activated your diffpy environment, run the command:

>>> pip install diffpy.mpdf

Alternatively, you can install from source by cloning or downloading the github repository https://github.com/FrandsenGroup/diffpy.mpdf on your local machine, navigating to the downloaded repository, and running the following command (making sure that you are in the environment you created in Step 1):

>>> python setup.py install

Documentation and Helpful Examples

Complete documentation is available at https://frandsengroup.github.io/diffpy.mpdf/index.html.

Several examples to help you get started with mPDF analysis are available as jupyter notebooks at https://github.com/FrandsenGroup/mPDF-tutorial.

You may also check out https://addie.ornl.gov/simulating_mpdf for a web-based tool to calculate mPDF patterns from magnetic CIF (mCIF) files.

Contributors

Benjamin Frandsen, Parker Hamilton, Jacob Christensen, Eric Stubben, Victor Velasco, Pavol Juhas, Xiaohao Yang, and Simon Billinge.

License

3-Clause BSD License

Project details


Download files

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

Source Distribution

diffpy_mpdf-1.0.4.tar.gz (115.4 kB view details)

Uploaded Source

Built Distribution

diffpy_mpdf-1.0.4-py3-none-any.whl (123.1 kB view details)

Uploaded Python 3

File details

Details for the file diffpy_mpdf-1.0.4.tar.gz.

File metadata

  • Download URL: diffpy_mpdf-1.0.4.tar.gz
  • Upload date:
  • Size: 115.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for diffpy_mpdf-1.0.4.tar.gz
Algorithm Hash digest
SHA256 f316360ba3f1099fb96edbbc99f01e9add21194a7a876b25228cf09f3fb4eb07
MD5 bdfb81733bf685f3278264b055fe3cc7
BLAKE2b-256 103c5e674a9c1e2c79a66e210e89352e876e739b17591d68206fdb4cf984adfd

See more details on using hashes here.

File details

Details for the file diffpy_mpdf-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: diffpy_mpdf-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 123.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for diffpy_mpdf-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ae6d3003bbf6c15349bca534819e97eb6ea07c8337e972a61fbd4c9c89093b8a
MD5 907c512b0c33e9a20134e4f5b633613c
BLAKE2b-256 7962b09fa9ce8b44f8770d1f70e22aafc5cc39147fdd88e61536c2bd78b2827c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page