Next: The Component Mappings
Up: Compound Mappings (CmpMaps)
Previous: Combining Mappings in Series

## Combining Mappings in Parallel

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 = AST_CMPMAP( PERMMAP, ZOOMMAP, .FALSE., ' ', STATUS )
```

The only difference is that the third argument of AST_CMPMAP is now .FALSE., 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.

Next: The Component Mappings
Up: Compound Mappings (CmpMaps)
Previous: Combining Mappings in Series

AST A Library for Handling World Coordinate Systems in Astronomy