In our earlier examples, we have used a fixed number of input and
output coordinates when registering a coordinate transformation
routine. It is not necessary to impose this restriction, however, if
the transformation routine can cope with a variable number of
coordinates (as with the example in
). We indicate the acceptability of
a variable number when registering the transformation routine by
supplying the value AST__ANY for the number of input and/or output
coordinates, as follows:
CALL AST_INTRAREG( 'SqrTran', AST__ANY, AST__ANY, SQRTRAN, 0,
: PURPOSE, AUTHOR, CONTACT, STATUS )
The result is that an IntraMap may now be created with any number of input and output coordinates. For example:
INTEGER INTRAMAP1, INTRAMAP2
...
INTRAMAP1 = AST_INTRAMAP( 'SqrTran', 1, 1, ' ', STATUS )
INTRAMAP2 = AST_INTRAMAP( 'SqrTran', 3, 3, 'Invert=1', STATUS )
It is possible to fix either the number of input or output coordinates (by supplying an explicit number to AST_INTRAREG), but more subtle restrictions on the number of coordinates, such as requiring that Nin and Nout be equal, are not supported. This means that:
INTRAMAP = AST_INTRAMAP( 'SqrTran', 1, 2, ' ', STATUS )
will be accepted without error, although the transformation routine cannot actually handle such a combination sensibly. If this is important, it would be worth adding a check within the transformation routine itself, so that the error would be detected when it came to be used.
AST A Library for Handling World Coordinate Systems in Astronomy