aboutsummaryrefslogtreecommitdiff
path: root/docs/source/operations/conversions/axisswap.rst
blob: b8d606ff2049c141851aa4fa7f7a433a8be1359c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.. _axisswap:

================================================================================
Axis swap
================================================================================

.. versionadded:: 5.0.0

Change the order and sign of 2,3 or 4 axes.

+---------------------+--------------------------------------------------------+
| **Alias**           | axisswap                                               |
+---------------------+--------------------------------------------------------+
| **Domain**          | 2D, 3D or 4D                                           |
+---------------------+--------------------------------------------------------+
| **Input type**      | Any                                                    |
+---------------------+--------------------------------------------------------+
| **Output type**     | Any                                                    |
+---------------------+--------------------------------------------------------+


Each of the possible four axes are numbered with 1--4, such that the first input axis
is 1, the second is 2 and so on. The output ordering is controlled by a list of the
input axes re-ordered to the new mapping.

Usage
################################################################################

Reversing the order of the axes::

    +proj=axisswap +order=4,3,2,1

Swapping the first two axes (x and y)::

    +proj=axisswap +order=2,1,3,4

The direction, or sign, of an axis can be changed by adding a minus in
front of the axis-number::

    +proj=axisswap +order=1,-2,3,4

It is only necessary to specify the axes that are affected by the swap
operation::

    +proj=axisswap +order=2,1

Parameters
################################################################################

.. option:: +order=<list>

    Ordered comma-separated list of axis, e.g. *+order=2,1,3,4*.
    Adding a minus in front of an axis number results in a change of direction
    for that axis, e.g. southward instead of northward.

    *Required.*