The ability to simplify compound Mappings is provided by the
AST_SIMPLIFY 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,
AST_SIMPLIFY 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 AST_SIMPLIFY works, consider the combination of Mappings shown in the Figure below.
If this were contained in a CmpMap, it could be simplified as follows:
INTEGER SIMPLER ... SIMPLER = AST_SIMPLIFY( CMPMAP, STATUS );
In this case, the result would be a simple 3-dimensional UnitMap (the identity Mapping). To reach this conclusion, AST_SIMPLIFY will have made a number of deductions, roughly as follows:
This example is a little contrived, but illustrates how AST_SIMPLIFY 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, AST_SIMPLIFY will just return a pointer to the original Mapping.
Although AST_SIMPLIFY cannot identify every simplification that is theoretically possible, sufficient rules are included to deal with the most common and important cases.
AST A Library for Handling World Coordinate Systems in Astronomy