Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
parameters, running peak extraction, and saving the results.

This script is equivalent to running
srmise data/Ag_nyquist_qmax30.gr --range 2. 3.5 \
--baseline "Polynomial(degree=1)" --save output/extract_single_peak.srmise \
--pwa output/extract_single_peak.pwa --plot
srmise data/Ag-nyquist-qmax30.gr --range 2. 3.5 \
--baseline "Polynomial(degree=1)" --save output/extract-single-peak.srmise \
--pwa output/extract-single-peak.pwa --plot
at the command line.
"""

Expand All @@ -39,7 +39,7 @@ def run(plot=True):
ppe = PDFPeakExtraction()

# Load the PDF from a file
ppe.loadpdf("data/Ag_nyquist_qmax30.gr")
ppe.loadpdf("data/Ag-nyquist-qmax30.gr")

# Set up extraction parameters.
# For convenience, we add all parameters to a dictionary before passing them
Expand Down Expand Up @@ -74,8 +74,8 @@ def run(plot=True):
# half-maximum), and area of extracted peaks. The reported values
# are for Gaussians in the radial distribution function (RDF) corresponding
# to this PDF.
ppe.write("output/extract_single_peak.srmise")
ppe.writepwa("output/extract_single_peak.pwa")
ppe.write("output/extract-single-peak.srmise")
ppe.writepwa("output/extract-single-peak.pwa")

# Plot results.
# Display plot of extracted peak. It is also possible to plot an existing
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/fit_initial.py → docs/examples/fit-initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run(plot=True):

# Initialize peak extraction
ppe = PDFPeakExtraction()
ppe.loadpdf("data/C60_fine_qmax21.gr")
ppe.loadpdf("data/C60-fine-qmax21.gr")

# Set up interpolated baseline.
# The FromSequence baseline creates an interpolated baseline from provided
Expand Down Expand Up @@ -98,8 +98,8 @@ def run(plot=True):
ppe.fit()

# Save results
ppe.write("output/fit_initial.srmise")
ppe.writepwa("output/fit_initial.pwa")
ppe.write("output/fit-initial.srmise")
ppe.writepwa("output/fit-initial.pwa")

if plot:
plt.figure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run(plot=True):

# Initialize peak extraction from saved trial
ppe = PDFPeakExtraction()
ppe.read("output/query_results.srmise")
ppe.read("output/query-results.srmise")
ppe.clearcalc()

# Set up extraction parameters
Expand All @@ -78,13 +78,13 @@ def run(plot=True):
ms.run(dgs)

# Save results
# The file known_dG_models.dat saves the models generated above. The file
# known_dG_aics.dat saves the value of the AIC of each model when evaluated
# The file known-dG-models.dat saves the models generated above. The file
# known-dG-aics.dat saves the value of the AIC of each model when evaluated
# on a Nyquist-sampled grid using each of the dg values used to generate
# the models in the first place.
dr = np.pi / ppe.qmax
ms.save("output/known_dG_models.dat")
ms.makeaics(dgs, dr, filename="output/known_dG_aics.dat")
ms.save("output/known-dG-models.dat")
ms.makeaics(dgs, dr, filename="output/known-dG-aics.dat")


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def run(plot=True):

# Create multimodeling object and load diffpy.srmise results from file.
ms = MultimodelSelection()
ms.load("output/known_dG_models.dat")
ms.loadaics("output/known_dG_aics.dat")
ms.load("output/known-dG-models.dat")
ms.loadaics("output/known-dG-aics.dat")

# Use Nyquist sampling
# Standard AIC analysis assumes the data have independent uncertainties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run(plot=True):

# Initialize peak extraction
ppe = PDFPeakExtraction()
ppe.loadpdf("data/C60_fine_qmax21.gr")
ppe.loadpdf("data/C60-fine-qmax21.gr")

# Set up extraction parameters
# The FromSequence baseline interpolates (r, G(r)) values read from a
Expand Down Expand Up @@ -87,8 +87,8 @@ def run(plot=True):
# on a Nyquist-sampled grid using each of the dg values used to generate
# the models in the first place.
dr = np.pi / ppe.qmax
ms.save("output/unknown_dG_models.dat")
ms.makeaics(dgs, dr, filename="output/unknown_dG_aics.dat")
ms.save("output/unknown-dG-models.dat")
ms.makeaics(dgs, dr, filename="output/unknown-dG-aics.dat")


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def run(plot=True):

# Create multimodeling object and load diffpy.srmise results from file.
ms = MultimodelSelection()
ms.load("output/unknown_dG_models.dat")
ms.loadaics("output/unknown_dG_aics.dat")
ms.load("output/unknown-dG-models.dat")
ms.loadaics("output/unknown-dG-aics.dat")

# Use Nyquist sampling
# Standard AIC analysis assumes the data have independent uncertainties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def run(plot=True):
ppe = PDFPeakExtraction()

# Load the PDF from a file
ppe.loadpdf("data/TiO2_fine_qmax26.gr")
ppe.loadpdf("data/TiO2-fine-qmax26.gr")

# Set up extraction parameters.
# In this section we'll examine the major extraction parameters in detail.
Expand Down Expand Up @@ -220,8 +220,8 @@ def run(plot=True):
# half-maximum), and area of of extracted peaks. The reported values
# are for Gaussians in the radial distribution function (RDF) corresponding
# to this PDF.
ppe.write("output/parameter_summary.srmise")
ppe.writepwa("output/parameter_summary.pwa")
ppe.write("output/parameter-summary.srmise")
ppe.writepwa("output/parameter-summary.pwa")

# Plot results.
# Display plot of extracted peak. It is also possible to plot an existing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
to evaluate the model on an arbitrary grid.

The peaks extracted by this script are equivalent to those obtained running
srmise data/Ag_nyquist_qmax30.gr --range 2. 10. \
--bsrmise output/extract_single_peak.srmise \
--save output/query_results.srmise \
--pwa output/query_results.pwa --plot
srmise data/Ag-nyquist-qmax30.gr --range 2. 10. \
--bsrmise output/extract-single-peak.srmise \
--save output/query-results.srmise \
--pwa output/query-results.pwa --plot
at the command line.
"""

