
Basic FITS Values
=================

 When a FITS header is scanned in memory or read from a file several 
 basic values are retrieved from the header and stored in the #FITSHead
 or #FITSBasic structures.  This structure may be accesed with the following
 macros:

+
    ##define #ft_ncards(fits)		( fits->ncard )
    ##define #ft_cardnth(fits, nth)	( ( nth <= fits->ncard ) 	\
					    ? &fits->cards[nth-1] 	\
					    : NULL )

    ##define #ft_last(fits)		ft_cardnth(fits, fits->ncard)

    ##define #ft_swapped()		(*(short *)"\001\000" & 0x0001)
    ##define #ft_seek(fits)		( fits->seek )

    typedef struct #FITSHead {
	    FITSCard	 cards;
	    FITSCard        *index;
	    FITSCard         last;
	    int		 acard;
	    int		 ncard;

	    int		 mem;
	    int		 seek;
	    int		 data;

	    FITSBasic	 basic;
	    FITSImage	 image;
	    FITSTable	 table;
    } #"*FITSHead";


    ##define #ft_simple(fits)		( fits->basic->simple 	)
    ##define #ft_name(fits)		( fits->basic->name  	)
    ##define #ft_bitpix(fits)		( fits->basic->bitpix 	)
    ##define #ft_naxes(fits)		( fits->basic->naxes  	)
    ##define #ft_naxis(fits, i)		( fits->basic->naxis[i-1])
    ##define #ft_pcount(fits)		( fits->basic->pcount  	)
    ##define #ft_gcount(fits)		( fits->basic->gcount  	)
    ##define #ft_databytes(fits)	( fits->basic->databytes)
    ##define #ft_databloks(fits)	( fits->basic->databloks)

    typedef struct #FITSBasic {
	    int	 simple;
	    char	*name;

	    int	 bitpix;
	    int	 naxes;
	    int	*naxis;

	    int	 gcount;
	    int	 pcount;

	    int	 databytes;
	    int	 databloks;
    } #"*FITSBasic";
+
