Ed. Note: The FITS Basics and Information is revised from time to time. This version was last updated on February 1, 1996. The current version is available on the World Wide Web at the following URL: http://ssdoo.gsfc.nasa.gov/astro/fits/basics_info.html This document was provided with permission from the FITS Support Office, which is sponsored by the Office of Space Science at NASA Headquarters and operated under the guidance of the Astrophysics Data Facility at the NASA Goddard Space Flight Center. ********************************************************* FITS Basics and Information Preface This Flexible Image Transport System (FITS) information is provided by the FITS Support Office, operated under the guidance of the Astrophysics Data Facility at the NASA Goddard Space Flight Center. It provides a brief description of FITS and information on software and documentation, discusses some topics that have appeared on the Usenet news group sci.astro.fits, and answers some questions on FITS frequently received by the FITS Support Office. Introduction What FITS Is How FITS Evolves What FITS Is Not FITS Documents Published Papers Binary Tables User's Guide NOST Definition of FITS Version 1.1 Changes from Version 1.0 Floating Point Agreement Blocking Agreement List of Registered Extensions World Coordinates Proposed Conventions Software and Sample Data FITS Support Office FITS Product Conformance Tester with Instructions Header Lister Error Test Files HEASARC FITSIO FTOOLS VERIFITS ADC FITS Table Browser FITS I/O software in IDL Display of FITS Image Files Major Astronomical Image Analysis Packages pbm+ IMDISP (IBM/PC) SAOimage Applications with XV FITS and the Macintosh FITSview (Windows) World Coordinates On-line Information Sources FITS Support Office HEASARC NRAO HEAFITS exploder FITS Support Services from GSFC Introduction What FITS Is 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 instrument status 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 HDU, 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 FITS comes from the original use of the format to transport digital images, but it's not just for images any more. FITS supports 5 data types in primary or IMAGE data arrays: 8-bit unsigned binary integers, 16-bit twos-complement signed binary integers, 32-bit twos-complement signed binary integers, 32-bit IEEE-754 standard floating point numbers, and 64-bit IEEE-754 floating point numbers. For signed integers, the byte that includes the sign bit is first and the byte that has the 1-bit as its least significant bit is last. FITS does not support the 16-bit unsigned integer data type generated by many analog/digital converters. Conforming FITS files can be produced from such data by subtracting 32768 (decimal) from the converter output before writing to the file, while setting the BZERO keyword in the FITS header equal to 32768 and the BSCALE keyword equal to 1. A FITS reader will then add 32768 to the value in the file, restoring the original value, before interpreting it. Whether a 16-bit unsigned data type should be added, and if so, how, is controversial and under discussion, especially in sci.astro.fits. How FITS Evolves The International Astronomical Union FITS Working Group (IAUFWG) was given authority over FITS matters by the 1988 (IAU) General Assembly. This Group is associated with the Working Group on Astronomical Data. The current chair is D. Wells ( NRAO) and the vice-chair is E. Raimond (NFRA). When the developer of a data structure finds that it does not fit well into an existing standard FITS format, a new design may be developed. No change can be made that would cause existing FITS files to be out of conformance -- the "once FITS, always FITS" rule. A unique name for any new extension type must be registered with the IAU FITS Working Group, optionally through the FITS Support Office. After astronomical community discussion, most of which will be electronic, a formal proposal is distributed. This proposal is discussed by the community and may be further modified. Tests are run using the new format to confirm that it can be practically used for data transport. If the astronomical community reaches a consensus that the proposal should be adopted as standard FITS, and if successful data transfer using the proposed extension can be demonstrated, it is submitted for ratification to the regional committees--the European FITS Committee, the Japanese FITS Committee, and the American Astronomical Society Working Group on Astronomical Software (WGAS) FITS Committee. Following approval by the regional committees, it is submitted to the IAU FITS Working Group. Approval by the Working Group establishes it as a standard extension. What FITS Is Not 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 read and display the data from the FITS file. There are a number of different packages for particular applications and hardware, but there is no single standard package for all applications. FITS Documents Published Papers The fundamental references on FITS are the following five papers. The first four have often been referred to collectively as the Four FITS Papers. These five papers, along with the Floating Point Agreement and the binary tables definition, are the formal standard for FITS, endorsed by the 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. Ponz, J. D., Thompson, R. W., and Munoz, J. R., The FITS Image Extension, Astronomy and Astrophysics Supplement Series, 105, 53-55, 1994. Binary Tables On June 15, 1994, the IAU FITS Working Group announced the acceptance of BINTABLE, the binary table extension, as a standard extension. The description of the extension, to be published in the Astronomy and Astrophysics Supplement Series, is available in PostScript form from the National Radio Astronomy Observatory. User's Guide A User's Guide for FITS, commissioned by NASA Headquarters, is maintained by the FITS Support Office. It is available in uncompressed Postscript, Z-compressed Postscript, and LaTeX forms, with a style file for the LaTeX version. 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.1, was issued in May 1994. NOST Definition of FITS Version 1.1 The NASA/Science Office of Standards and Technology (NOST) has codified FITS as endorsed by the IAU into a formal standard, the Definition of FITS. In developing this Standard, some contradictions and ambiguities in the original FITS papers have been eliminated. The current standard, version 1.1 was approved as a NOST standard on September 29, 1995 by a NOST Accreditation Panel, replacing version 1.0. The NOST Standard has been developed by Technical Panels chaired by R. J. Hanisch ( STScI), with review by the astronomical community: the first panel drafted version 1.0, and a new panel drafted version 1.1, which incorporated new text on units. The Accreditation Panel consisted of the NOST Executive Board and an astronomical community representative; it reviewed the process of development 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 Definition of FITS is available in LaTeX form, with style and index files, in uncompressed PostScript, compressed PostScript, and in ASCII text. The NOST standard has been submitted to the IAUFWG for endorsement as the international FITS standard. Version 1.1 will replace the original endorsed standard -- the four FITS papers, with the addition of the Floating Point Agreement. 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 IAUFWG has since endorsed the IMAGE and BINTABLE extensions, and the agreement on physical blocking. The Technical Panel that drafted the changes between versions 1.0 and 1.1 will draft a revised NOST Standard incorporating these additions and also rectifying any oversights or omissions that may be brought to its attention by the community. Dr. Hanisch, the chair of the panel that developed version 1.0 of the Definition of FITS, is chairing this new panel. Changes from Version 1.0 Version 1.1 was developed to add text covering recommendations and requirements on units to be used in FITS files. For the reference of holders of version 1.0, the text of the substantive revisions is available in flat ASCII text form. The NSSDC Coordinated Request and User Support Office (CRUSO) can provide printed copies and electronic copies for those without ftp access. Floating Point Agreement Originally, FITS permitted only integers in the data array following the first, or primary header. The IAU has since endorsed the Floating Point Agreement, which specifies the use of IEEE-754 floating point and describes its use in FITS. The basic agreement appears verbatim in the User's Guide, and the substance is incorporated in the NOST Standard. Blocking Agreement The IAU FITS Working Group has endorsed a set of rules for physical blocking of FITS files, designed to address the requirement that many controllers and devices for high density storage media can access data only in blocks of fixed length. These rules prescribe the number of 2880-byte FITS logical records in a physical block and how to proceed when the block size is not an integral multiple of 2880 bytes. They have been formulated for fixed-block sequential media, variable block sequential media, and bitstream devices. List of Registered Extensions The rules for generalized extensions in FITS require a unique name for every extension type, to permit software readers to identify whether or not an extension is of a type that the software can handle. In order to ensure uniqueness, all extension type names, even for local extensions used only at one installation, must be registered with the IAU FITS Working Group. The FITS Support Office maintains the List of Registered Extensions. This list includes a brief description of the extension each type name identifies, the developer or responsible organization, and the status of the extension (e. g., standard, under discussion, local). Also described is the procedure for registration of extension type names. This list is updated as new extension type names are proposed and extensions with reserved names progress through the process required for IAU FITS Working Group approval. Consequently, it should be used as the primary reference on registered extensions rather than the appendix in the Definition of FITS or the corresponding section in the User's Guide. World Coordinates A draft text of conventions for World Coordinates is currently under community review. It proposes rules for describing the physical coordinate values attached to each member of a FITS data array, with detailed discussion of projections from the celestial sphere to the array plane. This draft and related documents are available from NRAO. Proposed Conventions R. Seaman and W. Pence have proposed a scheme for embedding a checksum within a FITS header. This checksum could be used to verify that the data in a file were transported without errors. Documentation is available by anonymous ftp from the National Optical Astronomy Observatories (NOAO). IAU FITS Working Group Chair D. Wells has recommended that this proposal be considered by the regional FITS committees. D. Jennings, W. Pence, M. Folk, and B. Schlesinger have proposed a convention for logically grouping together FITS HDUs that are physically separated in a given file or are located in different files. This convention would facilitate HDU-FITS conversion. It may be viewed with a Web browser or downloaded in LaTeX or Postscript form. Software and Sample Data FITS Support Office FITS Product Conformance Tester with Instructions The FITS Product Conformance Tester (FPCT), under development by the FITS Support Office, is a software package designed to validate FITS files. The programs are coded in C. The available prototype validates required keywords in the primary header and, at the user's option, prints selected values from the primary data array. Even after finding an error in a required keyword, it will continue to evaluate the file, looking for additional errors in required keywords. If the user specifies, and if major header syntax errors do not prevent retrieval of the array dimensions, the FPCT will try to read the primary data farray. The separate instructions should be read before running the software. In addition to providing directions for use, they also discuss the capabilities and limitations of the prototype. Header Lister HEADLIST prints out all the headers in a FITS file, including the primary header and all extension headers. It does not evaluate them for errors. It is a useful tool for obtaining a quick summary of the contents of a FITS file. It is written in ANSI C; users with Sun and other systems that normally use earlier C dialects will need to devolve the function prototyping syntax or use an ANSI C compiler. Error Test Files The files consist of several versions of the same FITS file, one in conformance with the FITS standard and recommended practices, several with different kinds of header errors, and two that are in technical conformance but have features that might cause problems for some readers. They are useful for testing the ability of FITS reading software to cope with erroneous or unusual files and to identify correctly the errors encountered. Users who download the files from direct anonymous ftp should remember to use binary transfer. HEASARC The NASA/Goddard High Energy Astrophysics Science Archive Research Center (HEASARC) has developed and maintains FITS software and utilities, including the FITSIO package and the FTOOLS utilities. FITSIO The FITSIO package, maintained by W. D. Pence, is a machine-independent subroutine interface for reading or writing data files in FITS format. FITSIO is written in portable Fortran-77 and runs on most commonly used computers. In addition to the Fortran subroutine interface, a set of C macros, one for each FITSIO subroutine, has been defined for convenience in calling FITSIO from C programs. These macros replace the C wrapper routines of previous versions. FITSIO supports all the standard FITS extensions and contains world coordinates subroutines for conversion between pixel and celestial coordinates. In addition, software support for the checksum proposal is available. FTOOLS J. K. Blackburn and W. D. Pence document the FTOOLS collection of over 100 utility programs to create, examine, or modify FITS data files. These programs are useful for examining the contents of FITS files and modifying them for input to more involved analysis tasks; they cannot generally be used for detailed data analysis or model fitting. New versions are released about every 3 months. Users have the option of installing the entire FTOOLS package, which includes many routines specific to high energy astrophysics, or a core set that contains only the routines that perform general operations on FITS files. FTOOLS can be built as a package within IRAF or as a set of stand-alone executable tasks. FTOOLS is supported on the following platforms: Unix: ALPHA/OSF, DEC/ULTRIX, SUN/SunOS, SUN/Solaris, MODCOMP/REALIX VMS: ALPHA/VMS, VAX/VMS. Questions or comments should be sent to ftoolshelp@athena.gsfc.nasa.gov VERIFITS W. Pence (GSFC/HEASARC) has announced the VERIFITS program to verify the conformance of any FITS format data file on magnetic disk to the standard, checking keywords and data. At user option it will list the total number of pixels, the number of null pixels and the maximum and minimum data values. If an error is found while evaluating the header, validation ceases, the error is reported and the first 72 keywords of the header are listed. The VERIFITS program is a stand-alone version of the fverify task that is included in the IRAF or Host FTOOLS package. Both VERIFITS and fverify perform the same verification checks, but fverify has a nicer user interface, as provided by the IRAF or Host environments. Several different binary executable versions of VERIFITS are available, for running on Sun workstations, DECstations, DEC Alphas running OSF/1 or VAX/VMS machines. The VERIFITS source code is also provided and may be easily linked with the FITSIO library to run on the other types of machine on which FITSIO is supported. While VERIFITS has been extensively tested, under some unusual circumstances not covered by the tests it may still fail to detect a FITS format error, or it may issue an error message that does not accurately describe the problem. VERIFITS has broader applicability than the FITS Product Conformance Tester (FPCT), being able to handle all standard extensions, while the currently available FPCT can handle only primary HDUs. The FPCT however is more forgiving and more thorough; VERIFITS will usually reject a file after finding one error, while the FPCT will attempt to retrieve the information needed to read the data if doing so is possible even with errors in the file, and will continue to check the header even after an error has been found. The VERIFITS program is available from HEASARC by ftp. ADC FITS Table Browser The Astronomical Data Center has developed a FITS Table Browser, which has been tailored specifically for use with the ADC CD-ROMs but may be used with other FITS ASCII Tables. It reads standard FITS ASCII tables and allows the user to browse through them interactively and selectively display any field or record in a table. File extraction facilities allow the writing of all or part of the input table to disk in FITS or text file format. Copies of the program for both MS-DOS and Unix are available by anonymous ftp. See the file readme.ftb for instructions on downloading, installation, and use. FITS I/O software in IDL W. Landsman (Hughes STX; landsman@stars.gsfc.nasa.gov) has announced that FITS I/O software written in IDL is available as part of the IDL Astronomy User's Library, a central repository for general purpose astronomy procedures written in IDL, including procedures to convert between spherical coordinates and plan map coordinates. The library is not meant to be an integrated package, but rather is a collection of procedures from which users can select. Submitted procedures are given a cursory testing but are basically stored in the library as submitted. The IDL Astronomy User's Library is supported under the NASA Astrophysics Software Aids program. Display of FITS Image Files Disclaimer: The mention of particular software packages is not intended as an endorsement of those packages to the exclusion of others. Users should obtain proper licensing for any proprietary package or format mentioned. Information about publicly available nonproprietary packages is welcome and will be added to this Web site if the package appears relevant and useful. Such information should include how to obtain the package and whom to contact with questions. It should also describe any limits on the FITS files that the package can handle (e. g., NAXIS must be 2; data array members must be integers). Major Astronomical Image Analysis Packages The three major astronomical image analysis packages -- the Astronomical Image Processing System (AIPS), the European Southern Observatory Munich Image and Data Analysis System (ESO-MIDAS), and the Image Reduction and Analysis Facility ( IRAF) -- provide facilities for displaying images stored in FITS files. These packages are large and probably best installed on major systems. AIPS was developed by the National Radio Astronomy Observatory (NRAO), and IRAF by the National Optical Astronomy Observatories (NOAO). pbm+ The Extended Portable Bitmap Toolkit (pbm+) can be used to convert many FITS files to image 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 array members are in IEEE floating point format (BITPIX<0) or the array has more than two dimensions (NAXIS>2). IMDISP (IBM/PC) A. Warnock and R. Baalke have announced release of version 7.9 of IMDISP, an interactive image processing program that runs on an IBM PC computer and supports FITS input. IMDISP 7.9 is available via anonymous ftp. SAOimage SAOimage is an X11 display tool which can be used stand-alone or in conjunction with IRAF to display FITS or IRAF images. It was developed at the Smithsonian Astrophysical Observatory. SAOimage source code as well as compiled executables for SUN, HP, DEC, and VMS workstations are available by anonymous ftp. A new version of SAOimage, called SAOimage: The Next Generation (SAOtng) has been developed by SAO and NOAO. It allows users to incorporate calls to SAOimage into their own processing and analysis packages, as an alternative to using it as a stand-alone package. It can be retrieved as a compressed .tar file. The SAO R&D software has been developed and tested on Sun workstations; ports (with minimal testing) have been done to the SGI, HP9000s700, and Dec Alpha. See the BUILD, STARTING.ASSIST, and STARTING.SAOTNG documents contained in the .tar file for more information on build and use requirements. Questions about the use of SAOimage may be sent to hotseat@cfa.harvard.edu or iraf@noao.edu Applications with XV The XV package, as of version 3.10a, now includes FITS support. It can handle more than 2 axes and IEEE single and double precision regular floating point values in the primary array. It can not handle IMAGE extensions or IEEE special values (NaN, Infinity, denormalized). An xv Web page contains licensing and access information. FITS and the Macintosh T. Lemke (100102.104@compuserve.com), at Peine in Germany has added FITS support to GraphicConverter for the Macintosh and provided the following information. GraphicConverter 1.7.7 or later can import FITS array files with all five permitted data types (8, 16, 32 bit integer and 32, 64 bit real). Every FITS file will be converted to 8 bit gray scale on opening because this is the maximum number of grays on a Macintosh. GraphicConverter can convert a FITS files to the PICT, TIFF, GIF, PCX, IFF, PPM, and other graphic file formats. The package is shareware with a $35 registration cost. Although our general rule is to list only software that is available without cost, this package is listed here because of the wide interest in FITS packages for Macintosh. D. Norton of Otter Solution has written a Photoshop plug-in called PhotoFITS which reads 8-, 16-, or 32-bit integer and 32- or 64- bit floating point FITS images and converts them to 8-bit or RGB images. It allows conversion of three-image FITS files to RGB. It allows multiple image files to be read in as a mosaic. Questions and problem reports should be sent to ottersol@aol.com. The site at NRAO contains a collection of Usenet postings and electronic mail messages about the use of FITS on Macintosh hardware. FITSview (Windows) W. Cotton at NRAO has announced an updated beta release, version 0.4.0, of FITSview, a FITS image viewer for Windows. Celestial positions are determined using world coordinate projections. All defined FITS data types are recognized, as are blanked pixels. Two and three dimensional simple FITS images can be viewed. FITSview runs on Windows 3.1 or later and uses any multicolor (or multiple gray level) display. Extensive on-line documentation is included. It is available by ftp. Installation is described in the file fitsv040.txt, and the software is in fitsv040.zip . World Coordinates Two ANSI C functions, worldpos() and xypix(), convert (RA, dec) <--> pixel location for 8 common types of projective geometries where (RA,Dec) are more generically (long,lat). These functions are based on the World Coordinates implementation of Classic AIPS. The software, is available by anonymous ftp in the worldpos.tar.gz file, and a number of AIPS and more recent documents are available in a separate location. M. Calabretta (ATNF) has announced the general release of WCSLIB 1.0 - a suite of routines which implements the spherical projections proposed for the World Coordinate System (WCS) convention in FITS. The WCSLIB distribution kit contains independent C and FORTRAN implementations of the library. It is available via anonymous ftp in the wcslib-1.0.tar.gz file. On-line Information Sources FITS Support Office This site provides the following material: FITS documents and general FITS information Software developed by the FITS Support Office Primary HDUs designed for testing the ability of FITS readers to cope with a variety of errors. HEASARC Two kinds of FITS resources are available from The NASA/Goddard High Energy Astrophysics Science Archive Research Center (HEASARC). HEASARC has developed the FITSIO and FTOOLS software packages. HEASARC also provides information on the activities of the OGIP/HEASARC FITS Working Group (OFWG), the internal legislative body on FITS-related ma ithin the Office of Guest Investigator Programs (OGIP) at NASA/GSFC. OFWG has developed a number of FITS conventions that are more specific than the requirements of the FITS standards. Proposed OGIP conventions are publicized to the FITS community as a whole, with the goal of collaborative development of a set of conventions that will be accepted throughout the community as well as within OGIP/HEASARC. NRAO The National Radio Astronomy Observatory supports a library of FITS material There is also support for a WAIS server named nrao-fits which has an index of all of the FITS-related text files in the archive. The archive contains a collection of FITS-related documents, including the BINTABLE draft for Astronomy and Astrophysics, detailed proposals currently being considered by the FITS committees, drafts of designs not yet submitted, and documents on world coordinate system conventions. Some support is provided for a variety of operating systems -- utility software and pointers to other code. There are sample FITS files and some specially designed test files. There is also an archive of FITS-related traffic from sci.astro.fits and other Usenet newsgroups, and from a number of FITS-related electronic mail exploders. HEAFITS exploder An electronic mail listserver called HEAFITS has been set up for discussion of High Energy Astrophysics-specific FITS issues that would not necessarily be of interest to the majority of subscribers to the sci.astro.fits newsgroup and fitsbits mailing list. To subscribe to the HEAFITS group, send the following one-line e-mail message to listserv@legacy.gsfc.nasa.gov: subscribe heafits Your Name where `Your Name' is your actual First and Last names. Messages to the mailing list should be sent to heafits@legacy.gsfc.nasa.gov. There is an archive of messages. FITS Support Services from GSFC The NSSDC Coordinated Request and User Support Office (CRUSO) can provide printed copies of the User's Guide and the NOST Standard. Because of restrictions set by ESO, the copyright holder, copies of the four FITS papers may be sent only to non-profit organizations. The IEEE floating point standard is copyrighted by IEEE, and must be purchased from them. Use the FITS Support Office electronic mail address below for questions about this FITS information. Other staff members monitor the FITS electronic mail address when I am away from the office, providing a greater certainty of rapid response. Please provide your name, affiliation, and location. Barry M. Schlesinger, Coordinator, FITS Support Office +1-301-441-4205 fits@nssdca.gsfc.nasa.gov NCF::FITS Last revised 1 February 1996 Author: Barry M. Schlesinger/Hughes STX (fits@nssdca.gsfc.nasa.gov) Responsible NASA representative: David Leisawitz (leisawitz@stars.gsfc.nasa.gov)