Let us now examine the format of the textual output produced by
writing an Object to a basic Channel
(). To give a concrete example, suppose
the Object in question is a SkyFrame, written out as follows:
AstSkyFrame *skyframe; ... nobj = astWrite( channel, skyframe );
The output should then look like the following:
Begin SkyFrame # Description of celestial coordinate system # Title = "FK4 Equatorial Coordinates, no E-terms, Mean Equinox B1950.0, Epoch B1958.0" # Title of coordinate system Naxes = 2 # Number of coordinate axes # Domain = "SKY" # Coordinate system domain # Lbl1 = "Right Ascension" # Label for axis 1 # Lbl2 = "Declination" # Label for axis 2 # Uni1 = "hh:mm:ss.s" # Units for axis 1 # Uni2 = "ddd:mm:ss" # Units for axis 2 # Dir1 = 0 # Plot axis 1 in reverse direction (hint) Ax1 = # Axis number 1 Begin SkyAxis # Celestial coordinate axis End SkyAxis Ax2 = # Axis number 2 Begin SkyAxis # Celestial coordinate axis End SkyAxis IsA Frame # Coordinate system description System = "FK4-NO-E" # Celestial coordinate system type Epoch = 1958 # Besselian epoch of observation # Eqnox = 1950 # Besselian epoch of mean equinox End SkyFrame
You will notice that this output is designed both for a human reader,
in that it is formatted, and also to be read back by a computer in
order to reconstruct the SkyFrame. In fact, this is precisely the way
that astShow works (), this function being
roughly equivalent to the following use of a Channel:
channel = astChannel( NULL, NULL, "" ); (void) astWrite( channel, object ); channel = astAnnul( channel );
Some lines of the output start with a ``#
'' comment character,
which turns the rest of the line into a comment. These lines will be
ignored when read back in by astRead. They typically contain default
values, or values that can be derived in some way from the other data
present, so that they do not actually need to be stored in order to
reconstruct the original Object. They are provided purely for human
information. The same comment character is also used to append
explanatory comments to most output lines.
It is not sensible to attempt a complete description of this output format because every class of Object is potentially different and each can define how its own data should be represented. However, there are some basic rules, which mean that the following common features will usually be present:
Beyond these general principles, the best guide to what a particular
line of output represents will generally be the comment which
accompanies it together with a general knowledge of the class of
Object being described.
AST A Library for Handling World Coordinate Systems in Astronomy