This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Mathematica Import/Export Format

FITS (.fits)

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 fully support the image and ASCII table extensions of the FITS file format.
  • Import["file.fits"] imports a FITS file, returning a graphics object.
  • Export["file.fits", expr] exports graphics or any other expression as an image to a FITS file.
  • Import["file.fits"] returns an expression of the form Graphics[Raster[data], opts], where data is an array of RGB color values.
  • Export["file.fits", expr] creates a FITS image with the same image size as the displayed form of expr.
  • Because FITS is a raster image format, all fonts are rasterized on export.
  • Import["file.fits", elem] imports the specified element from a FITS file.
  • Import["file.fits", {elem, suba, subb, ...}] imports a subelement.
  • Import["file.fits", {{elem1, elem2, ...}}] imports multiple elements.
  • The import format can be specified with Import["file", "FITS"] or Import["file", {"FITS", elem, ...}].
  • Export["file.fits", expr, elem] creates a FITS file by treating expr as specifying element elem.
  • Export["file.fits", {expr1, expr2, ...}, {{elem1, elem2, ...}}] treats each expri as specifying the corresponding elemi.
  • Export["file.fits", expr, opt1->val1, ...] exports expr with the specified option elements taken to have the specified values.
  • Export["file.fits", {elem1->expr1, elem2->expr2, ...}, "Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"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
"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 "Graphics" element for FITS files.
"BitDepth"bits used to represent gray-level pixels in the file
"ColorSpace"color encoding used in the file (typically GrayLevel)
"ImageSize"raster dimensions
  • General meta-information:
"Annotations"annotations associated with individual data fields
"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.
  • General rendering options:
ImageSizeAutomaticoverall image size
ColorFunctionAutomatica function to apply to determine the colors of the raster image
  • Advanced rendering option:
"Gamma"1.0gamma correction parameter used for rendering