Skip to content

Commit

Permalink
Add usage examples for ConvertSpectrumAxis2
Browse files Browse the repository at this point in the history
Refs #9574
  • Loading branch information
martyngigg committed Jun 10, 2014
1 parent 466b263 commit 1983a35
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Code/Mantid/docs/source/algorithms/ConvertSpectrumAxis-v2.rst
Expand Up @@ -19,4 +19,43 @@ duplicates will not be aggregated. Any spectrum for which a detector is
not found (i.e. if the instrument definition is incomplete) will not
appear in the output workspace.

Usage
-----

**Example: Convert vertical axis to theta**

.. testcode::

# Creates a workspace with some detectors attached
dataws = CreateSampleWorkspace(NumBanks=1,BankPixelWidth=2) # 2x2 detector

theta = ConvertSpectrumAxis(dataws, Target="Theta")

vertical_axis = theta.getAxis(1)
print "There are %d axis values" % vertical_axis.length()
print "Final theta value: %f (degrees)" % vertical_axis.getValue(vertical_axis.length() - 1)

.. testoutput::

There are 4 axis values
Final theta value: 0.129645 (degrees)

**Example: Convert vertical axis to elastic Q for direct geometry**

.. testcode::

# Creates a workspace with some detectors attached
dataws = CreateSampleWorkspace(NumBanks=1,BankPixelWidth=2) # 2x2 detector

qws = ConvertSpectrumAxis(dataws, Target="ElasticQ", EFixed=15., EMode="Direct")

vertical_axis = qws.getAxis(1)
print "There are %d axis values" % vertical_axis.length()
print "Final Q value: %f (A^-1)" % vertical_axis.getValue(vertical_axis.length() - 1)

.. testoutput::

There are 4 axis values
Final Q value: 0.006088 (A^-1)

.. categories::

0 comments on commit 1983a35

Please sign in to comment.