Skip to main content

Current FITS Standard

FITS Standard: language-edited PDF version, Version 4.0 (13 August 2018)

This latest version of the FITS Standard document was formally approved by the International Astronomical Union (IAU) FITS Working Group on July 22, 2016. The main difference from the previous Version 3 of the document is that a number of FITS conventions are now officially recognized, including conventions for representing Time world coordinates, and conventions for compressing FITS images and tables. A complete list of all the changes can be found in appendices H.3 and H.4 of the document.

In addition, the language style in the document has been extensively edited to provide more consistent word capitalization, hyphenation, punctuation, and other typographical issues. (Thanks to Malcolm Currie and Lucio Chiappetti for performing these painstaking edits.) This final "language-edited" version of the FITS Standard was formally approved on 13 August 2018. The change summary page describes the changes that were made during the editing process.

Latex source files: fits_standard40aa-le.tex, WCSfig.eps, ascii.ps, aa.cls

Version 4 before the language editing (22 July 2016)

View the original draft of the FITS Standard Version 4.0 (PDF). A Version 4.0 Latex source file is also available.

To view previous versions of the FITS standard, see the past standards documents below.

 


A Primer on the FITS Data Format

FITS (Flexible Image Transport System) is the data format most widely used within astronomy for transporting, analyzing, and archiving scientific data files. FITS is much more than just another image format (such as JPG or GIF) and is primarily designed to store scientific data sets consisting of multidimensional arrays (images) and 2-dimensional tables organized into rows and columns of information.

HDUs

A FITS file is comprised of segments called Header/Data Units (HDUs), where the first HDU is called the "Primary HDU," or "Primary Array." The primary data array can contain a 1-999 dimensional array of 1, 2 or 4 byte integers or 4 or 8 byte floating point numbers using IEEE (Institute of Electrical and Electronics Engineers) representations. A typical primary array could contain a 1-D spectrum, a 2-D image, or a 3-D data cube.
Any number of additional HDUs may follow the primary array. These additional HDUs are referred to as FITS "extensions." Three types of standard extensions are currently defined:

  • Image Extensions contain a 0-999 dimensional array of pixels, similar to a primary array (header begins with XTENSION = 'IMAGE ')
  • ASCII (American Standard Code for Information Interchange) Table Extensions store tabular information with all numeric information stored in ASCII formats. While ASCII tables are generally less efficient than binary tables, they can be made relatively human readable and can store numeric information with essentially arbitrary size and accuracy (e.g., 16 byte reals). (header begins with XTENSION = 'TABLE ')
  • Binary Table Extensions store tabular information in a binary representation. Each cell in the table can be an array but the dimensionality of the array must be constant within a column. The strict standard supports only one-dimensional arrays, but a convention to support multi-dimensional arrays is widely accepted. (header begins with XTENSION = 'BINTABLE')

In addition to the structures described above, there is one other type of FITS HDU called "Random Groups" that is almost exclusively used for applications in radio interferometry. The random groups format should not be used for other types of applications.

Header Units

Every HDU consists of an ASCII formatted "Header Unit" followed by an optional "Data Unit." Each header or data unit is a multiple of 2880 bytes long. If necessary, the header or data unit is padded out to the required length with ASCII blanks or NULLs depending on the type of unit.
Each header unit contains a sequence of fixed-length 80-character keyword records which have the general form:

KEYNAME = value / comment string

The keyword names may be up to eight characters long and can only contain uppercase letters A to Z, the digits 0 to 9, the hyphen, and the underscore character. The keyword name is (usually) followed by an equals sign and a space character in columns 9 and 10 of the record, followed by the value of the keyword which may be either an integer, a floating point number, a complex value (i.e., a pair of numbers), a character string (enclosed in single quotes), or a Boolean value (the letter T or F). Some keywords, (e.g., COMMENT and HISTORY) are not followed by an equals sign and in that case columns 9 - 80 of the record may contain any string of ASCII text.

Each header unit begins with a series of required keywords that specify the size and format of the following data unit. A 2-dimensional image primary array header, for example, begins with the following keywords:

SIMPLE  =                    T / file conforms to FITS standard
BITPIX  =                   16 / number of bits per data pixel
NAXIS   =                    2 / number of data axes
NAXIS1  =                  440 / length of data axis 1
NAXIS2  =                  300 / length of data axis 2

The required keywords may be followed by other optional keywords to describe various aspects of the data, such as the date and time of the observation. COMMENT or HISTORY keywords are also frequently added to further document the contents of the data file.

