Having written your coordinate transformation routine, the next step is to register it with AST. Registration is performed using AST_INTRAREG, as follows:
EXTERNAL SQRTRAN
CHARACTER * ( 80 ) AUTHOR, CONTACT, PURPOSE
...
PURPOSE = 'Square each coordinate value'
AUTHOR = 'R.F. Warren-Smith & D.S. Berry'
CONTACT = 'http://www.starlink.rl.ac.uk/cgi-bin/htxserver/' //
'sun210.htx/?xref_SqrTran'
CALL AST_INTRAREG( 'SqrTran', 2, 2, SQRTRAN, 0,
: PURPOSE, AUTHOR, CONTACT, STATUS )
Note that the transformation routine must also appear in a Fortran EXTERNAL statement.
The first argument to AST_INTRAREG is a name by which the transformation routine will be known. This will be used when we come to create an IntraMap and is case sensitive. We recommend that you base this on the actual routine name and make this sufficiently unusual that it is unlikely to clash with any other routines in most people's software.
The next two arguments specify the number of input and output
coordinates which the transformation routine will handle. These
correspond with the Nin and Nout attributes of the IntraMap we will
create. Here, we have set them both to 2, which means that we will
only be able to create IntraMaps with 2 input and 2 output coordinates
(despite the fact that the transformation routine can actually handle
other dimensionalities). We will see later
() how to remove this
restriction.
The fourth argument should contain a set of flags which describe the
transformation routine in a little more detail. We will return to this
shortly ( &
). For now, we supply a value of zero.
The remaining arguments are character strings which document the
transformation routine, mainly for the benefit of anyone who is
unfortunate enough to encounter a reference to it in their data which
they cannot interpret. As explained above
(), you should try and avoid this, but
accidents will happen, so you should always provide strings containing
the following:
The idea is that anyone finding an IntraMap in their data, but lacking the necessary transformation routine, should be able to contact the author and make a sensible enquiry in order to obtain it. If you expect many enquiries, you may like to set up a World Wide Web page and use that instead (in the example above, we use the WWW address of the relevant part of this document).
AST A Library for Handling World Coordinate Systems in Astronomy