FITS (.fits, .fit)


    MIME types: application/fits, image/fits
    FITS scientific image and data format.
    Standard format for the exchange and archival storage of astronomical data.
    Endorsed by NASA and the International Astronomical Union.
    FITS is an acronym for Flexible Image Transport System.
    Mixed ASCII and binary format.
    Stores spectral data and raster images as uncompressed arrays.
    Allows format extensions.
    Developed in 1979 by Don Wells, Eric Greisen, and others.

Import and Export

  • Import["file.fits"] imports a FITS file, returning an image.
  • Import["file.fits",elem] imports the specified element from a FITS file.
  • The import format can be specified with Import["file","FITS"] or Import["file",{"FITS",elem,}].
  • Export["file.fits",expr] exports graphics or any other expression as an image to a FITS file.
  • When exporting Wolfram Language graphics or arbitrary expressions to FITS, the resulting image has the same raster size as its displayed form.
  • Image objects are by default exported at their raster size.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the FITS format.


  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Image representation elements:
  • "Data"array of adjusted color or grayscale values
    "DataType"data type used to store color or grayscale data in the file
    "Image"raster image object
    "Range"minimum and maximum raw data values
    "Graphics"Graphics object representing an image
    "RawData"array of raw pixel values
  • Import and Export by default use the "Image" element for FITS files.
  • Advanced Import elements:
  • "BitDepth"bits used to represent gray-level pixels in the file
    "Channels"the number of color channels used in the file
    "ColorSpace"color encoding used in the file (typically GrayLevel)
    "ImageSize"raster dimensions
    "Summary"summary of the file
  • General meta-information:
  • "Metadata"raw metadata as stored in the file
    "Comments"comments stored in the file, given as a list of strings
    "History"description of how the data or image has been processed
    "Object"name of the observed object
    "Observer"person who recorded the data or image
    "Organization"organization or institution responsible for creating this file
  • Information about the recording device and environment:
  • "RightAscension"right ascension setting of the telescope axis
    "Declination"declination setting of the telescope axis
    "HourAngle"hour angle of the depicted object when the image was taken
    "SiderealTime"sidereal time (LST)
    "Equinox"equinox for the celestial coordinate system used in this file, typically given in years
    "Airmass"relative airmass
    "ExposureTime"photographic exposure time in seconds
    "ObservationDate"date and time the observation was made
    "Telescope"telescope that captured the image
    "Device"recording instrument (e.g. camera)
  • Bibliographic information elements:
  • "Author"person who compiled the image information
    "Reference"bibliographic reference associated with this file
  • Selecting elements of the table extension of a FITS file:
  • "TableData"data array representing the ASCII table extension
    "TableHeaders"column headers, given as a list of strings
    "TableUnits"units of measurement corresponding to the table columns
    "Plaintext"ASCII table extension represented as a single character string
  • For FITS files that contain multiple images or data extensions, the above elements are taken to be lists of the respective expressions.
  • Metadata field names are converted to all caps on export to conform with FITS standard.



open allclose all

Basic Examples  (3)

Import the image stored in a FITS file:

Click for copyable input

Import the data while applying gamma correction and a specific color function:

Click for copyable input

Summary of an image:

Click for copyable input

Export an image to FITS:

Click for copyable input

Scope  (2)

Import Elements  (6)

Export Elements  (1)

Import Options  (1)

See Also

"CDF"  "GIF"  "HDF"  "HDF5"  "JPEG"  "NetCDF"  "PNG"  "TIFF"

Introduced in 2002
| Updated in 2016