Skip to content

Commit

Permalink
Refs #9587 - Docs for ConvertSpectrumAxis V1.
Browse files Browse the repository at this point in the history
Shamelessly steal from Martyns V2 docs.
  • Loading branch information
PeterParker committed Jun 12, 2014
1 parent 995fecd commit 1f74f41
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Code/Mantid/docs/source/algorithms/ConvertSpectrumAxis-v1.rst
Expand Up @@ -23,4 +23,25 @@ generated by using the :ref:`algm-ConvertUnits` methods to
translate the values of the first and last bin for the current X-data
unit into the target unit, then taking the mid-point of these.

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", Version=1)

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)

.. categories::

0 comments on commit 1f74f41

Please sign in to comment.