Skip to content

Commit 8db6f6f

Browse files
committed
docs: shorten the line length
1 parent 0bf5f80 commit 8db6f6f

File tree

1 file changed

+107
-61
lines changed

1 file changed

+107
-61
lines changed

doc/source/quickstart.rst

Lines changed: 107 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ PDFmorph Tutorial
44
#################
55

66
Welcome! This will be a quick tutorial to accquaint users with PDFmorph
7-
and some of what it can do.
7+
and some of what it can do. To see more details and definitions about
8+
the morphs
9+
please see the publication describing ``diffpy.pdfmorph``.
810

911
As we described in the README and installation instructions, please make
1012
sure that you are familiar with working with your command line terminal
@@ -13,7 +15,10 @@ before using this application.
1315
Before you've started this tutorial, please ensure that you've installed
1416
all necessary software and dependencies.
1517

16-
In this tutorial, we will demonstrate how to use PDFmorph to compare two PDFs measured from the same material at different temperatures. The morphs showcased include "stretch", "scale", and "smear".
18+
In this tutorial, we will demonstrate how to use PDFmorph to compare
19+
two
20+
PDFs measured from the same material at different temperatures.
21+
The morphs showcased include "stretch", "scale", and "smear".
1722

1823
Basic PDFmorph Workflow
1924
=======================
@@ -52,7 +57,8 @@ Basic PDFmorph Workflow
5257
* Note that these files have the ``.gr`` extension, which
5358
indicates that they are measured PDFs. The ``.cgr`` file
5459
extension indicates that a file is a calculated PDF, such as
55-
those generated by the `PDFgui <https://www.diffpy.org/products/pdfgui.html>`_
60+
those generated by the
61+
`PDFgui <https://www.diffpy.org/products/pdfgui.html>`_
5662
program.
5763

5864
4. First, we will run the PDFmorph application without any morphing
@@ -216,17 +222,22 @@ at various temperatures to determine whether a phase change has occurred.
216222
PDFmorph currently allows users to morph a PDF against all files in a
217223
selected directory and plot resulting :math:`R_w` values from each morph.
218224

219-
1. Within the ``additionalData`` directory, ``cd`` into the ``morphsequence`` directory.
220-
Inside, you will find multiple PDFs of :math:`SrFe_2As_2` measured at various temperatures.
221-
These PDFs are from `"Atomic Pair Distribution Function Analysis: A primer" <https://github.com/Billingegroup/pdfttp_data/>`_.
222-
2. Let us start by getting the Rw of ``SrFe2As2_150K.gr`` compared to all other files in the
223-
directory. Run ::
225+
1. Within the ``additionalData`` directory, ``cd`` into the
226+
``morphsequence`` directory. Inside, you will find multiple PDFs of
227+
:math:`SrFe_2As_2` measured at various temperatures. These PDFs are
228+
from `"Atomic Pair Distribution Function Analysis: A primer"
229+
<https://global.oup.com/academic/product/
230+
atomic-pair-distribution-function-analysis-9780198885801>`_.
231+
232+
2. Let us start by getting the Rw of ``SrFe2As2_150K.gr`` compared to
233+
all other files in the directory. Run ::
224234

225235
pdfmorph SrFe2As2_150K.gr . --multiple-targets
226236

227-
The multiple tag indicates we are comparing PDF file (first input) against all PDFs in
228-
a directory (second input). Our choice of file was ``SeFe2As2_150K.gr``
229-
and directory was the cwd, which should be ``morphsequence``.
237+
The multiple tag indicates we are comparing PDF file (first input)
238+
against all PDFs in a directory (second input). Our choice of file
239+
was ``SeFe2As2_150K.gr`` and directory was the cwd, which should be
240+
``morphsequence``.
230241

231242
.. figure:: images/ex_tutorial_bar.png
232243
:align: center
@@ -235,14 +246,16 @@ selected directory and plot resulting :math:`R_w` values from each morph.
235246
Bar chart of :math:`R_W` values for each target file. Target files are
236247
listed in ASCII sort order.
237248

238-
3. After running this, we get chart of Rw values for each target file. However, this chart can
239-
be a bit confusing to interpret. To get a more understandable plot, run ::
249+
3. After running this, we get chart of Rw values for each target file.
250+
However, this chart can be a bit confusing to interpret. To get a
251+
more understandable plot, run ::
240252

241253
pdfmorph SrFe2As2_150K.gr . --multiple-targets --sort-by=temperature
242254

243-
This plots the Rw against the temperature parameter value provided at the top of each file.
244-
Parameters are entries of the form ``<parameter_name> = <parameter_value>`` and are located
245-
above the ``r`` versus ``gr`` table in each PDF file.::
255+
This plots the Rw against the temperature parameter value provided
256+
at the top of each file. Parameters are entries of the form
257+
``<parameter_name> = <parameter_value>`` and are located above
258+
the ``r`` versus ``gr`` table in each PDF file.::
246259

247260
# SrFe2As2_150K.gr
248261
[PDF Parameters]
@@ -254,94 +267,127 @@ selected directory and plot resulting :math:`R_w` values from each morph.
254267
:align: center
255268
:figwidth: 100%
256269

