### AST_CMPMAP

Create a CmpMap

#### Description:

This function creates a new CmpMap and optionally initialises its attributes.

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 " in series" (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.

#### Invocation

RESULT = AST_CMPMAP( MAP1, MAP2, SERIES, OPTIONS, STATUS )

#### Arguments

##### MAP1 = INTEGER (Given)
Pointer to the first component Mapping.
##### MAP2 = INTEGER (Given)
Pointer to the second component Mapping.
##### SERIES = LOGICAL (Given)
If a .TRUE. value is given for this argument, the two component Mappings will be connected in series. A .FALSE. value requests that they are connected in parallel.
##### OPTIONS = CHARACTER $\ast$ ( $\ast$ ) (Given)
A character string containing an optional comma-separated list of attribute assignments to be used for initialising the new CmpMap. The syntax used is identical to that for the AST_SET routine.
##### STATUS = INTEGER (Given and Returned)
The global status.

#### Returned Value

##### AST_CMPMAP = INTEGER
A pointer to the new CmpMap.

#### Notes:

• 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 AST_CMPMAP (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 AST_COPY.

• A null Object pointer (AST__NULL) will be returned if this function is invoked with STATUS set to an error value, or if it should fail for any reason.