The header consists of 36 card images of 80 bytes each, for a total of 36 x 80 = 2880 bytes, which is an integer multiple of 36 card images. Figure 3.1 shows a typical FITS header containing 16 card images with keywords; the complete FITS header includes an additional 20 card images containing the ASCII space character (20 hex) to round out the length of the header to a total of 2880 bytes.
The header format looks almost trivially easy, and it is easy. Humans can easily read the header and make good sense of it. However, just one misplaced character is enough to trip up an unwary computer program. The FITS standard specifies every detail in the header to make FITS computer-friendly.
Keywords. Every card image begins with a keyword in bytes 1 through 8. The keyword identifies what sort of information appears in the rest of the card image. BITPIX, for example, tells how many bits are in the data, and OBJECT specifies the name of the object observed.
Keywords must be left-justified, 8-character ASCII strings with no embedded blanks, and if the keyword is less than 8 characters long, the space must be filled with ASCII blanks (20 hex). Keywords may contain upper-case characters A through Z, the digits 0 through 9, and the period and hyphen characters, but no others.
Value Indicator. For keywords that have an associated value, bytes 9 and 10 must contain the ASCII string "= " (equal sign and space) followed by a properly formatted numerical value (a number) or a string value (usually words). For example, in Figure 3.1 the keyword NAXIS has an associated value and must be followed by a value indicator and a numerical value.
If the keyword has no associated value, bytes 9 and 10 may contain any ASCII characters. If the keyword does not require a value, then bytes 9 through 80 may contain any ASCII text. The keywords COMMENT and HISTORY do not have associated values so they do not require a value indicator, and they can be followed by any ASCII text.
Values. The value follows a value indicator and contains the value of the keyword. The value is the ASCII representation of a number or string. Both numbers and strings must be formatted according to the FITS standard. Numerical information is right-justified between bytes 11 and 30, and character strings begin with a single quote mark at byte 11 and cannot extend beyond byte 80.
Comments. An optional comment follows the value itself. The FITS standard encourages programmers to separate the comment from the value by a space followed by slash. Since comments are intended for human readers, their format is not specified except that a comment must not extend beyond the end of the card image.
Chapter 3: Digital Image Formats 3.4.1 Mandatory Keywords
Certain keywords that are used to describe the structure of the file are mandatory. These keywords must be used exactly as described in the FITS standard. They are required in all FITS headers. The card images in the header of a CCD image must contain the keywords in this order:
Each keyword requires an 80-character card image. The mandatory card images are followed by enough card images of the ASCII blank character (20 hex) to bring the total number of card images to 36, for a header 2,880 bytes long.
SIMPLE . (Associated value is Boolean.) This is the first keyword in every FITS file. The value is the logical constant with the logical value T (true) if the file conforms to the FITS standard. The T must appear at byte 30. A logical value of F (false) signifies that the file fails to conform to the FITS standard in a significant way, such as storing array data in a signed or byte-reversed format.
BITPIX. (Associated value is Integer.) This is the second keyword in any FITS file. The value is an integer that specifies the number of bits representing a data value. Basic FITS can store both integer and floating-point values, but amateur astronomers will seldom need to store CCD images as floating-point data.
NAXIS. (Associated value is Integer.) This is the third keyword in any FITS file. The value is the number of axes in the data array. A value of zero signifies that no data follow the header. For one-dimensional data, such as intensity values in a spectrum, the value is 1. Image data are two dimensional, some number of samples wide by some number of lines deep, so the value should be 2. Color images can be stored in three-dimensional arrays of samples, lines, and colors, with a value of 3. Although FITS allows up to 999 axes, amateur astronomers will seldom if ever encounter data requiring more than three axes.
NAXIS1, NAXIS2, ... , NAXISn. (Associated value is Integer.) For each axis, FITS requires a keyword that specifies the number of elements along that axis. These keywords are NAXIS1, NAXIS2, NAXIS3, and so forth up to NAXIS9 9 9.
The dimensions given by NAXIS1, NAXIS2, and so on specify how the binary data that follow the header are organized. NAXIS1 is the axis whose index varies most rapidly, and NAX IS 2 is the axis whose index varies next most rapidly.
For an image in which pixel values are read from the image sample by sample across and line by line down, as words are read from a page, NAXIS1 is the
Was this article helpful?