257-
The :math:`R_W` plotted against the temperature the target PDF was measured at.
270+
The :math:`R_W` plotted against the temperature the target PDF was
271+
measured at.
258272

259-
4. Between 192K and 198K, the Rw has a sharp increase, indicating that we may have a phase change.
260-
To confirm, let us now apply morphs onto ``SrFe2As2_150K.gr`` with all other files in ``morphsequence``
261-
as targets ::
273+
4. Between 192K and 198K, the Rw has a sharp increase, indicating that
274+
we may have a phase change. To confirm, let us now apply morphs
275+
onto `` SrFe2As2_150K.gr`` with all other files in
276+
``morphsequence`` as targets ::
262277

263278
pdfmorph --scale=1 --stretch=0 SrFe2As2_150K.gr . --multiple-targets --sort-by=temperature
264279

265-
Note that we are not applying a smear since it takes a long time to apply and does not significantly
266-
change the Rw values in this example.
280+
Note that we are not applying a smear since it takes a long time to
281+
apply and does not significantly change the Rw values in this example.
282+
267283
5. We should now see a sharper increase in Rw between 192K and 198K.
284+
268285
6. Go back to the terminal to see optimized morphing parameters from each morph.
269-
7. On the morph with ``SrFe2As2_192K.gr`` as target, ``scale = 0.972085`` and ``stretch = 0.000508``
270-
and with ``SrFe2As2_198K.gr`` as target, ``scale = 0.970276`` and ``stretch = 0.000510``.
271-
These are very similar, meaning that thermal lattice expansion (accounted for by ``stretch``)
272-
is not occurring. This, coupled with the fact that the Rw significantly increases suggests
273-
a phase change in this temperature regime. (In fact, :math:`SrFe_2As_2` does transition from
274-
orthorhombic at lower temperature to tetragonal at higher temperature!). More sophisticated analysis
275-
can be done with `PDFgui <https://www.diffpy.org/products/pdfgui.html>`_.
276-
8. Finally, let us save all the morphed PDFs into a directory named ``savedMorphs``. ::
286+
287+
7. On the morph with ``SrFe2As2_192K.gr`` as target, ``scale =
288+
0.972085`` and ``stretch = 0.000508`` and with ``SrFe2As2_198K.gr``
289+
as target, ``scale = 0.970276`` and ``stretch = 0.000510``. These
290+
are very similar, meaning that thermal lattice expansion (accounted
291+
for by ``stretch``) is not occurring. This, coupled with the fact
292+
that the Rw significantly increases suggests a phase change in this
293+
temperature regime. (In fact, :math:`SrFe_2As_2` does transition
294+
from orthorhombic at lower temperature to tetragonal at higher
295+
temperature!). More sophisticated analysis can be done with
296+
`PDFgui <https://www.diffpy.org/products/pdfgui.html>`_.
297+
298+
8. Finally, let us save all the morphed PDFs into a directory
299+
named ``savedMorphs``. ::
277300

278301
pdfmorph SrFe2As2_150K.gr . --scale=1 --stretch=0 --multiple-targets \
279302
--sort-by=temperature --plot-parameter=stretch \
280303
--save=savedMorphs
281304

282-
Entering the directory with ``cd`` and viewing its contents with ``ls``, we see a file named
283-
``Morph_Reference_Table.txt`` with data about the input morph parameters and re-
284-
fined output parameters and a directory named ``Morphs`` containing all the morphed
285-
PDFs. See the ``--save-names-file`` option to see how you can set the names for these
286-
saved morphs!
305+
Entering the directory with ``cd`` and viewing its contents with
306+
``ls``, we see a file named ``Morph_Reference_Table.txt`` with data
307+
about the input morph parameters and re- fined output parameters
308+
and a directory named ``Morphs`` containing all the morphed
309+
PDFs. See the ``--save-names-file`` option to see how you can set
310+
the names for these saved morphs!
287311

288312
Nanoparticle Shape Effects
289313
--------------------------
290314

291-
A nanoparticle's finite size and shape can affect the shape of its PDF.
292-
We can use PDFmorph to morph a bulk material PDF to simulate these shape effects.
293-
Currently, the supported nanoparticle shapes include: spheres and spheroids.
315+
A nanoparticle's finite size and shape can affect the shape of its
316+
PDF. We can use PDFmorph to morph a bulk material PDF to simulate
317+
these shape effects. Currently, the supported nanoparticle shapes
318+
include: spheres and spheroids.
294319

295-
* Within the ``additionalData`` directory, ``cd`` into the ``morphShape`` subdirectory.
296-
Inside, you will find a sample Ni bulk material PDF ``Ni_bulk.gr``.
297-
This PDF is from `"Atomic Pair Distribution Function Analysis: A primer" <https://github.com/Billingegroup/pdfttp_data/>`_.
320+
* Within the ``additionalData`` directory, ``cd`` into the
321+
``morphShape`` subdirectory. Inside, you will find a sample Ni bulk
322+
material PDF ``Ni_bulk.gr``. This PDF is from `"Atomic Pair
323+
Distribution Function Analysis:
324+
A primer" <https://github.com/Billingegroup/pdfttp_data/>`_.
298325
There are also multiple ``.cgr`` files with calculated Ni nanoparticle PDFs.
299326

