A FITS (Flexible Image Transport System) file is a standard data format used in astronomy, primarily for storing image data, such as from telescopes or other astronomical observations, but also for storing tables of data or arrays of spectra. The structure of a FITS file is segmented into "Header-Data Units" (HDUs), where each HDU consists of a header and the subsequent data.
-
Header:
- The header of each HDU is a sequence of ASCII text records (each 80 characters long) in a keyword=value format.
- It contains metadata describing the data in that HDU, such as size, format, and other properties.
- The header always starts with a
SIMPLE
keyword indicating it's a standard FITS file. - Common keywords include:
BITPIX
: Number of bits per data pixel.NAXIS
: Number of data array dimensions.NAXISn
: Size of each data array dimension (wheren
is the dimension number, e.g.,NAXIS1
,NAXIS2
).EXTEND
: Indicates whether the file may contain extensions.BSCALE
andBZERO
: Scaling factors for the data values.- Observation details like
DATE-OBS
(observation date),EXPTIME
(exposure time),TELESCOP
(telescope name), etc.
- The header ends with an
END
keyword.
-
Data:
- The data portion follows the header and can contain various types of data, like images (2D arrays), tables, or spectra.
- The data format and layout are described by the header keywords.
-
Multiple HDUs:
- FITS files can contain multiple HDUs, each with its own header and data section.
- The first HDU is called the "Primary HDU" or "Primary Array". Additional HDUs are called "Extensions". Extensions can be image extensions, table extensions (ASCII or binary), etc.
-
Comment and History Keywords:
- Headers often include
COMMENT
andHISTORY
keywords, which are used to provide additional information about the file or data processing history.
- Headers often include
-
World Coordinate System (WCS):
- FITS headers may include WCS information, which maps the pixel coordinates to celestial coordinates.
-
Flexible and Customizable:
- FITS is designed to be flexible, so headers can contain a wide range of additional keywords specific to particular datasets or scientific needs.
FITS headers are a key feature of the format because they ensure that all the necessary information to interpret the data correctly is stored right with the data. This self-describing nature is one of the reasons FITS has been a durable and popular format in astronomy.