next up previous FITS Documents
Next: Example 6 Up: Example Index Tables Previous: Example 4

Example 5

Same as example 2 except that the event list is stored in several different binary tables. All the events in a particular bin of the index must be contained in a single table, but different bins may be in different FITS tables. In this case all the events in the first and second index bin are in different binary table extensions in 'myfile1.fits' (thus, the extensions have different EXTVERS keyword values), and the third bin of events is contained in 'myfile2.fits'.

XTENSION= 'BINTABLE'           / binary table extension
BITPIX  =                    8 / 8-bit bytes
NAXIS   =                    2 / 2-dimensional binary table
NAXIS1  =                    8 / width of table in bytes
NAXIS2  =                  256 / number of rows in table
PCOUNT  =                    0 / size of special data area
GCOUNT  =                    1 / one data group (required keyword)
TFIELDS =                    3 / number of fields in each row
TTYPE1  = 'Ind_Pointer'        / label for field   1
TFORM1  = '1J      '           / data format of field: 4-byte INTEGER
TTYPE2  = 'Ind_Length'         / label for field   2
TFORM2  = '1J      '           / data format of field: 4-byte INTEGER
TTYPE3  = 'IndName '           / label for field   2
TFORM3  = '30A     '           / data format of field: 4-byte INTEGER
EXTNAME = 'Spatial_Index'      / this is a spatial index of a FITS table
IAXIS   =                    2 / dimensionality of the index
ITYPE1  = 'X       '           / first index column name
IAXIS1  =                   16 / number of bins in this axis of the index
ISTRT1  =                   1. / beginning value of first index bin
IDELT1  =                  32. / width of the index bin
ITYPE2  = 'Y       '           / 2nd index column name
IAXIS2  =                   16 / number of bins in this axis of the index
ISTRT2  =                   1. / beginning value of 2nd index bin
IDELT2  =                  32. / width of the index bin
END

The table contains 16 x 16 = 256 rows and 3 columns:

    IND_POINTER   IND_LENGTH  INDNAME
    -----------   ----------  ------------------------------
         1          320       myfile1.fits:BINTABLE:EVENTS:1
         1          505       myfile1.fits:BINTABLE:EVENTS:2
         1          310       myfile2.fits:BINTABLE:EVENTS:1
         .           .            .