next up previous contents
Next: Required Keywords for an Up: FITS Fundamentals Previous: Data Records

3.3 Extensions

  The data to be transported do not always fit conveniently into an array format. Also, auxiliary information associated with an image or data set may need to be saved in the same file, but may not fit into the array structure. To handle such cases, the concept of FITS extensions has been introduced (Grosbøl et al. 1988). Extensions have the same overall organization as Basic FITS: a header consisting of keyword = value ASCII card images followed by data. As in Basic FITS, the header and data each consists of an integral number of 23040-bit records. Except for the SIMPLE keyword, which is replaced by an XTENSION keyword, the header must use the keywords required for the Basic FITS primary header (section 3.1.1.1). As in Basic FITS, the data start in the first record following the last header record. However, as the data structure need not be a simple array, there are additional required and reserved keywords for particular structures.

The developers of the extension concept realized that a set of rules was needed to prevent conflicts between a new extension and Basic FITS, random groups, or an existing extension. The rules that were developed are called the Generalized Extensions Agreement. An extension that conforms to these rules is called a conforming extension. An extension that has been endorsed by the IAU FITS Working Group or other appropriate authority is called a standard extension. All standard extensions are conforming extensions. The detailed structure of a conforming extension does not need approval by any authority, but the type name must be unique and registered with the IAUFWG. A file whose extensions all conform to the rules for generalized extensions is in FITS conformance, even if the extensions are not standard extensions, and the SIMPLE keyword of the primary header should have the value T.

Two basic rules govern all existing extensions and serve as the foundation for the more detailed requirements for generalized extensions:

The generalized requirements for FITS extensions are as follows:

The detailed rules for FITS extensions implement these requirements. Keyword syntax for extension headers is governed by the same rules as for primary headers. The standards concerning data types and bit order for the main FITS data records also apply to extensions.

The Generalized Extensions Agreement requires the use of a single additional keyword in the main header only:

EXTEND (logical) if true (T) indicates that there may be extensions that conform to the generalized extension standards following the data records. Its absence guarantees that there are no extensions, but its presence does not guarantee that extensions are present. Because extensions are not required following a primary header with EXTEND = T, the primary HDU alone can be copied unchanged. A value of F has no meaning and should not be used. The EXTEND keyword must immediately follow the last NAXISn keyword or an NAXIS keyword with a value of zero. FITS data in a file may consist entirely of extensions, with no primary data. In such cases, the primary header must still be present, with EXTEND = T and NAXIS = 0 to indicate no primary data array. Examples 3 and 6 in Appendix A illustrate FITS primary headers with no data that occur at the start of files where all the data are in extensions.



 
next up previous contents
Next: Required Keywords for an Up: FITS Fundamentals Previous: Data Records