NMRPipe Processing Functions
TP: 2D Plane Transpose (Also: YTP)

TP exchanges the current XAxis of the data stream with the current YAxis, so that vectors from the YAxis of 2D plane can be processed. It is a key function for processing 2D data, and also commonly used for 3D and 4D schemes.
The details of how the transpose is performed depend on the real and imaginary parts of the two dimensions. In most cases, these details are handled automatically, so that in most schemes, the TP function is used without arguments, as in these basic outlines of common 2D processing schemes:
FT  PS di  TP  FT  PS di
FT  PS di  TP  FT real  PS di
FT  TP  FT  MC
OPTIONS
hyper
Use this flag for applying 2D transpose to hypercomplex planes (i.e.
planes where both dimensions have their own real and imaginary data).
nohdr
By default, TP will toggle the header value FDTRANSPOSED between 0 and
1 each time it is applied. This value is sometimes used by graphical
applications like nmrDraw to decide whether the XAxis should be drawn as
the horizontal dimension of a 2D plot, or the vertical dimension;
in the NMRPipe convention, the directlydetected dimension is
usually drawn as the horizontal axis, regardless of whether
a data plane is transposed.
If the nohdr
flag is used, the FDTRANSPOSED header
value will not be updated. This flag is not often used, but can
find use in schemes which create 2D planes where both dimensions
are indirect dimensions, so that there is no predefined convention
about which dimension should be the horizontal dimension of a plot.
auto
This flag will automatically select a hypercomplex TP if the
data type is hypercomplex. It is not often used.
EXAMPLES
In a typical 2D hypercomplex processing scheme, TP is used is to exchange the XAxis (the directlydetected dimension) and the YAxis (the indirect dimension). The TP is applied after the direct dimension has been transformed and phasecorrected, and the imaginary part has been deleted. The transpose will commonly be used a second time after the indirect dimension is processed, so that automated baseline correction can be applied effectively to the directlydetected dimension.
nmrPipe in fid/test001.fid \  nmrPipe fn SOL \  nmrPipe fn SP off 0.5 end 0.98 pow 2 c 0.5 \  nmrPipe fn ZF auto \  nmrPipe fn FT \  nmrPipe fn PS p0 43 p1 0.0 di \  nmrPipe fn EXT x1 11.5ppm xn 5.5ppm sw \  nmrPipe fn TP \  nmrPipe fn SP off 0.5 end 0.98 pow 1 c 1.0 \  nmrPipe fn ZF auto \  nmrPipe fn FT \  nmrPipe fn PS p0 135 p1 180 di \  nmrPipe fn TP \  nmrPipe fn POLY auto \ out test.ft2 verb ov
If desired, the indirect dimension of a 2Dhypercomplex FID can
be processed first, as in this scheme. Here, TP hyper
is first used to transpose the 2D FID:
nmrPipe in fid/test001.fid \  nmrPipe fn TP hyper \  nmrPipe fn SP off 0.5 end 0.98 pow 1 c 1.0 \  nmrPipe fn ZF auto \  nmrPipe fn FT \  nmrPipe fn PS p0 135 p1 180 di \  nmrPipe fn TP \  nmrPipe fn SOL \  nmrPipe fn SP off 0.5 end 0.98 pow 2 c 0.5 \  nmrPipe fn ZF auto \  nmrPipe fn FT \  nmrPipe fn PS p0 43 p1 0.0 di \  nmrPipe fn EXT x1 11.5ppm xn 5.5ppm sw \  nmrPipe fn POLY auto \ out test.ft2 verb ov
A 2D realonly spectrum like the ones produced in the two examples above can be inverseprocessed to create a 2D hypercomplex FID. In this inverse scheme, the data is first transposed in order to process the indirect dimension first. Then, the first HT function adds imaginary data to the indirect dimension. The generic nmrPipe flag "ad" then makes room for additional imaginary data associated with the direct dimension. At this point, the data is hypercomplex (i.e. it has real and imaginary parts for both dimensions) but only the indirect dimension has valid imaginary data, while the direct dimension has zeros in its imaginary part. It is not until the second HT that the direct dimension has valid imaginary data:
nmrPipe in test.ft2 \  nmrPipe fn TP \  nmrPipe fn HT auto verb \  nmrPipe fn PS inv hdr \  nmrPipe fn FT inv \  nmrPipe fn ZF inv \  nmrPipe fn APOD inv hdr ad \  nmrPipe fn TP hyper \  nmrPipe fn HT auto verb \  nmrPipe fn PS inv hdr \  nmrPipe fn FT inv \  nmrPipe fn ZF inv \  nmrPipe fn APOD inv hdr \ out test.fid ovThis typical 2D Magnitudemode (absolute value) scheme uses no phase correction, but instead used MC (magnitude calculation) as a final step:
nmrPipe in test.fid \  nmrPipe fn SP off 0.05 end 0.95 \  nmrPipe fn ZF auto \  nmrPipe fn FT \  nmrPipe fn TP \  nmrPipe fn SP off 0.05 end 0.95 \  nmrPipe fn ZF auto \  nmrPipe fn FT neg \  nmrPipe fn MC \ out test.ft2 ov
This is a variation on the typical 3D HNdetected processing scheme, in this case using both TP and ZTP to processes the 3D data without the need to save an intermediate result. In this scheme, the order of the dimensions is unchanged.
xyz2pipe in fid/test%03d.fid x verb \  nmrPipe fn SOL \  nmrPipe fn SP off 0.5 end 0.98 pow 2 c 0.5 \  nmrPipe fn ZF \  nmrPipe fn FT \  nmrPipe fn PS p0 43 p1 0.0 di \  nmrPipe fn EXT left sw \  nmrPipe fn TP \  nmrPipe fn SP off 0.5 end 0.98 pow 1 c 1.0 \  nmrPipe fn ZF \  nmrPipe fn FT \  nmrPipe fn PS p0 135 p1 180 di \  nmrPipe fn TP \  nmrPipe fn POLY auto \  nmrPipe fn TP \  nmrPipe fn ZTP \  nmrPipe fn SP off 0.5 end 0.98 pow 1 c 0.5 \  nmrPipe fn ZF \  nmrPipe fn FT \  nmrPipe fn PS p0 0.0 p1 0.0 di \  pipe2xyz out ft/test%03d.ft3 z
HEADER VALUES
TP will exchange the dimension code values in FDDIMORDER1 and FDDIMORDER2
to indicate the change in which dimensions are stored in the result.
TP will also toggle the value for FDTRANSPOSED, unless the nohdr
argument is given.
It will also exchange the NDSIZE values for the XAxis and YAxis.
In the special case of a hypercomplex transform, the new NDSIZE value
for the XAxis will be 1/2 of the old YAxis value, and the new YAxis
value will be 2 times the old XAxis value; this factoroftwo adjustment
accounts for the fact that NMRPipe format data has separated real and imaginary
data in the XAxis, but interleaved real and imaginary data in the
remaining dimensions.