Skip to content

Commit d173c64

Browse files
committed
Finish options
1 parent e86c6ff commit d173c64

File tree

1 file changed

+148
-35
lines changed

1 file changed

+148
-35
lines changed

doc/manual/pdfmorph.texinfo

Lines changed: 148 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ model-independent way. It was originally designed to help a researcher
110110
answer a question: "Has my material undergone a phase transition between
111111
these two measurements?"
112112

113-
A common approach to compare two PDFs is to plot the fdifference curve below
113+
A common approach to compare two PDFs is to plot the difference curve below
114114
the two PDFs. However, a significant signal can be seen in the difference curve
115115
due to benign effects such as thermal expansion (peak shifts), increased thermal
116116
motion (peak broadening), or a change in scale due to differences in the incident
@@ -170,11 +170,11 @@ first familiarize themselves with their operating system's command-line interfac
170170
@code{PDFmorph} currently requires Python 3.10 or higher to run. It also makes use of
171171
the following third party libraries:
172172
@itemize @bullet
173-
@item @url{https://numpy.org/, NumPy} - Python's fast scientific computing library
174-
@item @url{https://matplotlib.org/, Matplotlib} - Python plotting library
175-
@item @url{https://scipy.org/, SciPy} - Python's technical computing library
176-
@item @url{https://www.diffpy.org/diffpy.utils/, diffpy.utils}
177-
- @url{https://www.diffpy.org/, DiffPy} general utility functions
173+
@item @url{https://numpy.org, NumPy} - Python's fast scientific computing library
174+
@item @url{https://matplotlib.org, Matplotlib} - Python plotting library
175+
@item @url{https://scipy.org, SciPy} - Python's technical computing library
176+
@item @url{https://www.diffpy.org/diffpy.utils, diffpy.utils}
177+
- @url{https://www.diffpy.org, DiffPy} general utility functions
178178
@end itemize
179179
These dependencies will be installed automatically if you use the conda installation
180180
procedure described in the following section (@ref{Installation instructions}).
@@ -185,7 +185,7 @@ procedure described in the following section (@ref{Installation instructions}).
185185

186186
We recommend installing the package and its dependencies using conda.
187187
Miniconda, a minimal installer for conda, can be downloaded
188-
@url{https://docs.anaconda.com/free/miniconda/, here}.
188+
@url{https://docs.anaconda.com/free/miniconda, here}.
189189
Once Miniconda is installed, run @code{conda} on the command-line
190190
to test that it has been installed properly.
191191

@@ -200,7 +200,7 @@ In future sessions, make sure to run @code{conda activate pdfmorph_env} to activ
200200
environment before interacting with the @code{PDFmorph} program.
201201

202202
Once active, you can install @code{PDFmorph} into your environment from the
203-
@url{https://conda-forge.org/, conda-forge} channel of Anaconda packages by running
203+
@url{https://conda-forge.org, conda-forge} channel of Anaconda packages by running
204204
@example
205205
conda config --add channels conda-forge
206206
conda install diffpy.pdfmorph
@@ -218,7 +218,7 @@ conda deactivate pdfmorph_env
218218
@end example
219219

220220
If you do not wish to use conda to install, @code{PDFmorph} is also available on the
221-
@url{https://pypi.org/, Python Package Index} or can be installed from source
221+
@url{https://pypi.org, Python Package Index} or can be installed from source
222222
at @url{https://github.com/diffpy/diffpy.pdfmorph}. Note that these installation
223223
methods will require you to first install the dependencies listed in the previous section
224224
(@ref{Requirements}).
@@ -450,7 +450,7 @@ act as targets as the smear morph is only able to account for increases in therm
450450
@item Within @code{additionalData}, enter (using @code{cd}) the @code{morphMultiple} directory.
451451
Inside, you will find multiple PDFs of @math{SrFe_2As_2} measured at various temperatures.
452452
@itemize
453-
@item These PDFs come from @url{https://github.com/Billingegroup/pdfttp_data/,
453+
@item These PDFs come from @url{https://github.com/Billingegroup/pdfttp_data,
454454
@emph{Atomic Pair Distribution Function Analysis: A Primer}} by Simon Billinge and
455455
Kirsten Jensen. Contributions to the dataset have been made by Benjamin Frandsen and
456456
Long Yang.
@@ -560,7 +560,7 @@ Currently, the supported nanoparticle shapes include only spheres and spheroids.
560560
@itemize
561561
@item Within the @code{additionalData} directory, @code{cd} into the @code{morphShape}
562562
subdirectory. Inside, you will find a sample Nickel bulk material PDF @code{Ni_bulk.gr}.
563-
This PDF comes from @url{https://github.com/Billingegroup/pdfttp_data/,
563+
This PDF comes from @url{https://github.com/Billingegroup/pdfttp_data,
564564
@emph{Atomic Pair Distribution Function Analysis: A Primer}}.
565565
Also in the directory are multiple @code{.cgr}, which are calculated Nickel nanoparticle
566566
PDFs.
@@ -716,15 +716,17 @@ coefficient between the two PDFs.
716716
@* @indent When enabled, refinement will seek to both maximize the Pearson correlation
717717
coefficient and minimize the residual between the two PDFs.
718718

719-
@b{Manipulations}: These options select the manipulations (morphs) that are to be applied to
719+
@noindent @titlefont{Morphs and manipulations}
720+
721+
These options select the morphs and manipulations that are to be applied to
720722
the morphed PDF. The passed values will be refined unlesss specifically excluded with the
721723
@code{--apply} or @code{--exclude} options. If no morphs are selected, the morphed PDF will
722724
be unchanged and plotted against the target PDF.
723725

724726
@noindent @code{-a, --apply}
725727
@* @indent Apply the morph but do not refine the morph parameter value.
726728
When this is not enabled, @code{PDFmorph} will automatically refine the
727-
morph parameters.
729+
morph parameters for all morph options below.
728730

729731
@noindent @code{-x MORPH, --exclude=MORPH}
730732
@* @indent Do not refine the morph named @code{MORPH}. Note that the input @code{MORPH}
@@ -742,9 +744,9 @@ parameter @math{0.1} for smear. However, @code{--exclude=Scale} will not stop
742744
scaling @math{g(r)} by @code{SCALE} will return @math{@code{SCALE}*g(r)}.
743745

744746
@noindent @code{--smear=SMEAR}
745-
@* @indent Smear the PDF peaks with a Gaussian of width (standard deviation) @math{|{@code{SMEAR}|}.
747+
@* @indent Smear the PDF peaks with a Gaussian of width (standard deviation) @math{abs(@code{SMEAR})}.
746748
This input can be negative, but will have the same effect as its absolute value. This function is designed
747-
only for use on PDFs. This operation assumes the RDF (see @section{Available morphs}) peaks are approximately
749+
only for use on PDFs. This operation assumes the RDF (see @ref{Available morphs}) peaks are approximately
748750
Gaussian and works by converting the PDF to an RDF, convoluting a Gaussian of width @code{SMEAR} with the RDF,
749751
and converting back to the PDF. This conversion requires a parameter @code{BASELINESLOPE} which will be
750752
refined if not provided by the user in the @code{--slope} option.
@@ -754,29 +756,140 @@ refined if not provided by the user in the @code{--slope} option.
754756
For example, if the original function is @math{g(r)}, the stretch returns @math{g(r/(1+@code{STRETCH}))}.
755757
The returned PDF will always only be defined between @code{RMIN} and @code{RMAX} (see @code{--rmin}
756758
and @code{--rmax}). The @code{STRETCH} coefficient must be larger than @math{-1} and values in the
757-
range @math{(-1, 0}} will compress the function and set the remaining portion of the function up to
759+
range @math{(-1, 0)} will compress the function and set the remaining portion of the function up to
758760
@code{RMAX} as zero.
759761

760762
@noindent @code{--slope=BASELINESLOPE}
761-
@* @indent The slope of the baseline used when applying the smear factor. If provided, it will not be refined.
762-
The equation @math{@code{BASELINESLOPE}=4 @pi r @rho_0 @gamma_0)} can be used if the atomic number density
763-
@math{@rho_0} and the nanoparticle form factor @math{@gamma_0} is known for the morphed PDF. Otherwise,
764-
do not include this slope and @code{PDFmorph} will automatically estimate it for you.
765-
766-
@noindent @code{}
767-
@* @indent
768-
769-
@noindent @code{}
770-
@* @indent
771-
772-
@noindent @code{}
773-
@* @indent
774-
775-
@noindent @code{}
776-
@* @indent
777-
778-
@noindent @code{}
779-
@* @indent
763+
@* @indent The slope of the baseline used when applying the smear factor. Unless excluded using @code{--apply}
764+
or @code{--exclude}, it will be refined whenever @code{--smear} is used, even if @code{--smear} is not being refined.
765+
The equation @math{@code{BASELINESLOPE}=4 \pi r \rho_0 \gamma_0)} can be used if the atomic number density
766+
@math{\rho_0} and the nanoparticle form factor @math{\gamma_0} is known for the morphed PDF.
767+
768+
@noindent @code{--qdamp=QDAMP}
769+
@* @indent Dampen the PDF by a factor @code{QDAMP}. A limited @math{Q}-resolution of the diffractometer
770+
requires us to apply a Gaussian dampening envelope centered at @math{r=0} with width (standard deviation)
771+
@code{QDAMP}. This envelop is directly multiplied to the PDF.
772+
773+
@noindent @code{--radius=RADIUS}
774+
@* @indent Apply the nanoparticle form factor @math{\gamma_0} for a sphere of radius @code{RADIUS}.
775+
If @code{PRADIUS} is also specified, instead apply the characteristic function of a spheroid with
776+
equitorial radius @code{RADIUS} and polar radius @code{PRADIUS}.
777+
778+
@noindent @code{--pradius=PRADIUS}
779+
@* @indent If @code{RADIUS} is also specified, see @code{--radius}. Otherwise, apply the characteristic
780+
function of a sphere with radius @code{PRADIUS}.
781+
782+
@noindent @code{--iradius=IRADIUS}
783+
@* @indent Apply the inverse characteristic function @math{1/\gamma_0} of a sphere of radius @code{IRADIUS}/
784+
If @code{IPRADIUS} is also specified, instead apply the characteristic function of a spheroid with
785+
equitorial radius @code{IRADIUS} and polar radius @code{PRADIUS}.
786+
787+
@noindent @code{--ipradius=IPRADIUS}
788+
@* @indent If @code{IRADIUS} is also specified, see @code{--iradius}. Otherwise, apply the characteristic
789+
function of a sphere with radius @code{IPRADIUS}.
790+
791+
@noindent @titlefont{@b{Plot options}}
792+
793+
These options control plotting. The morphed and target PDFs will be plotted against each other with a
794+
difference curve shown below. The following changes occur when @code{--multiple} is enabled.
795+
(1) The @math{R_W} for each morphed PDF compared to the target will be plotted unless
796+
another parameter is specified by @code{--plot-parameter}. (2) The plot will be a bar chart
797+
where the abscissa names are the file names of the target PDFs unless otherwise specified by
798+
@code{--sort-by}. If the parameter given to @code{--sort-by} has numerical value, the plot
799+
will be a line chart; otherwise, a bar chart the parameter values as the absicssa names will
800+
be plotted. By default, ASCII sort order is used for the bar chart abscissa names, but
801+
@code{--reverse} can be used to reverse the order.
802+
803+
@noindent @code{-n, --noplot}
804+
@* @indent Do not display a plot if enabled. Otherwise, show a plot.
805+
806+
@noindent @code{--mlabel=MLABEL}
807+
@* @indent Set the label for the morphed PDF to @code{MLABEL} on the plot. If not specified,
808+
the morphed file name will be used as the label.
809+
810+
@noindent @code{--tlabel=TLABEL}
811+
@* @indent Set the label for the target PDF to @code{TLABEL} on the plot. If not specified,
812+
the target file name will be used as the label.
813+
814+
@noindent @code{--pmin=PMIN}
815+
@* @indent The minimum @math{r}-value (abscissa) to plot. If not specified, @code{RMIN} will be used.
816+
817+
@noindent @code{--pmax=PMAX}
818+
@* @indent @indent The maximum @math{r}-value (abscissa) to plot. If not specified, @code{RMAX} will be used.
819+
820+
@noindent @code{--maglim=MAGLIM}
821+
@* @indent The function @math{g(r)} will be magnified by @code{MAG} for @math{r>@code{MAGLIM}}. This may
822+
be useful as PDF amplitude can get very small for large @math{r}. No magnification will take place if
823+
@code{--maglim} is not specified.
824+
825+
@noindent @code{--mag=MAG}
826+
@* @indent See @code{--maglim}. No magnification will take place if @code{--maglim} is not specified.
827+
828+
@noindent @code{--lwidth=LWIDTH}
829+
@* @indent Set the line thickness of the plotted curves. If not specified, it will default to @math{1.5}.
830+
831+
@noindent @titlefont{@b{Multiple morphs}}
832+
833+
@code{PDFmorph} allows one to morph one PDF against multiple different targets when @code{--multiple}
834+
is enabled. See @code{-s} and the description under "Plot options" for how saving and plotting
835+
change when @code{--multiple} is enabled.
836+
837+
@noindent @code{--multiple}
838+
@* @indent Changes usage of @code{PDFmorph} to
839+
@example
840+
pdfmorph <MORPHED_FILE> <TARGET_DIRECTORY>
841+
@end example
842+
@noindent where the PDF in the file @code{MORPHED_FILE} will be morphed with each (PDF) file
843+
in the directory @code{TARGET_DIRECTORY} as the target. Files in @code{TARGET_DIRECTORY} will
844+
be sorted in ASCII sort order order unless a sorting parameter is specified by @code{sort-by}.
845+
846+
@noindent @code{--sort-by=FIELD}
847+
@* @indent Used with @code{--multiple}. Sort the files in @code{TARGET_DIRECTORY} by some parameter
848+
named @code{FIELD}. Parameters can be specified within each target PDF file by lines of the form
849+
@code{<PARAM_NAME> = <PARAM_VALUE>} in the header (anywhere above the @math{r} versus @math{g(r)}
850+
data table). @code{PDFmorph} will attempt to find a parameter named @code{FIELD} using a
851+
case-insensitive search. Numerical @code{PARAM_VALUE} will be sorted in ascending order and
852+
non-numerical ones will be sorted in ASCII sort order.
853+
854+
@noindent @code{--reverse}
855+
@* @indent Used with @code{--multiple}. Sort the files in @code{TARGET_DIRECTORY} in reverse
856+
ASCII sort order. If a parameter is given by @code{--sort-by}, reverse the order given by
857+
@code{--sort-by}.
858+
859+
@noindent @code{--serial-file=SERIALFILE}
860+
@* @indent Used with @code{--multiple} and @code{--sort-by}. Look for @code{FIELD} in a serial
861+
file named @code{SERIALFILE} instead. Only serial file types supported by
862+
@url{https://www.diffpy.org/diffpy.utils, diffpy.utils} such as @code{.json} are allowed.
863+
864+
@noindent @code{--save-names-file=NAMESFILE}
865+
@* @indent Used with @code{--multiple} and @code{-s}. Specify names for each manipulated PDF when
866+
saving using a serial file named @code{NAMESFILE}. The format of @code{NAMESFILE} should be
867+
as follows: (1) Each target PDF file name is an entry in @code{NAMESFILE}. (2) For each entry,
868+
there should be a key @code{save_morph_as} whose value specified the name to save the manipulated
869+
PDF as. An example @code{.json} @code{NAMESFILE} is below.
870+
@example
871+
@{
872+
"target1.gr": @{
873+
"save_morph_as": "name.extension"
874+
@},
875+
"target2.gr": @{
876+
"save_morph_as": "another_name.extension",
877+
"other_information": "[optional]"
878+
@},
879+
"target3.gr": @{
880+
"SaVe_MoRph_As": "this_also_works.extension",
881+
"note": "Capitalization does NOT matter. This is case insensitive."
882+
@}
883+
@}
884+
@end example
885+
@noindent Only serial file types supported by @url{https://www.diffpy.org/diffpy.utils, diffpy.utils}
886+
such as @code{.json} are allowed.
887+
888+
@noindent @code{--plot-parameter=PLOTPARAM}
889+
@* @indent Used with @code{--multiple} and when plotting is enabled. Choose a parameter @code{PLOTPARAM}
890+
to plot for each morph. When not specified, the @math{R_W} values for each morphed PDF compared to the
891+
target PDFs will be plotted. This option is not case sensitive meaning @code{--plot-parameter=Scale} and
892+
@code{--plot-parameter=scale} will both cause the parameter @code{scale} to be plotted.
780893

781894
@c End TexInfo file
782895
@node Index, Top

0 commit comments

Comments
 (0)