From fd57fafc6a5108bb66134f7871067329e65cb0d6 Mon Sep 17 00:00:00 2001
From: Vickie Lynch <lynchve@ornl.gov>
Date: Tue, 22 Jan 2019 08:17:27 -0500
Subject: [PATCH] Refs #24333 doc test

---
 .../OptimizeCrystalPlacementByRun-v1.rst      | 45 +++++++++++++++++++
 docs/source/release/v3.14.0/diffraction.rst   |  2 +-
 2 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 docs/source/algorithms/OptimizeCrystalPlacementByRun-v1.rst

diff --git a/docs/source/algorithms/OptimizeCrystalPlacementByRun-v1.rst b/docs/source/algorithms/OptimizeCrystalPlacementByRun-v1.rst
new file mode 100644
index 00000000000..758e4c699cb
--- /dev/null
+++ b/docs/source/algorithms/OptimizeCrystalPlacementByRun-v1.rst
@@ -0,0 +1,45 @@
+.. algorithm::
+
+.. summary::
+
+.. relatedalgorithms::
+
+.. properties::
+
+Description
+-----------
+
+This algorithm basically optimizes h,k, and l offsets from an integer by
+varying the parameters sample positions for each run in the peaks workspace.
+
+The crystal orientation matrix, :ref:`UB matrix <Lattice>`, from the
+PeaksWorkspace should index all the runs "very well". Otherwise iterations
+that slowly build a :ref:`UB matrix <Lattice>` with corrected sample
+orientations may be needed.
+
+
+Usage
+-----
+
+**Example:**
+
+.. testcode:: ExOptimizeCrystalPlacementByRun
+
+   ws=LoadIsawPeaks("calibrated.peaks")
+   FindUBUsingFFT(PeaksWorkspace=ws,MinD=2,MaxD=20,Tolerance=0.12)
+   IndexPeaks(PeaksWorkspace='ws',Tolerance=0.12)
+   wsd = OptimizeCrystalPlacementByRun(InputWorkspace=ws,OutputWorkspace='wsd',Tolerance=0.12)
+   print('Optimized %s sample position: %s'%(mtd['wsd'].getPeak(0).getRunNumber(),mtd['wsd'].getPeak(0).getSamplePos()))
+   print('Optimized %s sample position: %s'%(mtd['wsd'].getPeak(8).getRunNumber(),mtd['wsd'].getPeak(8).getSamplePos()))
+
+Output:
+
+.. testoutput:: ExOptimizeCrystalPlacementByRun
+
+   Optimized 71907 sample position: [-0.000678629,-2.16033e-05,0.00493278]
+   Optimized 72007 sample position: [-0.0027929,-0.00105681,0.00497094]
+
+
+.. categories::
+
+.. sourcelink::
diff --git a/docs/source/release/v3.14.0/diffraction.rst b/docs/source/release/v3.14.0/diffraction.rst
index a45853b397c..0db6bbf8caf 100644
--- a/docs/source/release/v3.14.0/diffraction.rst
+++ b/docs/source/release/v3.14.0/diffraction.rst
@@ -43,7 +43,7 @@ Improvements
 - :ref:`IntegratePeaksUsingClusters <algm-IntegratePeaksUsingClusters>` will now treat NaN's as background.
 - SCD Event Data Reduction Diffraction Interface now adds goniometer for CORELLI and used proton charge as monitor count if no monitors are in input file.
 - :ref:`SetCrystalLocation <algm-SetCrystalLocation>` is a new algorithm to set the sample location in events workspaces.
-- :ref:`OptimizeCrystalPlacementByRUn <algm-OptimizeCrystalPlacementByRUn>` is new algorithm to update the sample position for each run in a peaks workspace.
+- :ref:`OptimizeCrystalPlacementByRun <algm-OptimizeCrystalPlacementByRun>` is new algorithm to update the sample position for each run in a peaks workspace.
 
 Bugfixes
 ########
-- 
GitLab