If you are developing a large suite of data reduction software, you may have a need to use IntraMaps at various points within it. Very probably this will occur in unrelated modules which are compiled separately and then stored in a library. Since the transformation routines required must be registered before they can be used, this makes it difficult to decide where to perform this registration, especially since any particular data reduction program may use an arbitrary subset of the modules in your library.
To assist with this problem, AST allows you to perform the same registration of a transformation routine any number of times, so long as it is performed using an identical invocation of AST_INTRAREG on each occasion (i.e. all of its arguments must be identical). This means you do not have to keep track of whether a particular routine has already been registered but could, in fact, register it on each occasion immediately before it is required (wherever that may be). In order that all registrations are identical, however, it is recommended that you group them all together into a single routine, perhaps as follows:
SUBROUTINE MYTRANS( STATUS ) INTEGER STATUS INCLUDE 'AST_PAR' EXTERNAL MAXTRAN, POLY3TRAN, SQRTRAN ... CALL AST_INTRAREG( 'MaxTran', AST__ANY, 1, MAXTRAN, AST__SIMPIF, : PURPOSE, AUTHOR, CONTACT, STATUS ) ... CALL AST_INTRAREG( 'Poly3Tran', 1, 1, POLY3TRAN, AST__NOINV, : PURPOSE, AUTHOR, CONTACT, STATUS ) ... CALL AST_INTRAREG( 'SqrTran, 2, 2, SQRTRAN, 0, : PURPOSE, AUTHOR, CONTACT, STATUS ) END
You can then simply invoke this routine wherever necessary. It is, in fact, particularly important to register all relevant transformation routines in this way before you attempt to read an Object that might be (or contain) an IntraMap (). This is because you may not know in advance which of these transformation routines the IntraMap will use, so they must all be available in order to avoid an error.
AST A Library for Handling World Coordinate Systems in Astronomy