Consider, as a practical example of CmpMaps, two images of the sky. Suppose that for each image we have a MappingMapping which converts from pixel coordinates to a standard celestial coordinate system, say FK5 (J2000.0). If we wish to inter-compare these images, we can do so by using this celestial coordinate system to align them. That is, we first convert from pixel coordinates in the first image into FK5 coordinates and we then convert from FK5 coordinates into pixel coordinates in the second image.
If “mapa” and “mapb” are pointers to our two original Mappings, we could form a CmpMapCmpMap which transforms directly between the pixel coordinates of the first and second images by combining these Mappings, as follows:
Here, we have used astInvertastInvert (§5.6) to invert “mapb” before inserting it into the CmpMap because, as supplied, it converted in the wrong direction. Afterwards, we invert it again to return it to its original state. The CmpMap, however, will ignore this subsequent change (§6.3).
The forward transformation of the resulting CmpMap will now transform from pixel coordinates in the first image to pixel coordinates in the second image, while its inverse transformation will convert in the opposite direction.