Skip to content

Commit 6a06058

Browse files
committed
Tutorials finalized
1 parent 1ea2fba commit 6a06058

File tree

8 files changed

+185
-21
lines changed

8 files changed

+185
-21
lines changed
73.6 KB
Loading
28.7 KB
Loading
26.1 KB
Loading
21 KB
Loading
39.8 KB
Loading
93 KB
Loading
82 KB
Loading

doc/manual/pdfmorph.texinfo

Lines changed: 185 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ June 2024
3434

3535
@c start of header
3636
@setfilename pdfmorph
37-
@settitle PDFmorph, release 1.0, @ReleaseDate{}
37+
@settitle PDFmorph, release 1.0.0, @ReleaseDate{}
3838
@c end of header
3939

4040
@c Part 1: copying
@@ -46,7 +46,7 @@ Copyright 2009-2024, Board of Trustees of Columbia University in the city of New
4646
@titlepage
4747

4848
@title PDFmorph user guide
49-
@subtitle 1.0 release
49+
@subtitle 1.0.0 release
5050
@subtitle @ReleaseDate{}
5151
@author C. L. Farrow, C. J. Wright, P. Juhás, C.-H. Liu, T. Davis,
5252
@author S. M. Román, A. Yang, and S. J. L. Billinge
@@ -273,7 +273,8 @@ and enter the directory with the @code{cd} command
273273
@example
274274
cd <PDFmorph_tutorial_directory>
275275
@end example
276-
@item Download the tutorial files @code{tutorialData.zip} folder (***INSERT LINK***)
276+
@item Download the @url{https://www.diffpy.org/diffpy.pdfmorph/tutorialfiles.html,
277+
quick start tutorial files @code{tutorialData.zip}}
277278
into your current directory and extract the files. After this is done,
278279
type @code{ls} in the command line to list your current directory contents
279280
and make sure there is a directory named @code{tutorialData}.
@@ -368,8 +369,8 @@ pdfmorph darkSub_rh20_C_01.gr darkSub_rh20_C_44.gr --scale=0.8 \
368369
@end example
369370
The optimized smear factor is now a non-insignificant @code{smear=-0.084138} and @math{R_W=0.204}.
370371
@itemize
371-
@item We restricted the @code{r} (abscissa) values because some of the Gaussian smear effects are only
372-
visible in a fixed @code{r} range. We chose this @code{r} range by noting where most of our relevant
372+
@item We restricted the @math{r} (abscissa) values because some of the Gaussian smear effects are only
373+
visible in a fixed @math{r} range. We chose this @math{r} range by noting where most of our relevant
373374
data was that was not exponentially decayed by instrumental shortcomings.
374375
@item Also note that a negative smear factor is equivalent to its absolute value. You can see that
375376
@example
@@ -383,7 +384,7 @@ pdfmorph darkSub_rh20_C_01.gr darkSub_rh20_C_44.gr --scale=0.8 \
383384
@end example
384385
give the exact same results.
385386
@end itemize
386-
@item Finally, we will examine the stretch morph. The @code{r} axis will be stretched by
387+
@item Finally, we will examine the stretch morph. The @math{r} axis will be stretched by
387388
@math{1+s} where @math{s} is the stretch factor.
388389
@example
389390
pdfmorph darkSub_rh20_C_01.gr darkSub_rh20_C_44.gr --scale=0.8 \
@@ -406,23 +407,29 @@ We have reached the optimal fit for our PDF!
406407
@item Now, try it on your own!
407408
If you have personally collected or otherwise readily available PDF data,
408409
try this process to see if you can morph your PDFs to one another.
409-
Note that many of the parameters provided in this tutorial are unique to it,
410-
so be cautious about your choices and made sure that they remain physically relevant.
410+
Note that many of the parameters provided in this tutorial are unique to it, so be
411+
cautious about your choices and made sure that they remain physically relevant.
411412
@end enumerate
412413

