This HTML automatically generated with rman for NEMO
Table of Contents

Name

fits - standard astronomical data interchange format

Description

FITS (Flexible Image/Information Transport System) is THE standard format for the interchange of astronomical images and other digital arrays (ascii and binary tables, random groups, etc.). A fits file consists of several, not necceseraly related, Header-Data-Units (HDUs), of which the Data part may be absent.

The header has an unlimited number of parameters in the form key=value / comment that may be associated with and describe the data. The header consists of ASCII records of 80 characters (with optional line separators) each; both header and data have a blocksize of a 2880 bytes (or a small integer (1-10) factor thereof - the blocking factor). All major astronomical data reduction packages (AIPS, GIPSY, MIRIAD, IRAF, MIDAS etc.). can import/export their data from/to FITS format in some extent. However, there are some known FITS ‘‘dialects’’.

The FITS format was originally described in a classic paper by D.H. Wells, E.W. Greisen and R.H. Harten in Astronomy and Astrophysics Supplement Series, Vol. 44 (1981), pp. 363-370. A number of addenda have been published since then, which describe various extensions to the format. There is often information in the manuals of packages like AIPS and IRAF. An updated version is published by R. Hanish et al. in Astronomy and Astrophysics, Vol. 376 (2001), pp. 359. (bibcode: 2001A&A...376..359H)

NEMO has two library routines available to process fits files: fits(3NEMO) and fitsio(3NEMO) , the latter more specialized to read and write images and derived (and compatible with) from the MIRIAD fitsio interface.

Keywords

The following header keywords describe the most important facts about the data (or at least enables a reader to skip data)
SIMPLE    T (standard FITS file)
BITPIX    Number of bits per datum [choice of 8, 16, 32, -32, -64, (64 experimental)
    (-32,-64 IEEE floating point, 8 unsigned, 16,32 twos-complement ints)
NAXIS    total number of axes (0, 1, 2, ... 999) in cube
NAXISn    size of a particular axis (n=1 through NAXIS) in cube
PCOUNT    number of extra parameters associated with cube [0 if not present]
GCOUNT    number of repetitions of the cube+parameter [1 if not present]
CRPIXn    the reference pixel (often in range 1..NAXISn)
CRVALn    value of the coordinate at the reference pixel
CDELTn    increment per pixel (can be negative)
CTYPEn    coordinate type (an ascii string), often in two part, e.g. "RA---SIN"
or "VELO-LSR"
CUNITn    units of coordinate type 
DATE-OBS    Observing date: new Y2K format "yyyy-mm-ddThh:mm:ss"
TIME-OBS    Observing time, "hh:mm:ss", deprecated after new Y2K

HISTORY      history records (no ’=’ needed)
COMMENT      comment cards (no ’=’ needed)

END      last keyword in header
For SIMPLE=T fits file the size of the data section (in bytes) can always be computed from the following formula:
        |BITPIX/8| * GCOUNT * (PCOUNT + NAXIS1*NAXIS2* ... *NAXISm)  
where m is the value of NAXIS. This size must of course be rounded up to the nearest multiple of 2880 bytes. After this, either there is no more information on the medium, or another HDU can be read.

Time

The old DATE-OBS format (with the Y2K problem) was yy-dd-mm, and some files might have a corresponding TIME-OBS keyword, hh:mm:ss. The new format follows the ISO format, obtained with the unix date command as follows:
    date +%Y-%m-%dT%H:%M:%S.%N
    2020-12-18T13:15:49.648961250
and this should be the new format (with as many sub-second digits as are needed).

Coordinate Systems

World Coordinate Systems are described in detail in draft by E.W. Greisen and M. Calabretta (AIPS memo 99?) titled Representations of Celestial Coordinates in FITS.

Some common coordinate systems:

LINEAR          Simple linear coordinate system
RA, DEC         Equatorial  (followed by a projection type)
ELON, ELAT      Ecliptic  (followed by a projection type)
GLON, GLAT      Galactic (followed by a projection type)

Some common coordinate system projection types:

    RP  Name
___ __  ___________________________________
AZP 90  Zenithal perspective                
TAN 90  Gnomic (AZP w/ mu = 0)             
SIN 90  Orthographic (AZP w/ mu = infty)
NCP 90  North celestial pole (special case of SIN) 
STG 90  Stereographic (AZP w/ mu = 1)      
ARC 90  Zenithal equidistant                 
ZPN 90  Zenithal polynomial                 
ZEA 90  Zenithal equal-area                  
AIR 90  Airy                                
CYP  0  Cylindrical perspective             
CAR  0  Cartesian                            
MER  0  Mercator                             
CEA  0  Cylindrical equal area              
COP 90  Conical perspective                 
COD 90  Conical equidistant                 
COE 90  Conical equal-area                  
COO 90  Conical orthomorphic                
BON 90  Bonne’s equal area                  
PCO  0  Polyconic                            
SFL  0  Sanson-Flamsteed
GLS  0  GLobal Sinusoidal (Similar to SFL)                          
PAR  0  Parabolic                            
AIT  0  Hammer-Aitoff equal area all-sky                       
MOL  0  Molweide                             
CSC  0  Cobe Quadrilateralized Spherical Cube  
QSC  0  Quadrilateralized Spherical Cube     
TSC  0  Tangential Spherical Cube

See Also

ccdfits(1NEMO) , fitsccd(1NEMO) , fitssnap(1NEMO) , fitstab(1NEMO) , fitsio(3NEMO) , fits(3NEMO) , image(5NEMO)
https://fits.gsfc.nasa.gov/fits_documentation.html - fits
https://ui.adsabs.harvard.edu/abs/2001A%2526A...376..359H - FITS standard 1.0
https://ui.adsabs.harvard.edu/abs/2002A%26A...395.1061G - world coordinates
https://ui.adsabs.harvard.edu/abs/2002A%26A...395.1077G - celestial coordinates
https://ui.adsabs.harvard.edu/abs/2006A%26A...446..747G - spectral coordinates
https://www.gb.nrao.edu/~fghigo/gbtdoc/doppler.html

Examples

Sometimes converting a fits file back to itself using a particular package can "fix" problems. Here are some examples for some arbitrary FITS file:
    f=L1157-B1_84475
    
    # NEMO:
    fitsccd $f.fits - | ccdfits - $f.nemo.fits
    # CASA:
    casa -c ’importfits("’"$f"’.fits","junk.im",overwrite=True); exportfits("junk.im","’$f’.casa.fits",overwrite=True)’
    # or less hassle with shell quoting , in casa python
    f = ’L1157-B1_84475’
    importfits(f+".fits","junk.im",overwrite=True);
    exportfits("junk.im",f+".casa.fits",overwrite=True)
    # MIRIAD:
    fits in=$f.fits out=junk.im op=xyin
    fits in=junk.im out=$f.miriad.fits op=xyout
    
Update History
30-may-88    written      PJT
20-mar-90    Nemo’s FITS I/O library is being tested      PJT
3-jul-94    doc updated with PCOUNT/GCOUNT    PJT
28-sep-01    experimental bitpix 64 added    PJT
18-dec-20    y2k date-obs reminder    PJT


Table of Contents