Subject: FITS basics and information (periodic posting)

From: bschlesinger at nssdca.gsfc.nasa.gov (BARRY M. SCHLESINGER)
Date: 20 Oct 1993 17:37 EDT

This basic FITS information is posted and updated periodically
for the benefit of new readers and the reference of old readers. 

	FITS (Flexible Image Transport System) is a data format
designed to provide a means for convenient exchange of astronomical
data between installations whose standard internal formats and
hardware differ. A FITS file is composed of a sequence of Header Data
Units (HDUs). The header consists of keyword=value statements, which
describe the format and organization of the data in the HDU and may
also provide additional information, for example, about the instrument
or the history of the data.  The data follow, structured as the header
specifies. The data section of the HDU may contain a digital image,
but, except for the first, *it doesn't have to*.  Other possible formats
include tables and multidimensional matrices that are not images. The
first HDU must contain a multidimensional matrix or no data at all;
the data in subsequent HDUs, called extensions, may be of any type,
consistent with certain rules.  The "Image" in the name comes from the
original use of the format to transport digital images, but it's not
just for images any more. 

 	FITS is not principally a graphics format designed for the
transfer of pictures; it does not incorporate "FITS viewers", packages
for decoding the data into an image.  Users must develop or obtain
separate software to convert the data from the FITS file into a form
that can be readily displayed.

	As has been discussed in sci.astro.fits, and in
alt.sci.astro.fits before it, the Extended Portable Bitmap Toolkit
(pbm+) can be used for converting many FITS files to such a format.
However, support is not guaranteed for all FITS files where the data
are in the form of an image.  In particular, there may be problems
when the data matrix members are in IEEE floating point format
(BITPIX<0) or the matrix has more than two dimensions (NAXIS>2).

     Archie Warnock and Ron Baalke have announced release of version
7.8 of the IMDISP program. IMDISP is an interactive image processing
program that runs on an IBM PC computer and supports FITS input. 
IMDISP 7.8 is available via anonymous ftp at ames.arc.nasa.gov
[128.102.18.3] in a file called imdisp78.zip in the pub/SPACE/SOFTWARE
subdirectory and at hypatia.gsfc.nasa.gov in the pub/software/imdisp
subdirectory.  It is also available (at least for the time being)
through Simtel-20 [192.88.110.20] 

Dominique Beauchamp, Universite Laval, Quebec City, has released
version 0.3, rel. 2 of ViewFITS, a FITS reader for OS/2 2.1
presentation manager.  It is on ftp.cdrom.com in /pub/os2/incoming,
file name vf03r2.zip. This program gives the user the opportunity to
display FITS images (8,16 or 32 bits, integer or float), modifying the
gray shade palette, doing negation and zooming out. The program now
uses bitmap instead of direct drawing to the screen, with 100x faster
execution time.  It is still a beta version. If you try it, report the
results to beaucham at phy.ulaval.ca. 

	Additional discussion of FITS->image converters may appear in
sci.astro.fits from time to time. 

	The fundamental references on FITS are the following four
papers, often referred to collectively as the "Four FITS Papers". 
These papers are the formal standard for FITS, endorsed by the
International Astronomical Union (IAU). 

Wells, D. C., Greisen, E. W., and Harten, R. H., "FITS: a flexible 
image transport system," Astronomy and Astrophysics Supplement Series, 
44,  363-370, 1981. 

Greisen, E. W. and Harten, R. H., "An extension of FITS for small 
arrays of data," Astronomy and Astrophysics Supplement Series, 44, 
371-374, 1981. 
(NOTE: The format described in this paper has been used almost 
exclusively to transport radio interferometry and is likely to be 
replaced by other formats in the future.  Writing data other than 
radio interferometry data using this format is not recommended.)   

Grosbol, P., Harten, R. H., Greisen, E. W., and Wells, D. C., 
"Generalized extensions and blocking factors for FITS," Astronomy and 
Astrophysics Supplement Series, 73, 359-364, 1988. 

Harten, R. H., Grosbol. P., Greisen, E. W., and Wells, D. C., "The 
FITS tables extension, Astronomy and Astrophysics Supplement Series, 
73, 365-372, 1988. 

	 A User's Guide for FITS, commissioned by NASA Headquarters,
is maintained by the NASA/Science Office of Standards and Technology
(NOST) FITS Support Office.  This Guide is intended to be a tutorial
for new FITS users. In addition to presenting the rules of FITS, it
provides some of the history and reasoning behind the choice of the
rules, adds recommendations on good practices, and discusses current
developments in FITS.  The current version, 3.0, was issued in January
1993. 	 

	The NOST has codified FITS as endorsed by the IAU into a
formal standard, eliminating some contradictions and ambiguities in
the original FITS papers.  This Definition of FITS was developed by a
Technical Panel chaired by Dr. Robert J. Hanisch (STSci), with review
by the astronomical community.  On June 18, 1993, it was approved as a
NOST Standard by an Accreditation Panel consisting of the NOST
Executive Board and an astronomical community representative; this
review was to confirm that the community had been given a satisfactory
opportunity to review the standard and that the Technical Panel had
properly considered and responded to all comments. 
	The NOST standard has been submitted to the IAU FITS Working