413414
@node Extra tutorials, , Quick start tutorial, Tutorials
414415
@section Extra tutorials
415416
@cindex extra tutorials
417+
418+
@menu
419+
* Performing multiple morphs::
420+
* Nanoparticle shape effect::
421+
@end menu
422+
416423
PDFmorph has some more functionalities not showcased in the basic workflow above
417424
(run @code{pdfmorph –-help} for an overview of all @code{PDFmorph} functionalities).
418425
Tutorials for some of these are included below.
419426
Additional files are used for these tutorials. Please download and extract
420-
@code{additionalData.zip} (***INSERT LINK***) before proceeding.
427+
the @url{https://www.diffpy.org/diffpy.pdfmorph/tutorialfiles.html,
428+
extra tutorial data @code{additionalData.zip}} before proceeding.
421429

422-
@menu
423-
* Performing multiple morphs
424-
* Nanoparticle shape effect
425-
@end menu
430+
@node Performing multiple morphs, Nanoparticle shape effect, Extra tutorials, Extra tutorials
431+
@subsection Performing multiple morphs
432+
@cindex performing multiple morphs
426433

427434
It may be useful to morph a PDF against multiple targets: for example, you may want
428435
to morph a PDF against a sequence of PDFs measured at various temepratures to determine
@@ -432,25 +439,182 @@ It is advised that the lowest temperature PDF be that morphed and the higher tem
432439
act as targets as the smear morph is only able to account for increases in thermal motion.
433440

