The first keywords of a FITS extension header, from XTENSION to the last NAXIS, must appear consecutively in the order listed below.
In order to allow FITS readers that are unfamiliar with an extension to skip it, a header must specify the size of the extension in bits. To do so, two parameters, PCOUNT and GCOUNT, are defined in the header:
The PCOUNT and GCOUNT keywords may appear anywhere between
the last NAXIS (or NAXIS=0) keyword and the END
keyword. The best place is immediately after the last NAXIS
keyword; the existing standard extensions require that location, but
otherwise software to read FITS files should not assume they will be
there. They may be defined in any way that, along with the BITPIX,
NAXIS, and NAXIS values, gives the correct data size
using the following formula to derive NBITS, the number of bits
excluding fill:
The number NRECORDS of data records following the header record is
then given by
(3.10) |
Rules for individual extensions may place further restrictions on the position of the PCOUNT and GCOUNT keywords.
END is always the last keyword in a header. The remainder of the record following the END keyword is filled with ASCII blanks.
The data begin at the start of the first record following the last record of the header.