The process of creating a Channel is straightforward. As you might expect, it uses the constructor function AST_CHANNEL:
INCLUDE 'AST_PAR'
INTEGER CHANNEL, STATUS
STATUS = 0
...
CHANNEL = AST_CHANNEL( AST_NULL, AST_NULL, ' ', STATUS )
The first two arguments to AST_CHANNEL specify the external source
and sink that the Channel is to use. There arguments are the names of
Fortran subroutines and we will examine their use in more detail later
( and
).
In this very simple example we have supplied the name of the null
routine AST_NULL for both
the source and sink routines. This requests the default behaviour,
which means that textual input will be read from the program's
standard input stream (typically, this means your keyboard) while
textual output will go to the standard output stream (typically
appearing on your screen). On UNIX systems, of course, either of these
streams can easily be redirected to files.
AST A Library for Handling World Coordinate Systems in Astronomy