Transpose v1

../_images/Transpose-v1_dlg.png

Transpose dialog.

Summary

Transposes a workspace, so that an N1 x N2 workspace becomes N2 x N1.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory The input workspace.
OutputWorkspace Output MatrixWorkspace Mandatory The output workspace.

Description

This algorithm transposes a workspace, so that an N1 x N2 workspace becomes N2 x N1.

The X-vector values for the new workspace are taken from the axis values of the old workspace, which is generaly the spectra number but can be other values, if say the workspace has gone through ConvertSpectrumAxis.

Warning

The new axis values are taken from the previous X-vector values for the first specrum in the workspace. For this reason, use with ragged workspaces is undefined.

For transposing multidimensional workspaces use TransposeMD.

Usage

# Create a workspace with 2 banks and 4 pixels per bank (8 spectra)
# and X axis with 100 bins
ws = CreateSampleWorkspace(BankPixelWidth=2)
print "Rank before = (", ws.getNumberHistograms(), ",", ws.blocksize(), ")"
ws = Transpose(ws)
print "Rank after = (", ws.getNumberHistograms(), ",", ws.blocksize(), ")"

Output:

Rank before = ( 8 , 100 )
Rank after = ( 100 , 8 )

Categories: Algorithms | Transforms | Axes

Source

C++ source: Transpose.cpp

C++ header: Transpose.h