The FrameSet class inherits properties and behaviour from the Frame
class () and, in turn, from the Mapping class
(
). Its behaviour when used as a Mapping is
particularly important.
Consider, for instance, passing a FrameSet pointer to a coordinate transformation routine such as AST_TRAN2:
INTEGER N
DOUBLE PRECISION XIN( N ), YIN( N )
DOUBLE PRECISION XOUT( N ), YOUT( N )
...
CALL AST_TRAN2( FRAMESET, N, XIN, YIN, .TRUE., XOUT, YOUT, STATUS )
The coordinate transformation applied by this FrameSet would be the
one which converts between its base and current Frames. Using the
FrameSet in Figure , for example, the coordinates
would be multiplied by a factor of 5. If we instead requested the
FrameSet's inverse transformation, we would be transforming from its
current Frame to its base Frame, so our example FrameSet would then
multiply by a factor of 0.2.
Whenever the choice of base and current Frames changes, the transformations which a FrameSet performs when used as a Mapping also change to reflect this. The Nin and Nout attributes may also change in consequence, because they are determined by the numbers of axes in the FrameSet's base and current Frames respectively. These numbers need not necessarily be equal, of course.
Like any Mapping, a FrameSet may also be inverted by changing the
boolean sense of its Invert attribute, e.g. using AST_INVERT
(). If this is happens, the values of the
FrameSet's Base and Current attributes are interchanged, along with
its Nin and Nout attributes, so that its base and current Frames swap
places. When used as a Mapping, the FrameSet will therefore perform
the inverse transformation to that which it performed previously.
To summarise, a FrameSet may be used exactly like any other Mapping which inter-relates the coordinate systems described by its base and current Frames.
AST A Library for Handling World Coordinate Systems in Astronomy