Subject: FITS header cards

From: ron at argus.lpl.Arizona.EDU (Ron Watkins)
Date: 19 Jan 1994 15:57:08 GMT

I was wondering if there is support for using CRVAL and CRDELT within
FITS tables? We have a data format that im looking into formatting into
a FITS table. Each record (of our data) contains various values and an
array. The values are of differing formats but the array is fixed at 126
single precision values representing counts at some wavelength. I had
wanted to use CRPIX, CRVAL, and CRDELT to specify the wavelengths for the
array but it doesn't apply to any of the other values in the table row other
than the array. Is there FITS support for doing this? I can only find
references for CRVAL and such in the primary HDU of the FITS files. I couldn't
find it for the FITS extensions. By the way, is there any documentation for
the extension 'IMAGE' or is it just too obvious to bother. It's rather
obvious to me unless im missing somthing subtle. Thanks for any help,
				Ron Watkins
--
Ron Watkins    [ron at argus.lpl.arizona.edu]    /            /~~~~)     /
931 Gould-Simpson                            /            /____/     /
University of Arizona                       /            /          /
Tucson AZ. 85721 -- (602) 621-8606         (____ unar & / lanetary (____ ab.

---

From: bschlesinger at nssdca.gsfc.nasa.gov (BARRY M. SCHLESINGER)
Date: 20 Jan 1994 16:57 EDT

In article <2hjl8k$sl4 at organpipe.uug.arizona.edu>, ron at argus.lpl.Arizona.EDU (Ron Watkins) writes...
>find it for the FITS extensions. 

The above does not specify whether an ASCII table or a binary table is
intended.  The proposed structure appears to fit most naturally in an
extension of type BINTABLE, where the array could appear as a single
field.  There has been some talk, particularly within the single dish
community, of conventions for use of the terms CRVALn, CRPIXn and
CDELTn to describe an array contained in one field of a binary table. 
Perhaps one of the people involved could step forward and say where
this discussion stands. 

> By the way, is there any documentation for >the extension 'IMAGE' or
is it just too obvious to bother. 

A LaTeX version of the proposal is available by anonymous ftp from
nssdca.gsfc.nasa.gov, in the FITS directory. 

				Barry Schlesinger
				NSSDC/NOST FITS Support Office

---

From: pence at tetra.gsfc.nasa.gov (William Pence)
Date: Mon, 24 Jan 94 11:46:33 EST

> FITS tables?  [stuff deleted]     I had

I had posted a note to this news group on 31 Aug 1993 describing some
ideas on how to modify the coordinate system keywords currently used in
primary HDUs to describe images stored in binary tables.  The ftp site
at fits.cv.nrao.edu should have a copy of it, as well as a copy of the
subsequent discussion.

In the meantime, our local FITS working group has further expanded on
this idea, and is drafting a document describing a proposed set of
coordinate system keywords for various types of FITS image
representations (not just in a primary HDU).  This is directly based on
and extends the 24 Aug 1993 draft of the document entitled
'Representation of Celestial Coordinates in FITS' by Greisen and
Calabretta.  Hopefully we should be able to post a draft of this
document here by the end of this week or early next week.

-Bill Pence

---

From: rpayne at sadira.gb.nrao.edu (Bob Payne)
Date: Mon, 24 Jan 94 13:06:17 EST

BARRY M. SCHLESINGER writes...
>  There has been some talk, particularly within the single dish

In 1989 there was a meeting in Green Bank, WV to discuss a FITS
convention for single dish data sets.  There was a draft document from
that meeting which was never published. However programs were written
in Green Bank as part of the UniPops single dish data analysis system
to support this format. Basically each table row can contain a data
matrix similar to the basic FITS primary data array.  Since NAXIS is
already used by the bintable convention the keywords MAXIS, MAXIS1,
...MAXISn were used to define the table matrix field. Note that MAXIS1
could be a table column so that the shape and size of the matrix could
vary from row to row. The keyword NMATRIX in the binary table header
indicates that this MAXIS convention is being followed. The standard
FITS WCS information could also be contained in table columns.

This format while not widely supported has been used by several single
dish analysis programs for exchanging spectral line data.

In the following example the binary table contains in each row a data
spectrum plus columns for the stardard FITS CRVAL1, CRPIX1, and CDELT1
defining the spectrum.

XTENSION= 'BINTABLE'                / FITS binary table.
BITPIX  =                    8      / Binary data.        
NAXIS   =                    2      / Table is a Matrix.        
NAXIS1  =                 4100      / Width of table in bytes.    
NAXIS2  =                    8      / Number of entries (rows) in Table.
PCOUNT  =                    0      / No Random Parameters.        
GCOUNT  =                    1      / Only one group.        
TFIELDS =                    5      / Number of fields in each row.        

NMATRIX =                    1      / Number of matrixes
MAXIS   =                    1      / No. axes in data matrix.        
CTYPE1  = 'FREQ         '           / Frequency Axis.        
TFORM1  = '1I           '           /        
TTYPE1  = 'MAXIS1       '           / Number of data points in spectrum.
TFORM2  = '1D           '           /        
TTYPE2  = 'CRVAL1       '           / Frequency at reference Pixel.
TUNIT2  = 'HZ           '           /
TFORM3  = '1E           '           /
TTYPE3  = 'CRPIX1       '           / Frequency Reference Pixel.
TFORM4  = '1E           '           /
TTYPE4  = 'CDELT1       '           / Frequency increment.
TUNIT4  = 'HZ           '           /
TFORM5  = '1024E        '           /
TTYPE5  = 'SPECTRUM     '           / Observed Spectrum.
END

---

From: bgarwood at sngldsh.CV.NRAO.EDU (Bob Garwood)
Date: Mon, 24 Jan 1994 19:34:43 GMT

Harvey Liszt (the original author of the unpublished draft document
mentioned by Bob Payne in the preceeding post) is currently working
on a final version of the document.  This will mostly likely be
published later this year.  There will be some small changes from
the draft document.  

Keep in mind that the following is from an initial draft of
this paper and that the final published version may be
different.

EXTNAME = 'SINGLE DISH       '

This indicates that the table follows the published (as soon as they
are published) standards (will also optionally include EXTVER and
EXTLEVEL keywords).

TMATXnnn = T

This keyword indicates that the axes corresponding to the array found
in column nnn are those indicated by the axis descriptors in the
keywords and other columns of the table (the CRVALn, CRPIX, etc,
either via keywords or TTYPE, TFORM, etc).  This was NOT in the
draft document nor is it currently implemented in the NRAO single
dish FITS writer.  It is required so you can be certain which arrays
are associated with the array axis descriptors (there may be
other arrays in a binary table, TMAXnnn is assumed to be F when not
specified).

The primary data column will be named 'DATA', i.e.:

TTYPE5  = 'DATA       '          / Observed data

Finally, although the MAXIS and MAXISnnn convention was adopted
at the Green Bank meeting, a more compact notation is now favored
in binary tables.  The MAXIS and MAXISnnn specifications (keywords) could
be replaced with the single line:

TDIMnnn = (MAXIS1, MAXIS2, ...)

where actual numbers corresponding to MAXIS1, etc, would be used.

e.g.

TDIM13 = (256,1,1,1,1)

would corresponds to MAXIS = 5, MAXIS1 = 256, MAXIS2 = 1, etc.

Both conventions will be outlined in the eventual paper although I
think the emphasis will be on the TDIMnnn convention.

Cheers,

   Bob Garwood

--

---

From: rpayne at sadira.gb.nrao.edu (Bob Payne)
Date: Mon, 24 Jan 94 16:00:09 EST

>other arrays in a binary table, TMAXnnn is assumed to be F when not

The Green Bank convention like the FITS primary data array only
allowed one array per row with the same shape and same WCS.
Under this assumption TMATXnnn is not needed. At the time of the
Green Bank meeting the TDIMnnn convention did not exist and there
could not be other inconsistant arrays in the table.

>in binary tables.  The MAXIS and MAXISnnn specifications (keywords)
>could be replaced with the single line:

This only works if the arrays are of fixed size for each row and the
MAXISnnn values are set by keywords and not by column values.  This
works fine for most spectral line data. However the MAXIS convention
is much more powerful if the MAXIS values are column entries. This
allows the shape of the data array to vary on a per row basis.
Combined with the variable length array convention this more general
approach could efficiently mix both line and continuum data in one
FITS binary table.

In general the TDIMnnn = (MAXIS1, MAXIS2, ...) is not consistant with
the MAXIS approach and the two should probably not be used in the same
file. The Green Bank convention only supports one array per row and
one WCS per row ( if more than one array they must be of the same
shape and have the same WCS). If a table needs to hold more than one
array type with more than one WCS per row then some other set of
conventions needs to be defined.