next up previous 264
Next: SourceSys - Spectral system in which the source velocity is stored
Up: AST Attribute Descriptions
Previous: SortBy - Determines how keys are sorted in a KeyMap


SourceFile - Input file from which to read data

Description:
This attribute specifies the name of a file from which the Channel should read data. If specified it is used in preference to any source function specified when the Channel was created.

Assigning a new value to this attribute will cause any previously opened SourceFile to be closed. The first subsequent call to astRead will attempt to open the new file (an error will be reported if the file cannot be opened), and read data from it. All subsequent call to astRead will read data from the new file, until the SourceFile attribute is cleared or changed.

Clearing the attribute causes any open SourceFile to be closed. All subsequent data reads will use the source function specified when the Channel was created, or will read from standard input if no source function was specified.

If no value has been assigned to SourceFile, a null string will be returned if an attempt is made to get the attribute value.

Type:
String.
Class Applicability:
FitsChan
In the case of a FitsChan, the specified SourceFile supplements the source function specified when the FitsChan was created, rather than replacing the source function. The source file should be a text file (not a FITS file) containing one header per line. When a value is assigned to SourceFile, the file is opened and read immediately, and all headers read from the file are appended to the end of any header already in the FitsChan. The file is then closed. Clearing the SourceFile attribute has no further effect, other than nullifying the string (i.e. the file name) associated with the attribute.
Notes:
  • Any open SourceFile is closed when the Channel is deleted.

  • If the Channel is copied or dumped (using astCopy or astShow) the SourceFile attribute is left in a cleared state in the output Channel (i.e. the value of the SourceFile attribute is not copied).


next up previous 264
Next: SourceSys - Spectral system in which the source velocity is stored
Up: AST Attribute Descriptions
Previous: SortBy - Determines how keys are sorted in a KeyMap

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
25th February 2013
E-mail:starlink@jiscmail.ac.uk

Copyright (C) 2014 Science \& Technology Facilities Council