14
SECTION 3. FITS FILE ORGANIZATION
The header blocks shall contain only the restricted set of ASCII text characters, decimal
32 through 126 (hexadecimal 20 through 7E). The ASCII control characters with decimal
values less than 32 (including the null, tab, carriage return, and line feed characters),
and the delete character (decimal 127 or hexadecimal 7F) must not appear anywhere
within a header block.
3.3
Primary Header and Data Unit
The first component of a FITS file shall be the primary HDU which always contains
the primary header and may be followed by the primary data array. If the primary data
array has zero length, as determined by the values of the NAXIS and NAXISn keywords
in the primary header (§4.4.1.1), then the primary HDU shall contain no data blocks.
3.3.1
Primary Header
The header of a primary HDU shall consist of one or more header blocks, each containing
a series of 80-character keyword records containing only the restricted set of ASCII text
characters. Each 2880-byte header block contains 36 keyword records. The last header
block must contain the END keyword (defined in §4.4.1.1) which marks the logical end
of the header. Keyword records without information (e.g., following the END keyword)
shall be filled with ASCII spaces (decimal 32 or hexadecimal 20).
3.3.2
Primary Data Array
The primary data array, if present, shall consist of a single data array with from 1 to
999 dimensions (as specified by the NAXIS keyword defined in §4.4.1.1). The random
groups convention in the primary data array is a more complicated structure and is
discussed separately in §6. The entire array of data values are represented by a contin-
uous stream of bits starting with the first bit of the first data block. Each data value
shall consist of a fixed number of bits that is determined by the value of the BITPIX
keyword (§4.4.1.1). Arrays of more than one dimension shall consist of a sequence such
that the index along axis 1 varies most rapidly, that along axis 2 next most rapidly, and
those along subsequent axes progressively less rapidly, with that along axis m, where
m is the value of NAXIS, varying least rapidly. There is no space or any other special
character between the last value on a row or plane and the first value on the next row
or plane of a multi-dimensional array. Except for the location of the first element, the
array structure is independent of the FITS block structure. This storage order is shown
schematically in Figure 3.1 and is the same order as in multi-dimensional arrays in the
Fortran programming language [17]. The index count along each axis shall begin with
1 and increment by 1 up to the value of the NAXISn keyword (§4.4.1.1).
FITS Standard