Source
1
-
<casaxml xsi:schemaLocation="http://casa.nrao.edu/schema/casa.xsd file:///opt/casa/code/xmlcasa/xml/casa.xsd" xmlns="http://casa.nrao.edu/schema/psetTypes.html" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2
-
3
-
4
-
5
-
6
-
7
-
<task type="function" name="imtrans" category="analysis">
8
-
9
-
<shortdescription>Reorder image axes</shortdescription>
10
-
11
-
<input>
12
-
<param type="path" name="imagename" mustexist="true"><shortdescription>Name of the input image which must be specified.</shortdescription><description>Name of the input image which must be specified.</description>
13
-
14
-
<value/>
15
-
<example>imagename='ngc5921.im'</example>
16
-
</param>
17
-
18
-
<param type="string" name="outfile"><shortdescription>Name of output CASA image.</shortdescription><description>Name of output CASA image.</description>
19
-
20
-
<value/>
21
-
<example>outfile='reordered.im'</example>
22
-
</param>
23
-
<param type="any" name="order"><shortdescription>New zero-based axes order.</shortdescription><description>New zero-based axes order.</description>
24
-
25
-
<any type="variant" limittype="string stringArray int"/>
26
-
<value type="string"/>
27
-
<example>order="120"</example>
28
-
<example>order=120</example>
29
-
<example>order=["d", "f", "r"]</example>
30
-
</param>
31
-
</input>
32
-
<returns type="bool"/>
33
-
34
-
<example>
35
-
PARAMETER SUMMARY
36
-
imagename Name of the input image
37
-
outfile Name of output CASA image. Must be specified.
38
-
order Output axes mapping
39
-
40
-
This task reorders (transposes) the axes in the input image to the specified
41
-
order. The associated pixel values and coordinate system are transposed.
42
-
43
-
The order parameter describes the mapping of the input axes to the output axes.
44
-
It can be one of three types: a non-negative integer, a string, or a list of
45
-
strings. If a string or non-negative integer, it should contain
46
-
zero-based digits describing the new order of the input axes. It must
47
-
contain the same number of (unique) digits as the number of input axes. For example,
48
-
specifying order="1032" or order=1032 for a four axes image maps input axes
49
-
1, 0, 3, 2 to output axes 0, 1, 2, 3. In the case of order being a nonnegative integer
50
-
and the zeroth axis in the input being mapped to zeroth axis in the output, the zeroth
51
-
digit is implicitly understood to be 0 so that to transpose an image where one would
52
-
use a string order="0321", one could equivalently specify an int order=321.
53
-
IMPORTANT: When specifying a non-negative integer and mapping the zeroth axis of
54
-
the input to the zeroth axis of the output, do *not* explicitly specify the leading
55
-
0; eg, specify order=321 rather than order=0321. Python interprets an integer with
56
-
a leading 0 as an octal number.
57
-
58
-
Because of ambiguity for axes numbers greater than nine, using string or integer order
59
-
specifications cannot handle images containing more than 10 axes.
60
-
The order parameter can also be specified as a list of strings which uniquely match,
61
-
ignoring case, the first characters of the image axis names (ia.coordsys().names()).
62
-
So to reorder an image with right ascension, declination, and frequency axes, one could
63
-
specify order=["d", "f", "r"] or equivalently ["decl", "frequ", "right a"]. Note that
64
-
specifying "ra" for the right ascension axis will result in an error because "ra" does
65
-
not match the first two characters of "right ascension".
66
-
Axes can be simultaneously inverted in cases where order is a string or an array of
67
-
strings by specifying negative signs in front of the axis/axes to be inverted. So,
68
-
in a 4-D image, order="-10-3-2" maps input axes 1, 0, 3, 2 to output axes 0, 1, 2, 3
69
-
and reverses the direction and values of input axes 1, 3, and 2.
70
-
EXAMPLE:
71
-
# Swap the stokes and spectral axes in an RA-Dec-Stokes-Frequency image
72
-
imagename = "myim.im"
73
-
outfile = "outim.im"
74
-
order = "0132"
75
-
imtrans()
76
-
77
-
# or
78
-
79
-
outfile = "myim_2.im"
80
-
order = 132
81
-
imtrans()
82
-
83
-
# or
84
-
85
-
outfile = "myim_3.im"
86
-
order = ["r", "d", "f", "s"]
87
-
imtrans()
88
-
89
-
# or
90
-
91
-
utfile = "myim_4.im"
92
-
order = ["rig", "declin", "frequ", "stok"]
93
-
imtrans()
94
-
95
-
</example>
96
-
97
-
</task>
98
-
99
-
</casaxml>