FITS (Flexible Image Transport System) is the standard data format of astronomy. Professional observatories and space telescopes such as Hubble and James Webb deliver their data as FITS, and so do the cameras of amateur astrophotographers. If you have a .fits, .fit or .fts file, it is most likely a raw frame saved by capture software (N.I.N.A., SharpCap, the ZWO ASIAIR and others), a stacked result from processing software, or a calibrated image downloaded from a mission archive.
History
Astronomers in the USA and Europe developed FITS at the end of the 1970s to exchange data between observatories that used incompatible computers. The first description was published in 1981, and in 1982 the International Astronomical Union took the format under its wing. Its guiding rule is "once FITS, always FITS": a file that was valid once must stay readable by every future reader, so the standard only grows. Versions: NOST 100-1.0 (1993), 2.0 (1999), 3.0 (July 2008) and the current version 4.0, approved by the IAU FITS Working Group on 22 July 2016 and released in its final text on 13 August 2018. The media types are image/fits and application/fits (RFC 4047).
How a FITS file is built
- Header and Data Units (HDUs). The primary HDU may be followed by extensions: further images, ASCII tables or binary tables. One file can hold an image, its error map and a catalogue of detected stars.
- The header is readable text: 80-character "cards" such as
BITPIX = -32,NAXIS1 = 6248,EXPTIME = 300.0orDATE-OBS. Open a FITS file in a text editor and you can read the observation details at the top. - Everything is padded to blocks of 2,880 bytes, a legacy of magnetic tape that every reader still relies on.
- Data are numeric arrays of any dimension: 8-bit unsigned, 16, 32 or 64-bit signed integers, or 32 and 64-bit floating point, big-endian.
BZEROandBSCALEconvert stored values to physical ones; unsigned 16-bit camera data useBZERO = 32768. - World Coordinate System (WCS) keywords map pixels to coordinates on the sky.
- Compression is optional. Tiled compression (Rice, gzip or HCOMPRESS) is common in archives, where files end in
.fits.fz. - No colour model. A colour image is either three planes in one cube or, straight from a one-shot colour camera, a single plane with a Bayer mosaic noted in a keyword such as
BAYERPAT.
How to open a FITS file
- FITS Liberator, free and open source, from NOIRLab with ESA, STScI and others, for Windows, macOS and Linux. Made for turning science data into pictures.
- SAOImageDS9, the classic astronomical viewer, and Siril, a free program for stacking and processing astrophotos.
- GIMP opens simple FITS images. Python users read them with Astropy.
- Regular photo viewers and phone galleries do not understand FITS.
Common FITS problems
FITS image opens completely black
The data are linear. The faint nebula you photographed occupies a tiny part of the value range, a few bright stars the rest. Astronomy software applies a "stretch" (auto-stretch, zscale, logarithmic or asinh curve) only for display. A plain viewer, and also our converter, maps the values linearly, so the result is mostly black with a few stars. Stretch the image in Siril or FITS Liberator, then export or convert.
Colour camera FITS shows a grey checkerboard
The frame has not been debayered. Siril and most capture programs can do it. Our converter does not debayer.
Only one image or one channel came out
FITS may hold several HDUs or a 3D cube. Our converter reads the image in greyscale and uses the first plane. Split or combine channels in Siril first.
Our converter doesn't accept my .fit file
The .fit extension also belongs to Garmin's activity format (see FIT to GPX), and that is how we treat it. Rename astronomical files to .fits.
Converting FITS
FITS to JPG or PNG gives a quick preview to share. FITS to TIFF hands the image to a photo editor. For both, a stretched FITS exported from astronomy software looks far better than raw data. All scientific information (WCS, exposure, units, tables) is lost in these formats; keep the original FITS. Converting ordinary photos into FITS is possible but adds no scientific value.
FITS at a glance
| Developer | Astronomers in the USA and Europe; maintained by the IAU FITS Working Group |
|---|---|
| First release | 1981 |
| Current version | FITS Standard 4.0 (2016, final text 2018) |
| Type | Scientific data: images, cubes, tables |
| Compression | None by default; tiled Rice, gzip or HCOMPRESS optional |
| Typical use | Astronomy, from space telescopes to backyard astrophotography |
References: FITS standard documents at NASA and FITS format description at the Library of Congress.