FITS (.fits, .fit)
- Import and Export fully support the image, ASCII table, and binary table extensions of the FITS file format.
Background & Context
-
- 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.
- Allows multiple header-data units (HDUs).
- Each HDU can be an image, an ASCII table or a binary table.
- Image HDUs can only store arrays of single-channel 2D images.
- Binary and ASCII table HDUs can only store 2D data.
- Elements of a binary table can be multidimensional arrays.
- Stores spectral data and raster images as arrays.
- Developed in 1979 by Don Wells, Eric Greisen, and others.
Import & Export
- Import["file.fits"] imports a FITS file as an image or an array of data values, depending on the HDU type, for a single HDU file.
- Import["file.fits"] returns an association of the form <1->hdu1,… > for all HDUs in the file.
- Import["file.fits",elem] imports the specified element from a FITS file.
- Import["file.fits",{elem, i}] returns elem stored in the i HDU.
- The import format can be specified with Import["file","FITS"] or Import["file",{"FITS",elem,…}].
- Export["file.fits",expr] exports images and graphics as an image to a FITS file, at their raster sizes.
- Export["file.fits",expr] exports string and numeric arrays as a table to a FITS file.
- Export["file.fits",1->expr1,…] exports expri to the i HDU.
- See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
Import Elements
- General Import elements:
-
"Elements" list of elements and options available in this file "Summary" summary of the file "Rules" list of rules for all available elements - Structure elements:
-
"HDUCount" number of HDUs "Summary" summary of the file "SummarySlideView" slide-view summary of all HDUs - All elements of a FITS file are imported as a numbered association, returned in the form 1val1,2val2,….
- Data representation elements:
-
"Data" array of pixel values or table elements "Plaintext" representation of image and table extensions as a string "RawData" raw data as stored in the file - Additional elements, available for image HDUs:
-
"Graphics" raster image, given as a Graphics object "Image" raster image, given as an Image object "IndeterminateMask" a SparseArray representing indeterminate values in the image - Additional elements, available for binary and ASCII table HDUs:
-
"TableData" representation of table extension "TableHeaders" table column headers "TableUnits" units of measurement corresponding to the table columns - Import and Export by default use the "Image" element for image HDUs and the "Data" element for binary and ASCII table HDUs.
- Subelements for partial data import can be given in one of the following forms:
-
{elem,hdu} for any element {elem,hdu,rows,cols} for data elements of single-image and table HDUs {elem,hdu,spec1,spec2,…,rows,cols} for data elements of higher-dimensional image HDUs - Part specification for hdu, speci, rows and cols can be any of the following:
-
All all HDUs n nth HDU n;;m HDU n through m n;;m;;s from n through m with steps of s {n1,n2,…} specific HDUs ni - Advanced 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 "DataType" data type used to store image or table data in the file "Dimensions" data dimensions "Extension" type of the HDU extension "ImageSize" raster dimensions of a single frame "Range" minimum and maximum raw data values - General metadata elements:
-
"MetaInformation" processed metadata "RawMetaInformation" raw metadata as stored in the file - Information about the recording device and environment:
-
"Airmass" relative airmass "Declination" declination setting of the telescope axis "Device" recording instrument (e.g. camera) "Equinox" equinox for the celestial coordinate system used in this file, typically given in years "ExposureTime" photographic exposure time in seconds "HourAngle" hour angle of the depicted object when the image was taken "ObservationDate" date and time the observation was made "RightAscension" right ascension setting of the telescope axis "SiderealTime" sidereal time (LST) "Telescope" telescope that captured the image - Bibliographic information elements:
-
"Author" person who compiled the image information "Reference" bibliographic reference associated with this file - Other common metadata elements:
-
"Comments" comments for each piece of data or image stored in the file "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 - Metadata field names are converted to all caps on export to conform with FITS standard.
Options
- Import and Export option:
-
DataReversed Automatic whether to reverse the order of rows - Import options:
-
ColorFunction Automatic how each cell should be colored ImageSize Automatic overall image size "Gamma" 1.0 gamma correction parameter used for rendering "IncludeExtensions" All HDU extensions to import "IncludeHeaders" False whether to import table headers - Export options:
-
"Append" False whether to append to an existing file "CompressionMethod" None compression algorithm to use on export MetaInformation None metainformation per header to be added on export - Possible settings for "CompressionMethod" include "GZIP", "GZIPShuffled", "Rice", "HCompress" and "PLIO".
Examples
open allclose allBasic Examples (3)
Scope (7)
Import (2)
Import Elements (44)
Data Representation (17)
"Data" (2)
"Graphics" (2)
"Image" (2)
"Range" (1)
"RawData" (2)
"TableData" (3)
"TableHeaders" (2)
Advanced Import Elements (6)
Metadata Elements (19)
"Organization" (1)
Export Elements (4)
Import Options (6)
ColorFunction (1)
By default, the image data is imported as an Image object with no color function applied: