Before considering the important subject of using FrameSets to convert
between coordinate systems (), let us
return briefly to reconsider the output generated by AST_CONVERT. We
used this function earlier (
), when
converting between the coordinate systems represented by various kinds
of Frame, and indicated that it returns a FrameSet to represent the
coordinate conversion it identifies. We are now in a position to
examine the structure of this FrameSet.
Take our earlier example () of
converting between the celestial coordinate systems represented by two
SkyFrames:
INCLUDE 'AST_PAR'
INTEGER SKYFRAME1, SKYFRAME2, STATUS
STATUS = 0
...
SKYFRAME1 = AST_SKYFRAME( 'System=FK4-NO-E, Epoch=B1958, Equinox=B1960', STATUS )
SKYFRAME2 = AST_SKYFRAME( 'System=Ecliptic, Equinox=J2010.5', STATUS )
CVT = AST_CONVERT( SKYFRAME1, SKYFRAME2, ' ', STATUS )
This will produce a pointer, CVT, to the FrameSet shown in the Figure below.
As can be seen, this FrameSet contains just two Frames. The source Frame supplied to AST_CONVERT becomes its base Frame, while the destination Frame becomes its current Frame. (The FrameSet, of course, simply holds pointers to these Frames, rather than making copies.) The Mapping which relates the base Frame to the current Frame is the one which implements the required conversion.
Figure: The FrameSet produced when AST_CONVERT is used to convert between the coordinate systems represented by two SkyFrames. The source SkyFrame becomes the base Frame, while the destination SkyFrame becomes the current Frame. The Mapping between them implements the required conversion.
As we noted earlier (), the FrameSet
returned by AST_CONVERT may be used both as a Mapping and as a Frame
to perform most of the functions you are likely to need. However, the
Mapping may be extracted for use on its own if necessary, using
AST_GETMAPPING (
), for example:
INTEGER MAPPING
...
MAPPING = AST_GETMAPPING( CVT, AST__BASE, AST__CURRENT, STATUS )
AST A Library for Handling World Coordinate Systems in Astronomy