Expand All @@ -41,13 +41,13 @@ def run(plot=True):
ppe = PDFPeakExtraction()

# Load the PDF from a file
ppe.loadpdf("data/Ag_nyquist_qmax30.gr")
ppe.loadpdf("data/Ag-nyquist-qmax30.gr")

# Obtain baseline from a saved diffpy.srmise trial. This is not the
# initial baseline estimate from the previous example, but the baseline
# after both it and the extracted peaks have been fit to the data.
ppebl = PDFPeakExtraction()
ppebl.read("output/extract_single_peak.srmise")
ppebl.read("output/extract-single-peak.srmise")
baseline = ppebl.extracted.baseline

# Set up extraction parameters.
Expand Down Expand Up @@ -196,8 +196,8 @@ def run(plot=True):
print("%i: %f" % (total_ideal_intensity, total_observed_intensity))

# Save output
ppe.write("output/query_results.srmise")
ppe.writepwa("output/query_results.pwa")
ppe.write("output/query-results.srmise")
ppe.writepwa("output/query-results.pwa")

# Evaluating a model.
# Although the ModelCovariance object is useful, the model used for fitting
Expand Down
26 changes: 13 additions & 13 deletions docs/source/tutorial/abbreviations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
.. |tar.gz| replace:: :source-release:`tar.gz`

.. Image substitutions
.. |images/extract_single_peak1.png| image:: ../../examples/images/extract_single_peak1.png
.. |images/extract_single_peak2.png| image:: ../../examples/images/extract_single_peak2.png
.. |images/extract_single_peak3.png| image:: ../../examples/images/extract_single_peak3.png
.. |images/parameter_summary1.png| image:: ../../examples/images/parameter_summary1.png
.. |images/parameter_summary2.png| image:: ../../examples/images/parameter_summary2.png
.. |images/parameter_summary3.png| image:: ../../examples/images/parameter_summary3.png
.. |images/parameter_summary4.png| image:: ../../examples/images/parameter_summary4.png
.. |images/fit_initial1.png| image:: ../../examples/images/fit_initial1.png
.. |images/fit_initial2.png| image:: ../../examples/images/fit_initial2.png
.. |images/query_results1.png| image:: ../../examples/images/query_results1.png
.. |images/query_results2.png| image:: ../../examples/images/query_results2.png
.. |images/query_results3.png| image:: ../../examples/images/query_results3.png
.. |images/extract_single_peak1.png| image:: ../../examples/images/extract-single-peak1.png
.. |images/extract_single_peak2.png| image:: ../../examples/images/extract-single-peak2.png
.. |images/extract_single_peak3.png| image:: ../../examples/images/extract-single-peak3.png
.. |images/parameter_summary1.png| image:: ../../examples/images/parameter-summary1.png
.. |images/parameter_summary2.png| image:: ../../examples/images/parameter-summary2.png
.. |images/parameter_summary3.png| image:: ../../examples/images/parameter-summary3.png
.. |images/parameter_summary4.png| image:: ../../examples/images/parameter-summary4.png
.. |images/fit_initial1.png| image:: ../../examples/images/fit-initial1.png
.. |images/fit_initial2.png| image:: ../../examples/images/fit-initial2.png
.. |images/query_results1.png| image:: ../../examples/images/query-results1.png
.. |images/query_results2.png| image:: ../../examples/images/query-results2.png
.. |images/query_results3.png| image:: ../../examples/images/query-results3.png

