From b97e3a1671ccb5f0d4d53d6f640bf4eebec05a0c Mon Sep 17 00:00:00 2001
From: Nick Draper <nick.draper@stfc.ac.uk>
Date: Thu, 19 Jun 2014 17:28:20 +0100
Subject: [PATCH] re #9612 done all of them, although some were put into
 another ticket

---
 .../source/algorithms/CompressEvents-v1.rst   | 29 +++++++++++++
 .../source/algorithms/FilterByLogValue-v1.rst |  5 +--
 .../algorithms/ReplaceSpecialValues-v1.rst    | 42 +++++++++++++++++++
 3 files changed, 72 insertions(+), 4 deletions(-)

diff --git a/Code/Mantid/docs/source/algorithms/CompressEvents-v1.rst b/Code/Mantid/docs/source/algorithms/CompressEvents-v1.rst
index 181f03cac27..adfa3d22c91 100644
--- a/Code/Mantid/docs/source/algorithms/CompressEvents-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/CompressEvents-v1.rst
@@ -31,4 +31,33 @@ with/without compression are identical. If your workspace has undergone
 changes to its X values (unit conversion for example), you have to use
 your best judgement for the Tolerance value.
 
+
+Usage
+-----
+
+**Example**  
+
+.. testcode:: CompressEvents
+
+    ws = CreateSampleWorkspace("Event",BankPixelWidth=1)
+
+    print "The unfiltered workspace %s has %i events and a peak value of %.2f" % (ws, ws.getNumberEvents(),ws.readY(0)[50]) 
+  
+    ws = CompressEvents(ws)
+
+    print "The compressed workspace %s still has %i events and a peak value of %.2f" % (ws, ws.getNumberEvents(),ws.readY(0)[50])     
+    print "However it now takes up less memory."
+ 
+
+Output:
+
+.. testoutput:: CompressEvents
+    :options: +NORMALIZE_WHITESPACE
+
+    The unfiltered workspace ws has 8000 events and a peak value of 1030.00
+    The compressed workspace ws still has 8000 events and a peak value of 1030.00
+    However it now takes up less memory.
+
+
+
 .. categories::
diff --git a/Code/Mantid/docs/source/algorithms/FilterByLogValue-v1.rst b/Code/Mantid/docs/source/algorithms/FilterByLogValue-v1.rst
index d05410340f1..b69620d3b00 100644
--- a/Code/Mantid/docs/source/algorithms/FilterByLogValue-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/FilterByLogValue-v1.rst
@@ -89,6 +89,7 @@ Usage
 .. testcode:: Filter
 
    ws = CreateSampleWorkspace("Event",BankPixelWidth=1)
+
    AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:00:00", Value=100) 
    AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:10:00", Value=100)
    AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:20:00", Value=100)
@@ -96,12 +97,8 @@ Usage
    AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:40:00", Value=15)
    AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:50:00", Value=100)
 
-   print "The unfiltered workspace %s has %i events and a peak value of %.2f" % (ws, ws.getNumberEvents(),ws.readY(0)[50])     
 
-   wsOut = FilterByLogValue(ws,"proton_charge",MinimumValue=75, MaximumValue=150)
 
-   print "The filtered workspace %s has %i events and a peak value of %.2f" % (wsOut, wsOut.getNumberEvents(),wsOut.readY(0)[50])     
- 
 
 Output:
 
diff --git a/Code/Mantid/docs/source/algorithms/ReplaceSpecialValues-v1.rst b/Code/Mantid/docs/source/algorithms/ReplaceSpecialValues-v1.rst
index f36a51fd417..2bd41acc7c4 100644
--- a/Code/Mantid/docs/source/algorithms/ReplaceSpecialValues-v1.rst
+++ b/Code/Mantid/docs/source/algorithms/ReplaceSpecialValues-v1.rst
@@ -20,4 +20,46 @@ case it would not be checking anything.
 
 Algorithm is now event aware.
 
+Usage
+-----
+
+**Example**  
+
+.. testcode:: replaceSV
+
+   import numpy as np
+   ws = CreateSampleWorkspace(BankPixelWidth=1)
+
+   yArray = np.array(ws.readY(0))
+   yArray[0] = 8e80
+   yArray[1] = float("inf")
+   yArray[2] = float("-inf")
+   yArray[3] = float("NaN")
+   ws.setY(0,yArray)
+  
+   ws = ReplaceSpecialValues(ws,NaNValue=0,InfinityValue=1000,
+    BigNumberThreshold=1000, BigNumberValue=1000)
+
+   print "i\tBefore\tAfter"   
+   print "-\t------\t-----"
+   for i in range(4):
+       print "%i\t%s\t%s" % (i, yArray[i],ws.readY(0)[i])     
+ 
+
+Output:
+
+.. testoutput:: replaceSV
+    :options: +NORMALIZE_WHITESPACE
+
+
+i       Before  After
+-       ------  -----
+0       8e+80   1000.0
+1       inf     1000.0
+2       -inf    1000.0
+3       nan     0.0
+
+
+
+
 .. categories::
-- 
GitLab