.. algorithm:: .. summary:: .. relatedalgorithms:: .. properties:: Description ----------- Converts the representation of the vertical axis of a :ref:`MatrixWorkspace ` from its default of holding the spectrum number to the target unit given. The spectra will be reordered in increasing order by the new unit and 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. For units other than :math:`\theta`, the value placed in the axis is 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 {} axis values".format(vertical_axis.length())) print("Final theta value: {:.6f} (degrees)".format(vertical_axis.getValue(vertical_axis.length() - 1))) .. testoutput:: There are 4 axis values Final theta value: 0.129645 (degrees) .. categories:: .. sourcelink::