300-
* Let us apply various shape effect morphs on the bulk material to reproduce these calculated PDFs.
327+
* Let us apply various shape effect morphs on the bulk material to
328+
reproduce these calculated PDFs.
301329

302330
* Spherical Shape
303-
1. The ``Ni_nano_sphere.cgr`` file contains a generated spherical nanoparticle with unknown radius.
304-
First, let us plot ``Ni_blk.gr`` against ``Ni_nano_sphere.cgr`` ::
331+
1. The ``Ni_nano_sphere.cgr`` file contains a generated
332+
spherical nanoparticle with unknown radius. First, let us
333+
plot ``Ni_blk.gr`` against ``Ni_nano_sphere.cgr`` ::
305334

306335
pdfmorph Ni_bulk.gr Ni_nano_sphere.cgr
307336

308337
Despite the two being the same material, the Rw is quite large.
309338
To reduce the Rw, we will apply spherical shape effects onto the PDF.
310-
However, in order to do so, we first need the radius of the spherical nanoparticle.
311-
2. To get the radius, we can first observe a plot of ``Ni_nano_sphere.cgr`` ::
339+
However, in order to do so, we first need the radius of the
340+
spherical nanoparticle.
341+
342+
2. To get the radius, we can first observe a plot of
343+
``Ni_nano_sphere.cgr`` ::
312344

313345
pdfmorph Ni_nano_sphere.cgr Ni_nano_sphere.cgr
314346

315-
3. Nanoparticles tend to have broader peaks at r-values larger than the particle size,
316-
corresponding to the much weaker correlations between molecules.
317-
On our plot, beyond r=22.5, peaks are too broad to be visible,
318-
indicating our particle size to be about 22.4.
319-
The approximate radius of a sphere would be half of that, or 11.2.
320-
4. Now, we are ready to perform a morph applying spherical effects. To do so, we use the ``--radius`` parameter ::
347+
3. Nanoparticles tend to have broader peaks at r-values larger
348+
than the particle size, corresponding to the much weaker
349+
correlations between molecules. On our plot, beyond r=22.5,
350+
peaks are too broad to be visible, indicating our particle
351+
size to be about 22.4. The approximate radius of a sphere
352+
would be half of that, or 11.2.
353+
354+
355+
4. Now, we are ready to perform a morph applying spherical
356+
effects. To do so, we use the ``--radius`` parameter ::
321357

322358
pdfmorph Ni_bulk.gr Ni_nano_sphere.cgr --radius=11.2 -a
323359

324-
5. We can see that the Rw value has significantly decreased from before. Run without the ``-a`` tag to refine ::
360+
5. We can see that the Rw value has significantly decreased
361+
from before. Run without the ``-a`` tag to refine ::
325362

326363
pdfmorph Ni_bulk.gr Ni_nano_sphere.cgr --radius=11.2
327364

328-
6. After refining, we see the actual radius of the nanoparticle was closer to 12.
365+
6. After refining, we see the actual radius of the
366+
nanoparticle was closer to 12.
367+
329368
* Spheroidal Shape
330-
1. The ``Ni_nano_spheroid.cgr`` file contains a calculated spheroidal Ni nanoparticle.
331-
Again, we can begin by plotting the bulk material against our nanoparticle ::
369+
370+
1. The ``Ni_nano_spheroid.cgr`` file contains a calculated
371+
spheroidal Ni nanoparticle. Again, we can begin by plotting
372+
the bulk material against our nanoparticle ::
332373

333374
pdfmorph Ni_bulk.gr Ni_nano_spheroid.cgr
334375

335-
2. Inside the ``Ni_nano_spheroid.cgr`` file, we are given that the equatorial radius is 12 and polar radius is 6.
336-
This is enough information to define our spheroid. To apply spheroid shape effects onto our bulk, run ::
376+
2. Inside the ``Ni_nano_spheroid.cgr`` file, we are given that
377+
the equatorial radius is 12 and polar radius is 6. This is
378+
enough information to define our spheroid. To apply
379+
spheroid shape effects onto our bulk, run ::
337380

338381
pdfmorph Ni_bulk.gr Ni_nano_spheroid.cgr --radius=12 --pradius=6 -a
339382

340-
Note that the equatorial radius corresponds to the ``--radius`` parameter and polar radius to ``--pradius``.
383+
Note that the equatorial radius corresponds to the
384+
``--radius`` parameter and polar radius to ``--pradius``.
385+
341386
3. Remove the ``-a`` tag to refine.
342387

343-
There is also support for morphing from a nanoparticle to a bulk. When applying the inverse morphs,
344-
it is recommended to set ``--rmax=psize`` where ``psize`` is the longest diameter of the nanoparticle.
388+
There is also support for morphing from a nanoparticle to a bulk. When
389+
applying the inverse morphs, it is recommended to set ``--rmax=psize``
390+
where ``psize`` is the longest diameter of the nanoparticle.
345391

346392
Bug Reports
347393
===========

0 commit comments

Comments
 (0)