Group (IAUFWG) for endorsement as the international FITS standard, to
replace the four FITS papers and the Floating Point Agreement, which
are the current endorsed standard.  While oversights in
non-controversial areas may be rectified as a result of the review by
the IAUFWG, significant changes are unlikely, because members of this
committee were active in the process of reviewing the standard and
their comments were given significant weight in the deliberations of
the Technical Panel. 
	The IAU has endorsed the Floating Point Agreement, which
defines how floating point numbers are to be expressed in FITS.  The
basic agreement appears verbatim in the User's Guide, and the
substance is incorporated in the NOST standard. 
	The NOST maintains a file of FITS information available by
anonymous ftp from nssdca.gsfc.nasa.gov or DECnet copy from NSSDCA, in
the directory FITS. A proposed reorganization could move the FITS
material to a FITS subdirectory under a STANDARDS directory. The FITS
files include copies of the current NOST standard in flat ASCII,
PostScript, and LaTeX.  Style and index files are provided for the
LaTeX form.  The only difference among the three formats is that the
ASCII form lacks typeface formatting; only one need be retrieved.  A
current list of the extension type (structure) names registered with
the IAU FITS Working Group is maintained.  Also available, in LaTeX
form, is the text of the proposal for one of these new extension
types, IMAGE.  There is a PostScript copy of the current version of
the User's Guide, generated by capturing the Macintosh MS Word
original in PostScript format.  Nearly 100 copies have been retrieved,
with only one printing problem and one preview problem reported;
however, because of the well-known problems in converting Macintosh
Word to PostScript, universal portability cannot be guaranteed. Please
notify the FITS Support Office by electronic mail of any problems. The
directory also contains a modified version of this posting. An
AAREADME.DOC file describes the contents of the directory. 
	A SOFTWARE subdirectory contains a prototype for software in C
that will eventually validate FITS files, along with instructions.
Because this software is still under development, it should not be run
before reading the separate instructions file.  The current version
investigates required keywords for primary headers and prints sample
data for integer data arrays.  There is also C software to read and
list the headers of a FITS file.  Another file provides information on
publicly available FITS software packages. The ERRTEST subdirectory
contains several versions of the same FITS file, a valid one and
several with different kinds of header errors, for use in testing
software to read FITS files.  Be sure to use binary transfer for ftp
access of FITS test files.  Both the SOFTWARE and ERRTEST
subdirectories include AAREADME.DOC files describing their content. A
modified version of this posting is now in the main directory. 
	A Fortran subroutine package called FITSIO is available via
anonymous ftp from legacy.gsfc.nasa.gov in the /software/fitsio/
directory. This package, for reading and writing FITS format files
easily, runs on most types of machines and supports all the currently
defined FITS extensions. 

 	Additional material can be obtained by anonymous ftp from the
National Radio Astronomy Observatory, from fits.cv.nrao.edu, in the
directory fits (case is significant).  The documents subdirectory
contains a number of subdirectories.  A proposals subdirectory contain
proposals, such as the BINTABLE Binary Tables extension proposal,
which is now under consideration by the IAU FITS Working Group. A
drafts subdirectory contains drafts of designs not yet submitted, for
example, a proposed method for incorporating data compression under
FITS.  The wcs subdirectory contains material serving as the basis for
continuing discussion of world coordinates issues, some of which
appears on sci.astro.fits from time to time. 
	An electronic mail listserver called HEAFITS has been set up
as a specialized group for discussion of High Energy Astrophysics-
specific FITS issues that would not necessarily be of interest to the
majority of subscribers to the existing sci.astro.fits newsgroup and
fitsbits mailing list. To *subscribe* to the HEAFITS group, send the
following one-line e-mail message to listserv at legacy.gsfc.nasa.gov: 
		subscribe heafits Your Name 
where 'Your Name' is your actual First and Last names. Messages to
the actual mailing list are sent to heafits at legacy.gsfc.nasa.gov. 

	Printed copies of many of the documents listed above can be
obtained from the NOST Librarian. Printed or electronic copies of the
User's Guide and the NOST Standard, for those without ftp access, are
available.  Because of restrictions set by the copyright holder, NOST
can send copies of the four FITS papers only to non-profit
organizations.  The NOST can be reached as follows: 

(Postal) NASA/Science Office of Standards and Technology
	 Code 633.2
	 Goddard Space Flight Center
	 Greenbelt MD 20771
	 USA

(Internet) nost at nssdca.gsfc.nasa.gov
(DECnet) NCF::NOST

Telephone: +1-301-286-3575 8 a. m. - 5 p. m., U. S. Eastern Time
	If the Librarian is unavailable, a phone mail system takes the
call after four rings. 
	Please mention this posting in your request.

	Use the FITS office electronic mail address below for replies
or questions. It is monitored by other NOST staff members when I am
away from the office and provides a greater certainty of rapid
response. 

					Barry M. Schlesinger
					Coordinator,
					NASA/NSSDC
					NOST FITS Support Office
		
+1-301-513-1634*			fits at nssdca.gsfc.nasa.gov
					NCF::FITS

*The FITS office telephone number will be changing 25 October.  Calls 
to the old number will get a recording with a pointer (though not 
necesarily a direct one) to the new number.  The new number will be 
posted as soon as I know what it is. -BMS