From 94e193b8d678e35f22e8651e4e4dfb434c8e9add Mon Sep 17 00:00:00 2001
From: Peter Parker <peter.parker@stfc.ac.uk>
Date: Wed, 11 Jun 2014 14:54:49 +0100
Subject: [PATCH] Refs #9587 - Docs for SANSBeamFluxCorrection.

---
 .../algorithms/SANSBeamFluxCorrection-v1.rst  |  27 ++++++++++++++++++
 .../SANSBeamFluxCorrectionMonitor.nxs         | Bin
 2 files changed, 27 insertions(+)
 rename Test/AutoTestData/{ => UsageData}/SANSBeamFluxCorrectionMonitor.nxs (100%)

diff --git a/Code/Mantid/docs/source/algorithms/SANSBeamFluxCorrection-v1.rst b/Code/Mantid/docs/source/algorithms/SANSBeamFluxCorrection-v1.rst
index bca2c39436d..92c5a8b7364 100644
--- a/Code/Mantid/docs/source/algorithms/SANSBeamFluxCorrection-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/SANSBeamFluxCorrection-v1.rst
@@ -19,4 +19,31 @@ where
 
         :math:`\Phi_{sample} = \frac{M_{sample}}{M_{ref}} \Phi_{ref}`
 
+Usage
+-----
+
+**Example - Performing a Beam Flux Correction on Dummy Data**
+
+.. testcode:: ExTable
+
+   # Create some dummy data, as well as a dummy monitor ws for EQSANS.
+   x = [1,2,3,4,5,6,7,8,9,10,11]
+   y = 491520*[0.1]
+   ws = CreateWorkspace(DataX=x,DataY=y,DataE=y,NSpec='49152',UnitX='Wavelength')
+   LoadInstrument(ws, InstrumentName="EQSANS")
+   monitor = SumSpectra(ws)
+
+   # Do the correction, dragging in the file which contains the reference flux spectrum.
+   corrected = SANSBeamFluxCorrection(ws, InputMonitorWorkspace=monitor, ReferenceFluxFilename="SANSBeamFluxCorrectionMonitor.nxs")
+
+   print "The expected value of each bin should be %s." % (0.1/(49152*0.1)/(49152*0.1))
+   print "The actual value of the first bin is %s." % corrected[0].readY(0)[0]
+
+Output:
+
+.. testoutput:: ExTable
+
+   The expected value of each bin should be 4.13921144274e-09.
+   The actual value of the first bin is 4.13921144273e-09.
+
 .. categories::
diff --git a/Test/AutoTestData/SANSBeamFluxCorrectionMonitor.nxs b/Test/AutoTestData/UsageData/SANSBeamFluxCorrectionMonitor.nxs
similarity index 100%
rename from Test/AutoTestData/SANSBeamFluxCorrectionMonitor.nxs
rename to Test/AutoTestData/UsageData/SANSBeamFluxCorrectionMonitor.nxs
-- 
GitLab