.. External links
.. _ParSCAPE algorithm: https://dx.doi.org/10.1107/S2053273315005276
Expand All @@ -38,5 +38,5 @@
.. |d_c| replace:: d\ :sub:`c`
.. |pi/Qmax| replace:: π/Q\ :sub:`max`

.. Links to PDF information defined in sample_links.txt
.. Links to PDF information defined in sample-links.txt
.. |Extending SrMise| replace:: :ref:`extending-srmise`
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. include:: abbreviations.txt

.. include:: sample_links.txt
.. include:: sample-links.txt


.. include:: ../../examples/README.rst
Expand All @@ -13,4 +13,4 @@
Script (extract_single_peak.py)
-------------------------------

.. literalinclude:: ../../examples/extract_single_peak.py
.. literalinclude:: ../../examples/extract-single-peak.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. include:: abbreviations.txt

.. include:: sample_links.txt
.. include:: sample-links.txt


.. include:: ../../examples/README.rst
Expand All @@ -13,4 +13,4 @@
Script (fit_initial.py)
---------------------------

.. literalinclude:: ../../examples/fit_initial.py
.. literalinclude:: ../../examples/fit-initial.py
12 changes: 6 additions & 6 deletions docs/source/tutorial/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Tutorial
.. toctree::
:maxdepth: 1

extract_single_peak
parameter_summary
fit_initial
query_results
multimodel_known_uncertainties
multimodel_unknown_uncertainties
extract-single-peak
parameter-summary
fit-initial
query-results
multimodel-known-uncertainties
multimodel-unknown-uncertainties


.. Now add information about the samples
Expand Down
25 changes: 25 additions & 0 deletions docs/source/tutorial/multimodel-known-uncertainties.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. include:: abbreviations.txt

.. include:: sample-links.txt


.. include:: ../../examples/README.rst
:start-after: ~Example 5~
:end-before: ~Example 6~



.. _multimodel-known-dG1.py:

Extraction Script (multimodel-known-dG1.py)
---------------------------------------------

.. literalinclude:: ../../examples/multimodel-known-dG1.py


.. _multimodel-known-dG2.py:

Analysis Script (multimodel-known-dG2.py)
-----------------------------------------

.. literalinclude:: ../../examples/multimodel-known-dG2.py
25 changes: 25 additions & 0 deletions docs/source/tutorial/multimodel-unknown-uncertainties.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. include:: abbreviations.txt

.. include:: sample_links.txt


.. include:: ../../examples/README.rst
:start-after: ~Example 6~
:end-before: ~PDF Info~



.. _multimodel-unknown-dG1.py:

Extraction Script (multimodel-unknown-dG1.py)
---------------------------------------------

.. literalinclude:: ../../examples/multimodel-unknown-dG1.py


.. _multimodel-unknown-dG2.py:

Analysis Script (multimodel-unknown-dG2.py)
-------------------------------------------

.. literalinclude:: ../../examples/multimodel-unknown-dG2.py
25 changes: 0 additions & 25 deletions docs/source/tutorial/multimodel_known_uncertainties.rst

This file was deleted.

25 changes: 0 additions & 25 deletions docs/source/tutorial/multimodel_unknown_uncertainties.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.. include:: abbreviations.txt

.. include:: sample_links.txt
.. include:: sample-links.txt


.. include:: ../../examples/README.rst
:start-after: ~Example 2~
:end-before: ~Example 3~


.. _parameter_summary.py:
.. _parameter-summary.py:

Script (parameter_summary.py)
Script (parameter-summary.py)
-----------------------------

.. literalinclude:: ../../examples/parameter_summary.py
.. literalinclude:: ../../examples/parameter-summary.py
Loading
Loading