Once you have converted pixel coordinates into world coordinates
(), you may want to format them as text
before displaying them. Typically, this would convert from (say)
radians into something more comprehensible. Using the FrameSet pointer
WCSINFO obtained in
and a pair of world
coordinates XW and YW (e.g. see
),
you could proceed as follows:
CHARACTER * ( 20 ) XTEXT, YTEXT DOUBLE PRECISION XW, YW ... XTEXT = AST_FORMAT( WCSINFO, 1, XW, STATUS ) YTEXT = AST_FORMAT( WCSINFO, 2, YW, STATUS ) WRITE ( *, 199 ) XTEXT, YTEXT 199 FORMAT( 'Position = ', A, ', ', A )
Here, the second argument to AST_FORMAT is the axis number.
With celestial coordinates, this will usually result in sexagesimal notation, such as ``12:34:56.7''. However, the same method may be applied to any type of coordinates and appropriate formatting will be employed.
For more information about formatting coordinate values and how to
control the style of formatting used, see
and
. If necessary, also see
for details of how to ``normalise'' a set of
coordinates so that they lie within the standard range (e.g. 0
to 24 hours for right ascension and
for
declination).
AST A Library for Handling World Coordinate Systems in Astronomy