readFITSheader
reads the data from the header part of a FITS
Header and Data Unit. In addition to general header information, it
provides parameters needed to read image and binary table files by
functions readFITSarray
and readFITSbintable
. A header
unit may exist without a corresponding data unit, for instance to
carry additional coordinate information.
The maxLines variable limits the number of header lines
readFITSheader
will read to prevent endless reading if the
header is flawed and the END
statement is missing. The function generates a message an halts when the
number of reads exceeds maxLines. Increase the value as
needed for very large headers.
fixHdr attempts to fix headers with non-printing characters,
either by removing them with fixHdr = 'remove'
, reading further
into the file until 2880 valid characters are present, or by
substituting spaces for non-printing characters with fixHdr =
'substitute'
. This option should be used with caution, as non-printing
characters should not be in the header in the first place, so this
option may or may not corrupt the following data. The default is
fixHdr = 'none'
. Partial matching is allowed.
The header vector does not have an easy format for
people to read (graphical FITS viewers like fv and
SAOImage DS9 are good for this),
but is designed for further processing
by R. The header vector has a kind of
keyword value keyword value …
format, where keywords without values are simply followed by the next
keyword. This means a search for a keyword will give the corresponding
value as the next element in the vector; see the Examples.