next up previous
Next: Adapting a Transformation Routine to Individual IntraMaps
Up: Creating Your Own Private Mappings (IntraMaps)
Previous: Restricted Implementations of Transformation Routines

Variable Numbers of Coordinates  

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.



next up previous
Next: Adapting a Transformation Routine to Individual IntraMaps
Up: Creating Your Own Private Mappings (IntraMaps)
Previous: Restricted Implementations of Transformation Routines

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 210
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2003 Central Laboratory of the Research Councils