The last keyword in the header is always the "END" keyword which has blank value and comment fields. The header is padded with additional blank records if necessary so that it is a multiple of 2880 bytes (equivalent to 36 80-byte keywords) long. Note that the header unit may only contain ASCII text characters ranging from hexadecimal 20 to 7E); non-printing ASCII characters such as tabs, carriage-returns, or line-feeds are not allowed anywhere within the header unit.

Data Units

The data unit, if present, immediately follows the last 2880-byte block in the header unit. Note that the data unit is not required, so some HDUs only contain the header unit.
The image pixels in a primary array or an image extension may have one of 5 supported data types:

  • 8-bit (unsigned) integer bytes
  • 16-bit (signed) integers
  • 32-bit (signed) integers
  • 32-bit single precision floating point real numbers
  • 64-bit double precision floating point real numbers

A 64-bit integer datatype has also been proposed and is currently in experimental use. Unsigned 16-bit and 32-bit integers are supported by subtracting an offset from the raw pixel values (e.g., 32768 (215) is subtracted from each unsigned 16-bit integer pixel value to shift the values into the range of a signed 16-bit integer) before writing them to the FITS file. This offset is then added to the pixels when reading the FITS image to restore the original values.

The other 2 types of standard extensions, ASCII tables and binary tables, contain tabular information organized into rows and columns. Generally speaking, binary tables are more compact and are faster to read and write than than ASCII tables because the numeric entries are stored in machine readable binary representation.

All the entries within a given column of an ASCII or Binary table extension have the same datatype. The allowed data formats for an ASCII table column are: integer, single or double precision floating point value, or character string. Binary table extensions also support logical (true/false), bit, and complex data formats.

Each entry, or field, in an ASCII table may only contain 1 scalar value. Binary tables are more flexible and allow N-dimensional arrays of of data (either fixed length or variable length) to be stored within each field. Variable-length arrays are implemented by storing a pointer in the field of the table which defines the length and byte offset to the start of the data array which is located in the "heap" area that follows the table proper. The variable-length-arrays convention is not strictly part of the FITS standard but is widely used.

 


 

Past FITS Standard Documents

Version 3.0 (July 2008)

Published version of the FITS Standard 3.0 in Astronomy and Astrophysics, Volume 524 (December 2010)

PDF version of the FITS Standard Version 3.0 maintained by the IAU FITS Working Group (November 2010)

Other related documents:

Version 2.1b (December 2005)

View Version 2.1b in PDF format or view Version 2.1b in Postscript format.

The main changes in Version 2.1b compared to the previous NOST 100-2.0 version are:

  • Added support for 64-bit integer primary arrays and image extensions with BITPIX = 64, for 64-bit integer columns in binary tables with TFORMn = 'K', and for 64-bit descriptor columns in binary tables with TFORMn = 'Q'. This was approved by the IAU FITS Working Group in December 2005.
  • The description of the TDIMn keyword convention and the variable-length array convention that used to be in the unofficial appendices B.1 and B.2 have been moved into the main body of the document, to reflect the official approval of these two conventions by the IAU FITS Working Group in April 2005.
  • A short "Preface to Version 2.1b" has been added.
  • A clarification on the meaning of the word "deprecated" has been added to section 7.0 (Random Groups). This modification was approved by the IAUFWG in October 2000 when it adopted the NOST Standard as the IAU FITS Standard.

Other related documents:

Version NOST 100-2.0 (March 1999)

View the Version NOST 100-2.0 in PDF format or Version NOST 100-2.0 in Postscript format.

Latex source files:

This version of the Standard was published in the Astronomy & Astrophysics scientific journal in September 2001. This published version was endorsed by the IAU FITS Working Group in October 2000 and is identical to the original NOST document except for the addition of 2 introductory sections on the history of FITS and on the process that lead to the creation of the NOST document. There were also 2 minor clarifications on a) the interpretation of the word "deprecated" and b) the usage of the TDIMn keyword with variable length array columns.

Version NOST 100-1.2 (April 1998)

View Version NOST 100-1.2 in PDF format or Version NOST 100-1.2 in Postscript format.

This version adds the Image and Binary Table standard extensions. View the list of changes between v1.1 and v1.2.

Latex source files:

Version NOST 100-1.1 (September 29 1995)

View Version NOST 100-1.1 in Postscript format and the Latex source of Version NOST 100-1.1.

Version NOST 100-1.0 (June 1993)

View Version NOST 100-1.0 in PDF format or Version NOST 100-1.0 in Postscript format. Also, view the NOST announcement about the first FITS Standard.