next up previous
Next: Restricted Implementations of Transformation Functions
Up: Creating Your Own Private Mappings (IntraMaps)
Previous: Registering a Transformation Function

Creating an IntraMap

Once a transformation function has been registered, creating an IntraMap from it is simple:

AstIntraMap *intramap;

...

intramap = astIntraMap( "SqrTran", 2, 2, "" );

We simply use the astIntraMap constructor function and pass it the name of the transformation function to use. This name is the same (case sensitive) one that we associated with the function when we registered it using astIntraReg ([*]).

You can, of course, register any number of transformation functions and select which one to use whenever you create an IntraMap. You can also create any number of independent IntraMaps using each transformation function. In this sense, each transformation function you register effectively creates a new ``sub-class'' of IntraMap, from which you can create Objects just like any other class. However, an error will occur if you attempt to use a transformation function that has not yet been registered.

The second and third arguments to astIntraMap are the numbers of input and output coordinates. These define the Nin and Nout attributes for the IntraMap that is created and they must match the corresponding numbers given when the transformation function was registered.

The final argument is the usual attribute initialisation string. You may set attribute values for an IntraMap in exactly the same way as for any other Mapping ([*], and also see [*]).



next up previous
Next: Restricted Implementations of Transformation Functions
Up: Creating Your Own Private Mappings (IntraMaps)
Previous: Registering a Transformation Function

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
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