Connecting two Mappings in series () is not the only way of combining them. The alternative, in parallel, involves applying the two Mappings at once but on different subsets of the coordinate values.
Consider, for example, a set of 3-dimensional coordinates and suppose we wish to transform them by swapping the first two coordinate values and multiplying the final one by 5, so that () transforms into (). Again, we can perform each of these steps individually using exactly the same PermMap and ZoomMap as used earlier (). In this case, however, these individual Mappings are applied in parallel (c.f. Figure ).
Creating a CmpMap for this purpose is also very simple:
cmpmap = astCmpMap( permmap, zoommap, 0, "" );
The only difference is that the third argument of astCmpMap is now zero, meaning ``in parallel''.
As before, the order in which the two component Mappings are supplied is significant. The first one acts on the lower-numbered input coordinate values (however many it needs) and produces the lower-numbered output coordinates, while the second Mapping acts on the higher-numbered input coordinates (however many remain) and generates the remaining higher-numbered output coordinates. When the CmpMap transforms coordinates in the inverse direction, both component Mappings are applied to the same coordinates, but in the inverse direction.
Note that the Nin and Nout attributes of the component Mappings
(i.e. the numbers of input and output coordinates) will sum to
give the Nin and Nout attributes of the overall CmpMap.
AST A Library for Handling World Coordinate Systems in Astronomy