next up previous FITS Documents
Next: Example 5 Up: Example Index Tables Previous: Example 3

Example 4

Same as example 2 except that the table is not physically sorted and instead contains a column called 'Next_Pointer' that points to the next event in the index bin.

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 =                    2 / 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
EXTNAME = 'Spatial_Index'      / this is a spatial index of a FITS table
INDTABLE= `myfile.fits:BINTABLE:EVENTS:1'  / name of the indexed 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
FORELINK= 'Next_Pointer'       / name of the column containing forward link
END

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

    IND_POINTER   IND_LENGTH
    -----------   ----------
       412          320
        65          505
         .           .