next up previous
Next: Representing Coordinate Systems (Frames)
Up: Compound Mappings (CmpMaps)
Previous: Over-Complex Compound Mappings

Simplifying Compound Mappings  

The ability to simplify compound Mappings is provided by the astSimplify function. This function encapsulates a number of heuristics for converting Mappings, or combinations of Mappings within a CmpMap, into simpler, equivalent ones. When applied to a CmpMap, astSimplify tries to reduce the number of individual Mappings within it by merging neighbouring component Mappings together. It will do this with both series and parallel combinations of Mappings, or both, and will handle CmpMaps nested to any depth ([*]).

To illustrate how astSimplify works, consider the combination of Mappings shown in the Figure below.


  
Figure: An over-complex compound Mapping, consisting of PermMaps, ZoomMaps and a UnitMap, which can be simplified to become a single UnitMap. The enclosing nested CmpMaps have been omitted for clarity.
\begin{figure}
\includegraphics [scale=1.1]{sun211_figures/simpexamp.eps}

 \end{figure}

If this were contained in a CmpMap, it could be simplified as follows:

AstMapping *simpler;

...

simpler = astSimplify( cmpmap );

In this case, the result would be a simple 3-dimensional UnitMap (the identity Mapping). To reach this conclusion, astSimplify will have made a number of deductions, roughly as follows:

1.
The two 2-dimensional ZoomMaps in series are equivalent to a single ZoomMap with a combined Zoom factor of unity. This, in turn, is equivalent to a 2-dimensional UnitMap.
2.
This UnitMap in parallel with the other 1-dimensional UnitMap is equivalent to a single 3-dimensional UnitMap. This UnitMap, sandwiched between any other pair of Mappings, can then be eliminated.

3.
The remaining two PermMaps in series are equivalent to a single 3-dimensional PermMap. When these are combined, the resulting PermMap is found to be equivalent to a 3-dimensional UnitMap.

This example is a little contrived, but illustrates how astSimplify can deal with even quite complicated compound Mappings through a series of incremental simplifications. Where possible, this will result in either a simpler compound Mapping or, if feasible, an atomic (non-compound) Mapping, as here. If no simplification is possible, astSimplify will just return a pointer to the original Mapping.

Although astSimplify cannot identify every simplification that is theoretically possible, sufficient rules are included to deal with the most common and important cases.



next up previous
Next: Representing Coordinate Systems (Frames)
Up: Compound Mappings (CmpMaps)
Previous: Over-Complex Compound Mappings

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