Metadata-Version: 2.4
Name: diffpy.mpdf
Version: 1.0.4.1
Summary: Tools for magnetic PDF analysis.
Author-email: Benjamin Frandsen <benfrandsen@byu.edu>
License: Copyright 2022 BENJAMIN ALLEN FRANDSEN
        
        Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Project-URL: Homepage, https://github.com/FrandsenGroup/diffpy.mpdf
Project-URL: Issues, https://github.com/FrandsenGroup/diffpy.mpdf/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.txt
License-File: AUTHORS.txt
Dynamic: license-file

## 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. Both one-dimensional (powder) and three-dimensional (single crystal) mPDF patterns can be calculated.

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.11 or greater and the following software:

numpy, matplotlib, scipy, diffpy.structure, diffpy.srreal

Recommended software:

Full diffpy.cmi suite, jupyter notebook

Current supported platforms are Linux, Unix, macOS, and Windows.

## Recommended Installation Procedure

#### Step 1: Install diffpy.cmi
Follow the instructions at https://github.com/diffpy/diffpy.cmi. 

#### Step 2: Install diffpy.mpdf with pip
Making sure you are in the correct python environment, run the command:

    >>> pip install diffpy.mpdf

Alternatively, you can install from source by installing diffpy.structure and diffpy.srreal following the instructions on their respective github pages, then 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 correct python environment):

    >>> pip install .

## Documentation and Helpful Examples
Complete documentation is available  at [https://frandsengroup.github.io/diffpy.mpdf/index.html](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](https://github.com/FrandsenGroup/mPDF-tutorial).

You may also check out [https://addie.ornl.gov/simulating_mpdf](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
