next up previous
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 (x1,x2,x3) transforms into (x2,x1,5x3). 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.



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

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2003 Central Laboratory of the Research Councils