Skip to content

Commit bfb5b17

Browse files
committed
edited and cleaned docs for 1.5.0 release
1 parent f8ace0c commit bfb5b17

File tree

3 files changed

+69
-23
lines changed

3 files changed

+69
-23
lines changed

doc/source/examples.rst

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,23 @@ Files needed:
1414
Example 1: Calculate PDF of FCC nickel
1515
======================================
1616

17-
The first example shows how to calculates the PDF for FCC nickel and saves the resulting data to a file and plot it using matplotlib.
17+
The first example shows how to calculate the PDF for FCC nickel and save the resulting data
18+
to a file and plot it using matplotlib.
1819

19-
1. Imports the PdfFit class from the diffpy.pdffit2 module::
20+
1. Import the ``PdfFit`` class from the ``diffpy.pdffit2`` module
21+
22+
.. code-block:: python
2023
2124
from diffpy.pdffit2 import PdfFit
2225
23-
2. Create a PDF calculator object and assigned to the variable ``P``. Make sure the ``Ni.stru`` file is in the same directory as the script and you've cd to the directory, load structure file. Then allocate and configure PDF calculation and run the calculation::
26+
2. Create a PDF calculator object and assign it to the variable ``P``.
27+
Make sure the ``Ni.stru`` file is in the same directory as the script (or specify
28+
the relative path to where it resides)
29+
and you are currently in this directory. Then use ``read_struct`` to read the structure
30+
file, ``alloc`` to configure the PDF
31+
calculation, and then use ``calc`` to carry out the the calculation.
32+
33+
.. code-block:: python
2434
2535
# create new PDF calculator object
2636
P = PdfFit()
@@ -39,11 +49,15 @@ The first example shows how to calculates the PDF for FCC nickel and saves the r
3949
P.alloc(radiation_type, qmax, qdamp, rmin, rmax, npts)
4050
P.calc()
4151
42-
3. Save the refined result::
52+
3. Save the calculated PDF.
53+
54+
.. code-block:: python
4355
4456
P.save_pdf(1, "Ni_calculation.cgr")
4557
46-
4. We can also plot it using matplotlib::
58+
4. We can also plot it using matplotlib
59+
60+
.. code-block:: python
4761
4862
import matplotlib.pyplot as plt
4963
@@ -59,19 +73,27 @@ The first example shows how to calculates the PDF for FCC nickel and saves the r
5973
# display plot window, this must be the last command in the script
6074
plt.show()
6175
62-
The scripts can be downloaded :download:`here <examples/Ni_calculation.py>`.
76+
The scripts used in this example can be
77+
downloaded :download:`here <examples/Ni_calculation.py>`.
6378

6479
=======================================
6580
Example 2: Performing simple refinement
6681
=======================================
6782

68-
The second example shows how to perform simple refinement of Ni structure to the experimental x-ray PDF. The example uses the same data files as the first example.
83+
The second example shows how to perform a simple refinement of the Ni structure to
84+
the experimental x-ray PDF. The example uses the same data files as the first example.
85+
86+
1. Import the PdfFit class from the diffpy.pdffit2 module
6987

70-
1. Imports the PdfFit class from the diffpy.pdffit2 module::
88+
.. code-block:: python
7189
7290
from diffpy.pdffit2 import PdfFit
7391
74-
2. Create a PDF calculator object and assigned to the variable ``pf``. Load experimental x-ray PDF data and nickel structure file::
92+
2. Create a PDF calculator object and assign it to the variable ``pf``.
93+
Load the experimental x-ray PDF data using ``read_data`` and also load
94+
the nickel structure file.
95+
96+
.. code-block:: python
7597
7698
# Create new PDF calculator object.
7799
pf = PdfFit()
@@ -84,7 +106,13 @@ The second example shows how to perform simple refinement of Ni structure to the
84106
# Load nickel structure, must be in PDFFIT or DISCUS format
85107
pf.read_struct("Ni.stru")
86108
87-
3. Configure refinement and refine::
109+
3. Configure the refinement, assigning structural parameters to variables. For more
110+
information on how to do this correctly, please read the PDFgui documentation.
111+
Set initial values for the variables using ``setpar``.
112+
Finally, you can configure the range over which to refine (``pdfrange``) and
113+
run the refinement (``refine``).
114+
115+
.. code-block:: python
88116
89117
# Refine lattice parameters a, b, c.
90118
# Make them all equal to parameter @1.
@@ -118,13 +146,18 @@ The second example shows how to perform simple refinement of Ni structure to the
118146
pf.pdfrange(1, 1.5, 19.99)
119147
pf.refine()
120148
121-
4. Save the refined result::
149+
4. Save the refined result. ``save_struct`` saves the new, refined, structure to a
150+
``.stru`` format file. ``save_res`` saves the outputs in a structured text file.
151+
152+
.. code-block:: python
122153
123154
pf.save_pdf(1, "Ni_refinement.fgr")
124155
pf.save_struct(1, "Ni_refinement.rstr")
125156
pf.save_res("Ni_refinement.res")
126157
127-
5. We can also plot it using matplotlib::
158+
5. We can also plot it using matplotlib
159+
160+
.. code-block:: python
128161
129162
import matplotlib.pyplot as plt
130163
import numpy
@@ -149,4 +182,4 @@ The second example shows how to perform simple refinement of Ni structure to the
149182
# display plot window, this must be the last command in the script
150183
plt.show()
151184
152-
The scripts can be downloaded :download:`here <examples/Ni_refinement.py>`.
185+
The scripts can be downloaded from :download:`here <examples/Ni_refinement.py>`.

