Skip to content

Commit

Permalink
Usage Example for NormaliseByCurrent re #10052
Browse files Browse the repository at this point in the history
Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Sep 22, 2014
1 parent 1e32352 commit b9788ce
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Code/Mantid/docs/source/algorithms/NormaliseByCurrent-v1.rst
Expand Up @@ -34,4 +34,41 @@ the output will be as well. Weighted events are used to scale by the
current (see the :ref:`algm-Divide` algorithm, which is a child
algorithm being used).

Usage
-----

**Example - Normalise by Current simple workspace**

.. testcode:: exNormaliseByCurrentSimple

# Create two workspaces
ws = CreateWorkspace(DataX=range(0,3), DataY=(17,12))

# Add Good Proton Charge Log
AddSampleLog(Workspace=ws, LogName='gd_prtn_chrg', LogText='10.0', LogType='Number')

# Fetch the generated logs
run1 = ws.getRun()
log_p = run1.getLogData('gd_prtn_chrg')

# Print the log value
print "Good Proton Charge =",log_p.value

#Run the Algorithm
wsN = NormaliseByCurrent(ws)

#Print results
print "Before normalisation", ws.readY(0);
print "After normalisation ", wsN.readY(0);


Output:

.. testoutput:: exNormaliseByCurrentSimple

Good Proton Charge = 10.0
Before normalisation [ 17. 12.]
After normalisation [ 1.7 1.2]


.. categories::

0 comments on commit b9788ce

Please sign in to comment.