A CmpMap is a compound Mapping which allows two component Mappings (of any class) to be
connected together to form a more complex Mapping. This connection may either be
" (where the first Mapping is used to transform the coordinates of each point and
the second mapping is then applied to the result), or
" in parallel
" (where one Mapping
transforms the earlier coordinates for each point and the second Mapping simultaneously
transforms the later coordinates).
Since a CmpMap is itself a Mapping, it can be used as a component in forming further CmpMaps. Mappings of arbitrary complexity may be built from simple individual Mappings in this way.
"format specifiers identified by
"symbols in the normal way.
"format specifiers, then an optional list of additional arguments may follow it in order to supply values to be substituted for these specifiers. The rules for supplying these are identical to those for the astSet function (and for the C
If the component Mappings are connected in series, then using the resulting CmpMap to transform coordinates will cause the first Mapping to be applied, followed by the second Mapping. If the inverse CmpMap transformation is requested, the two component Mappings will be applied in both the reverse order and the reverse direction.
When connecting two component Mappings in series, the number of output coordinates generated by the first Mapping (its Nout attribute) must equal the number of input coordinates accepted by the second Mapping (its Nin attribute).
If the component Mappings of a CmpMap are connected in parallel, then the first Mapping will be used to transform the earlier input coordinates for each point (and to produce the earlier output coordinates) and the second Mapping will be used simultaneously to transform the remaining input coordinates (to produce the remaining output coordinates for each point). If the inverse transformation is requested, each Mapping will still be applied to the same coordinates, but in the reverse direction.
When connecting two component Mappings in parallel, there is no restriction on the number of input and output coordinates for each Mapping.
Note that the component Mappings supplied are not copied by astCmpMap (the new CmpMap simply retains a reference to them). They may continue to be used for other purposes, but should not be deleted. If a CmpMap containing a copy of its component Mappings is required, then a copy of the CmpMap should be made using astCopy.
A null Object pointer (AST__NULL) will be returned if this function is invoked with the AST error status set, or if it should fail for any reason.