Subject: Question on FITS keywords

From: francois at SIMBAD.u-strasbg.fr (Francois Ochsenbein)
Date: Fri, 18 Aug 95 15:33:30 +0200

I have just a questions raised by a problem in the order of the
FITS keywords in in TABLE extension (XTENSION= 'TABLE   '):
the header starts with

XTENSION= 'TABLE   '           / Ascii Table Extension
BITPIX  =                    8 / Character data
NAXIS   =                    2 / Simple 2-D matrix
NAXIS1  =                  242 / Number of bytes per record
NAXIS2  =                  137 / Number of records
PCOUNT  =                    0 / Get rid of random parameters
GCOUNT  =                    1 / Only one group (isn't it obvious?)
EXTNAME = 'table1.dat'         / Catalog of Bright Galaxies in Hydra I
EQUINOX =                 1950 / Equinox of coordinates
         ====================================================================
TFIELDS =                   48 / Number of data fields (columns)
TBCOL1  =  (etc )...

and the FITS Users Guide specifies in section 3.4.1 that the order must be

1. XTENSION= 'TABLE   '
2. BITPIX
3. NAXIS
4. NAXIS1
5. NAXIS2
6. PCOUNT
7. GCOUNT
8. TFIELDS

Does the Users Guide mean that exactly the 8 keywords must be consecutive
(without intermediate other keywords) or not ? In other words, does
the example conform or not to the standard, or should it be rewritten
XTENSION= 'TABLE   '           / Ascii Table Extension
BITPIX  =                    8 / Character data
NAXIS   =                    2 / Simple 2-D matrix
NAXIS1  =                  242 / Number of bytes per record
NAXIS2  =                  137 / Number of records
PCOUNT  =                    0 / Get rid of random parameters
GCOUNT  =                    1 / Only one group (isn't it obvious?)
TFIELDS =                   48 / Number of data fields (columns)
EXTNAME = 'table1.dat'         / Catalog of Bright Galaxies in Hydra I
EQUINOX =                 1950 / Equinox of coordinates
         ====================================================================
TBCOL1  =  (etc )...

Thank you for the expert's comments ...
Francois Ochsenbein / CDS Strasbourg
================================================================================

        _/_/_/_/_/_/ . . .             Centre de Donnees astronomiques de
      _/                               Strasbourg
     _/                                http://cdsweb.u-strasbg.fr/CDS.html
    _/        _/_/  _/_/_/             
   _/      _/      _/    _/            Francois Ochsenbein
    _/_/_/_/      _/    _/_/_/_/       Internet: francois at astro.u-strasbg.fr
         _/      _/    _/      _/         Phone: +33 88 35 84 11
          _/_/  _/_/_/        _/            Fax: +33 88 37 14 08
                             _/            Post: Observatoire Astronomique
                            _/                   11, rue de l'Universite
        . . . _/_/_/_/_/_/_/                     67000 STRASBOURG, France

---

From: William Pence <pence at tetra.gsfc.nasa.gov>
Date: Fri, 18 Aug 1995 17:35:20 -0400

Regarding Francois Ochsenbein's question about the order of the FITS
keywords in a TABLE extension, the A&A Suppl. Series paper (73, 365),
which defines the format of the TABLE extension, says that the 8
required keywords must be in order, *and* must be the first 8 keywords in
the file:

  "The first eight keywords (XTENSION through TFIELDS) *must* appear, and in 
   the order shown here."

Also, the BINTABLE definition paper, (in the March 22, 1995 issue of A&A) 
says:
  
  "The mandatory keywords XTENSION, BITPIX, NAXIS, NAXIS1, NAXIS2,
  PCOUNT, GCOUNT, and TFIELDS must be in order; other keywords 
  follow these in an arbitrary order."

While this does not unambiguously state that these 8 required keywords
must also be the first 8 keywords in the file, the statement that
"other keywords follow these" seems to strongly imply that the 8
keywords must appear before any other keywords.  Thus, I think the
example header with the EXTNAME and EQUINOX keywords appearing before
the TFIELDS keyword would not conform to the FITS standard.

-Bill Pence
 HEASARC/NASA