Skip to content

Commit

Permalink
re #9638 Usage example for AbsorptionCorrection
Browse files Browse the repository at this point in the history
  • Loading branch information
NickDraper committed Jun 13, 2014
1 parent 4aa765d commit b968164
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Code/Mantid/docs/source/algorithms/AbsorptionCorrection-v1.rst
Expand Up @@ -69,4 +69,33 @@ defined because detector, source & sample position are needed.

.. |AbsorptionFlow.png| image:: /images/AbsorptionFlow.png

Usage
-----

**Example: A simple spherical sample**

.. testcode:: ExSimpleSpere

#setup the sample shape
sphere = '''<sphere id="sample-sphere">
<centre x="0" y="0" z="0"/>
<radius val="0.1" />
</sphere>'''

ws = CreateSampleWorkspace("Histogram",NumBanks=1)
ws = ConvertUnits(ws,"Wavelength")
CreateSampleShape(ws,sphere)
SetSampleMaterial(ws,ChemicalFormula="V")

#restrict the number of wavelength points to speed up the example
wsOut = AbsorptionCorrection(ws,NumberOfWavelengthPoints=5)

print "The created workspace has one entry for each spectra: %i" % wsOut.getNumberHistograms()

Output:

.. testoutput:: ExSimpleSpere

The created workspace has one entry for each spectra: 100

.. categories::

0 comments on commit b968164

Please sign in to comment.