By default, when you use AST_READ to read from a basic Channel (), it is assumed that you are reading a stream of text containing only AST Objects, which follow each other end-to-end. If any extraneous input data are encountered which do not appear to form part of the textual description of an Object, then an error will result. In particular, the first input line must identify the start of an Object description, so you cannot start reading half way through an Object.
Sometimes, however, you may want to store AST Object descriptions intermixed with other textual data. You can do this by setting the Channel's boolean (integer) Skip attribute to 1. This will cause every read to skip over extraneous data until the start of a new AST Object description, if any, is found. So long as your other data do not mimic the appearance of an AST Object description, the two sets of data can co-exist.
For example, by setting Skip to 1, the following complete Fortran program will read all the AST Objects whose descriptions appear in the source of this document, ignoring the other text. AST_SHOW is used to display those found:
INCLUDE 'AST_PAR' INTEGER CHANNEL, OBJECT, STATUS STATUS = 0 CHANNEL = AST_CHANNEL( AST_NULL, AST_NULL, 'Skip=1', STATUS ) 1 OBJECT = AST_READ( CHANNEL, STATUS ) IF ( OBJECT .NE. AST__NULL ) THEN CALL AST_SHOW( OBJECT, STATUS ) CALL AST_ANNUL( OBJECT, STATUS ) GO TO 1 END IF CALL AST_ANNUL( CHANNEL, STATUS ) END
AST A Library for Handling World Coordinate Systems in Astronomy