434441
@enumerate
435-
@item Within @code{additionalData}, enter (using @code{cd}) the @code{morphsequence} directory.
442+
@item Within @code{additionalData}, enter (using @code{cd}) the @code{morphMultiple} directory.
436443
Inside, you will find multiple PDFs of @math{SrFe_2As_2} measured at various temperatures.
437444
@itemize
438445
@item These PDFs come from @url{https://github.com/Billingegroup/pdfttp_data/,
439446
@emph{Atomic Pair Distribution Function Analysis: A Primer}} by Simon Billinge and
440-
Kirsten Jensen.
447+
Kirsten Jensen. Contributions to the dataset have been made by Benjamin Frandsen and
448+
Long Yang.
449+
@end itemize
450+
@float Figure,fig3.2.1-1
451+
@ScreenShot{images/ex_tutorial_download,png}
452+
@caption{The files within the @code{morphMultiple} directory.}
453+
@end float
454+
@item Let us start by getting the @math{R_W} of @code{SrFe2As2_150K.gr}
455+
compared to the other, higher-temperature PDFs in the directory. Run
456+
@example
457+
pdfmorph SrFe2As2_150K.gr . --multiple
458+
@end example
459+
@itemize
460+
@item The @code{--multiple} tag tells @code{PDFmorph} to compare the morphed file
461+
@code{SrFe2As2_150K.gr} against all PDFs in a directory. The directory we have
462+
supplied is @code{.}, which is shorthand for the current working directory.
463+
In our case, this is the @code{morphMultiple} directory.
441464
@end itemize
442-
@item It is generally advisable for the
465+
@float Figure,fig3.2.1-2
466+
@ScreenShot{images/ex_tutorial_bar,png}
467+
@caption{Bar chart of @math{R_W} values for each target file. Target files are
468+
listed in ASCII sort order.}
469+
@end float
470+
@item After running this we get a chart of @math{R_W} values for the morphed file
471+
compared to each target file. By default, a bar chart is generated. However, this plot
472+
can be difficult to interpret. We may instead wish to generate a line chart of @math{R_W}
473+
values against some numerical abscissa such as temperature. At the top of each @code{.gr}
474+
file in this directory is a list of parameters. These are of the form
475+
@code{<parameter_name> = <parameter_value>} and are located above the @code{r} versus @code{gr}
476+
table. Included in these parameters is the temperature at which each PDF was measured at.
477+
@float Figure,fig3.2.1-3
478+
@ScreenShot{images/ex_tutorial_params,png}
479+
@caption{Parameters located at the top of the @code{SrFe2As2_150K.gr} file. Some parameters
480+
included are temperature, wavelength, and composition.}
481+
@end float
482+
@item By running
483+
@example
484+
pdfmorph SrFe2As2_150K.gr . --multiple --sort-by=temperature
485+
@end example
486+
we can sort the plotted @math{R_W} values by the temperature parameter included within each file.
487+
@itemize
488+
@item When the value of the parameter given to @code{--sort-by} is numerical, a line plot is generated.
489+
@item Otherwise, a bar chart with the parameter values sorted in ASCII sort order is generated.
490+
You can observe this behavior by using @code{inputfile} as the @code{--sort-by} parameter
491+
instead of @code{temperature}.
492+
@end itemize
493+
@float Figure,fig3.2.1-4
494+
@ScreenShot{images/ex_tutorial_temp,png}
495+
@caption{The @math{R_W} plotted against the temperature the target PDF was measured at.}
496+
@end float
497+
@item Between @math{192K} and @math{198K}, the @math{R_W} has a sharp change, which may be indicative of
498+
a phase change. To be more certain, let us apply morphs to take into account isotropic expansion and differences
499+
in incident flux (stretching and scaling).
500+
@example
501+
pdfmorph SrFe2As2_150K.gr . --scale=1 --stretch=0 --multiple \
502+
--sort-by=temperature
503+
@end example
504+
The change in @math{R_W} has become more pronounced.
505+
@itemize
506+
@item Note that we are not applying the smear morph in this example as it takes a long time to refine and does
507+
not significantly change the @math{R_W} values in this example.
508+
@end itemize
509+
@item We can also change what is being plotted in the ordinate using @code{--plot-parameter}. In our case,
510+
it is useful to look at the @code{stretch} factor
511+
@example
512+
pdfmorph SrFe2As2_150K.gr . --scale=1 --stretch=0 --multiple \
513+
--sort-by=temperature --plot-parameter=stretch
514+
@end example
515+
We can see that the stretch factor generally increases, but from @math{192K} to @math{198K}, there is no increase.
516+
This means @code{PDFmorph} found that isotropic lattice expansion due to latent thermal effects (indicated
517+
by an increase in the stretch factor) does not account for the change in @math{R_W} in this region. This is
518+
highly suggestive of an alternative source of the dissimilarity such as a phase transition. In fact, there is a structural
519+
phase transition from orthorhombic below @math{192K} to tetragonal above @math{198K}! More sophisticated analysis
520+
can be done with @url{https://www.diffpy.org/products/pdfgui, PDFgui}.
521+
@float Figure,fig3.2.1-5
522+
@ScreenShot{images/ex_tutorial_stretch,png}
523+
@caption{The refined stretch factor for each target PDF. There is very little change between @math{192K} and
524+
@math{198K}.}
525+
@end float
443526
@end enumerate
444527

445-
@node Performing multiple morphs, Nanoparticle shape effect, Extra tutorials, Extra tutorials
446-
@subsection Performing multiple morphs
447-
@cindex performing multiple morphs
448-
449-
450528
@node Nanoparticle shape effect, , Performing multiple morphs, Extra tutorials
451529
@subsection Nanoparticle shape effect
452530
@cindex nanoparticle shape effect
453531

532+
@menu
533+
* Spherical shape::
534+
* Spheroidal shape::
535+
@end menu
536+
537+
A nanoparticle’s finite size and shape can affect the shape of its PDF.
538+
We can use PDFmorph to morph a bulk material PDF to simulate these shape effects.
539+
Currently, the supported nanoparticle shapes include only spheres and spheroids.
540+
541+
@itemize
542+
@item Within the @code{additionalData} directory, @code{cd} into the @code{morphShape}
543+
subdirectory. Inside, you will find a sample Nickel bulk material PDF @code{Ni_bulk.gr}.
544+
This PDF comes from @url{https://github.com/Billingegroup/pdfttp_data/,
545+
@emph{Atomic Pair Distribution Function Analysis: A Primer}}.
546+
Also in the directory are multiple @code{.cgr}, which are calculated Nickel nanoparticle
547+
PDFs.
548+
@float Figure,fig3.2.2-1
549+
@ScreenShot{images/ex_tutorial_shape_download,png}
550+
@caption{The files within the @code{morphShape} directory.}
551+
@end float
552+
@item In the following sections, we apply shape effect morphs on the bulk material to
553+
reproduce the calculated PDFs.
554+
@end itemize
555+
556+
Note that there are also support for morphing a nanoparticle PDF into bulk. For more information
557+
see @ref{PDFmorph options}. When applying these inverse morphs it is recommended to set
558+
@code{--rmax=psize} wher @code{psize} is the longest diameter of the nanoparticle as data
559+
beyond @code{psize} is noise.
560+
561+
@node Spherical shape, Spheroidal shape, Nanoparticle shape effect, Nanoparticle shape effect
562+
@subsubsection Spherical shape
563+
@cindex spherical shape morph
564+
565+
@enumerate
566+
@item The @code{Ni_nano_sphere.cgr} file contains a generated spherical nanoparticle with unknown
567+
radius. First, let us plot @code{Ni_bulk.gr} against @code{Ni_nano_sphere.cgr}.
568+
@example
569+
pdfmorph Ni_bulk.gr Ni_nano_sphere.cgr
570+
@end example
571+
@item Despite the two being the same material, the @math{R_W} is quite large.
572+
To reduce the Rw, we will apply spherical shape effects onto the PDF.
573+
However, in order to do so, we first need the radius of the spherical nanoparticle.
574+
@item A nanoparticle cannot have bonds longer than the particle size. Thus, for @math{r}
575+
beyond the spherical diameter, we expect the PDF amplitude to be close to zero.
576+
On our plot, the nanoparticle PDF amplitude falls to zero around @math{r=22}.
577+
Thus, the nanoparticle radius should be about half of that, or around @math{11}.
578+
@float Figure,fig3.2.2.1-1
579+
@ScreenShot{images/ex_tutorial_shape_sphere_zoomed,png}
580+
@caption{The PDF amplitude goes to zero between @math{r=21} and @math{r=22}.}
581+
@end float
582+
@item We are ready to perform a morph applying spherical shape effects.
583+
To do so, we use the @code{--radius} parameter
584+
@example
585+
pdfmorph Ni_bulk.gr Ni_nano_sphere.cgr --radius=11 -a
586+
@end example
587+
We can see that the @math{R_W} value has decreased significantly from
588+
@math{R_W = 1.422} to @math{R_W = 0.085232}.
589+
@item Finally, let us refine by running the same command without the @code{-a} tag.
590+
The refined radius should be @code{radius=12.183129}.
591+
@end enumerate
592+
593+
@node Spheroidal shape, , Spherical shape, Nanoparticle shape effect
594+
@subsubsection Spheroidal shape
595+
@cindex spheroidal shape morph
596+
597+
@enumerate
598+
@item The @code{Ni_nano_spheroid.cgr} file contains a calculated spheroidal Niickel nanoparticle.
599+
Again, we can begin by plotting the bulk material against our nanoparticle.
600+
@example
601+
pdfmorph Ni_bulk.gr Ni_nano_spheroid.cgr
602+
@end example
603+
@item The nanoparticle shape of the calculated PDF is an oblate spheroid with equitorial
604+
radius of about @math{12} and polar radius of about @math{6} (this information is contained
605+
within the @code{Ni_nano_spheroid.cgr} file). To apply the spheroidal shape effects onto the
606+
bulk, run
607+
@example
608+
pdfmorph Ni_bulk.gr Ni_nano_spheroid.cgr --radius=12 --pradius=6 -a
609+
@end example
610+
@itemize
611+
@item The @code{--radius} option corresponds to the equitorial radius.
612+
@item The @code{--pradius} option corresponds to the polar radius.
613+
@end itemize
614+
@item Run the same command without @code{-a} to refine. Refining should give
615+
@code{radius=12.183129} and @code{pradius=6.279252}.
616+
@end enumerate
617+
454618
@page
455619
@vskip 0pt plus 1filll
456620
@node Available morphs, PDFmorph options, Quick start tutorial, Top

0 commit comments

Comments
 (0)