doc/source/index.rst

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ diffpy.pdffit2 - PDFfit2 - real space structure refinement program.
1010
| Last updated |today|.
1111
1212
The diffpy.pdffit2 package provides functions for calculation and
13-
refinement of atomic Pair Distribution Function (PDF) from crystal
14-
structure model. It is used as a computational engine by PDFgui. All
15-
refinements possible in PDFgui can be done with diffpy.pdffit2,
13+
refinement of atomic Pair Distribution Functions (PDF) from crystal
14+
structure models. It is used as a computational engine by PDFgui. All
15+
refinements possible in PDFgui can be done by writing python scripts
16+
directly with diffpy.pdffit2,
1617
although less conveniently and with a fair knowledge of Python.
17-
The package includes an extension for the interactive `IPython
18-
<http://ipython.org>`_ shell, which tries to mimic the old PDFFIT
18+
However, we recommend using `diffpy-cmi
19+
<https://www.diffpy.org/products/diffpycmi/index.html>`_ for carrying
20+
out more advanced, python-scripted refinements of nanosctructre.
21+
22+
The PDFfit2 package includes an extension for the interactive `IPython
23+
<http://ipython.org>`_ shell, these days commonly used within
24+
Jupyter notebooks, which tries to mimic the old PDFFIT
1925
program. To start IPython with this extension and also with plotting
2026
functions enabled, use ::
2127

@@ -30,19 +36,26 @@ statements.
3036
Authors
3137
=======
3238

33-
This code was derived from the first PDFFIT program by Thomas Proffen.
39+
This code was derived from the first `PDFFIT
40+
<https://doi.org/10.1107/S0021889899003532>`_ program written by Thomas Proffen
41+
and Simon Billinge, which was a FORTRAN implementation of the original
42+
"Real-space Rietveld" code
43+
written by Simon Billinge (Billinge, S. J. L. “Real-space Rietveld: full profile structure refinement of the atomic pair distribution
44+
function”. In: Local Structure from Diffraction. Ed. by S. J. L. Billinge and M. F. Thorpe. New York:
45+
Plenum, 1998, p. 137).
3446
The sources were converted to C++ by Jacques Bloch and then extensively hacked,
3547
extended and purged from most glaring bugs by Chris Farrow and Pavol Juhas.
3648
This code is currently maintained as part of the DiffPy project to create
3749
python modules for structure investigations from diffraction data.
3850

3951
The DiffPy team is located in the Billinge-group at the Applied Physics
4052
and Applied Mathematics Department of the Columbia University in New York.
41-
Previous significant contributors to this code were
53+
Previous significant contributors to this code were made by
4254

4355
Pavol Juhas, Chris Farrow, Jacques Bloch, Wenduo Zhou
4456

45-
For a detailed list of contributors see
57+
with more recent contributions from Billinge-group members.
58+
For a more detailed list of contributors see
4659
https://github.com/diffpy/diffpy.pdffit2/graphs/contributors.
4760

4861

@@ -62,7 +75,7 @@ in your publication:
6275
Installation
6376
============
6477

65-
See the `README <https://github.com/diffpy/diffpy.pdffit2#installation>`_
78+
Please see the `README <https://github.com/diffpy/diffpy.pdffit2#installation>`_
6679
file included with the distribution.
6780

6881
=================

doc/source/license.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ the following paper in your publication:
1717
in crystals (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007)
1818

1919
Copyright 2006-2007, Board of Trustees of Michigan State University,
20-
Copyright 2008-2024, Board of Trustees of Columbia University in the
20+
Copyright 2008-|year|, Board of Trustees of Columbia University in the
2121
city of New York. (Copyright holder indicated in each source file).
2222

2323
For more information please visit the project web-page:

0 commit comments

Comments
 (0)