The transformation structures created by TRN_NEW hold information in a form which can be easily manipulated by HDS. However, this form of storage is not efficient if the transformation is to be used, perhaps repeatedly, to process large arrays of data. Therefore, before a transformation can be used to transform coordinate data, its mapping information must first be compiled using TRN_COMP (compile transformation), thus:
CALL TRN_COMP( LOCTR, FORWD, ID, STATUS )
The TRN_COMP routine accepts a locator LOCTR associated with a transformation and checks the information within it. It then compiles one of the transformation's mappings into a different form which is stored internally by the TRANSFORM facility. This internal representation is called a compiled mapping and may subsequently be used (for instance) to convert coordinate data from one coordinate system to another. The logical argument FORWD is used to specify which mapping is required - the forward mapping is compiled if this argument is .TRUE. and the inverse mapping is compiled if it is .FALSE.. An error will be reported if the requested mapping has not been defined.
Any number of transformations may be compiled by repeatedly calling TRN_COMP. To distinguish the resulting compiled mappings, a unique integer identifier is issued for each via the ID argument, and these identifiers are subsequently used to pass the mappings to other routines.
It is important to appreciate that a compiled mapping is a
``uni-directional'' object and can only perform coordinate conversion in a
single direction, whereas a transformation (which may contain up to
two mappings) is potentially ``bi-directional''.
Thus, if an [
] transformation is compiled in the
forward direction (with the FORWD argument of TRN_COMP set
to .TRUE.), then a {
} mapping will result.
Conversely, compilation in the inverse direction would yield a {
} mapping.
Note that in this latter case the numbers of input and output variables will
have been interchanged by the compilation process.
TRANSFORM Coordinate Transformation Facility