|
| 1 | +########## |
| 2 | +mpdf |
| 3 | +########## |
| 4 | + |
| 5 | +The diffpy.mpdf package provides a convenient method for computing the magnetic PDF |
| 6 | +(mPDF) from magnetic structures and performing fits to neutron total scattering |
| 7 | +data. The mPDF is calculated by an MPDFcalculator object, which extracts the spin |
| 8 | +positions and spin vectors from a MagStructure object that the MPDFcalculator |
| 9 | +takes as input. The MagStructure object in turn can contain multiple MagSpecies |
| 10 | +objects, which generate magnetic configurations based on a diffpy.Structure object |
| 11 | +and a set of propagation vectors and basis vectors provided by the user. |
| 12 | +Alternatively, the user can manually define a magnetic unit cell that will be used |
| 13 | +to generate the magnetic structure, or the magnetic structure can be defined simply |
| 14 | +as lists of spin positions and spin vectors provided by the user. |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +.. figure:: ../images/mpdf_screenshot.png |
| 19 | + :align: center |
| 20 | + |
| 21 | +This is an early release of mpdf, and the capabilities and documentation of the |
| 22 | +project will evolve. The DiffPy team encourages investigators to provide feedback, |
| 23 | +suggestions, and feature requests. |
| 24 | + |
| 25 | + |
| 26 | +Getting Started |
| 27 | +================= |
| 28 | + |
| 29 | +The diffpy.mpdf package requires Python 2.6 or 2.7 and the following software: |
| 30 | + |
| 31 | +* ``NumPy`` - numerical mathematics and fast array operations for Python |
| 32 | +* ``SciPy`` - scientific libraries for Python |
| 33 | +* ``matplotlib`` - python plotting library |
| 34 | +* ``diffpy.Structure`` - diffpy package for generating atomic structure |
| 35 | +* ``diffpy.srreal`` - diffpy package for calculating real-space quantities |
| 36 | + |
| 37 | +See the :doc:`mpdf license <mPDFlicense>` for terms and conditions of use. |
| 38 | + |
| 39 | +Installation |
| 40 | +------------ |
| 41 | + |
| 42 | +The recommended way to install this package is through conda. For help installing conda, |
| 43 | +please visit `https://www.continuum.io/downloads <https://www.continuum.io/downloads>`__. |
| 44 | +Once conda is installed, you can follow the simple steps below to install diffpy.mpdf. |
| 45 | +You will also install the full diffpy-cmi suite along the way. |
| 46 | + |
| 47 | +*Step 1: Add the appropriate conda channels to your conda configuration.* :: |
| 48 | + |
| 49 | + conda config --add channels diffpy |
| 50 | + conda config --add channels benfrandsen |
| 51 | + |
| 52 | +These commands tell conda to look through these channels on the Anaconda cloud server to |
| 53 | +find the appropriate software. |
| 54 | + |
| 55 | +*Step 2 (recommended): Create and activate a conda environment for diffpy + diffpy.mpdf.* :: |
| 56 | + |
| 57 | + conda create --name diffpy python=2.7 |
| 58 | + source activate diffpy |
| 59 | + |
| 60 | +Note that you can name the environment anything you choose by passing it a different name |
| 61 | +after the --name flag in the first command. |
| 62 | + |
| 63 | +*Step 3: Install diffpy.mpdf.* :: |
| 64 | + |
| 65 | + conda install diffpy.mpdf |
| 66 | + |
| 67 | +Note that this will also install the full diffpy-cmi suite if it has not already been |
| 68 | +installed in this environment. |
| 69 | + |
| 70 | +*Alternative option: Install from the python package index.* |
| 71 | + |
| 72 | +If you prefer to use the python package index and have pip installed, please install the |
| 73 | +prerequisite software and then use the command :: |
| 74 | + |
| 75 | + pip install diffpy.mpdf |
| 76 | + |
| 77 | +*Alternative option: Download and install from source.* |
| 78 | + |
| 79 | +If you prefer to install from source, you can also zip and download the entire package |
| 80 | +from `PyPI <https://pypi.python.org/pypi/diffpy.mpdf>`__ or |
| 81 | +`GitHub <https://github.com/benfrandsen/diffpy.mpdf>`__, then unzip the file and |
| 82 | +execute the following command from inside the unzipped directory :: |
| 83 | + |
| 84 | + python setup.py install |
| 85 | + |
| 86 | +Note that this will only work if all the dependencies are already properly installed. |
| 87 | + |
| 88 | +Documentation |
| 89 | +------------- |
| 90 | +Please see `http://pythonhosted.org/diffpy.mpdf/ <http://pythonhosted.org/diffpy.mpdf/>`__ |
| 91 | +for the documentation. |
| 92 | + |
| 93 | +What next? |
| 94 | +============ |
| 95 | + |
| 96 | +Explore the mpdf tutorial and examples on the |
| 97 | +`CMI Exchange <https://github.com/diffpy/cmi_exchange>`_! |
| 98 | + |
| 99 | +.. toctree:: |
| 100 | + :hidden: |
| 101 | + |
| 102 | + mPDFlicense |
0 commit comments