astTableSource

Register a source function for accessing tables in FITS files

Description:

This function can be used to register a call-back function with a FitsChan. The registered function is called when-ever the FitsChan needs to read information from a binary table contained within a FITS file. This occurs if the astRead function is invoked to read a FrameSet from a set of FITS headers that use the " -TAB" algorithm to describe one or more axes. Such axes use a FITS binary table to store a look-up table of axis values. The FitsChan will fail to read such axes unless the " TabOK" attribute is set to a non-zero positive integer value. The table containing the axis values must be made available to the FitsChan either by storing the table contents in the FitsChan (using astPutTables or astPutTable) prior to invoking astRead or by registering a call-back function using astTableSource. The first method is possibly simpler, but requires that the name of the extension containing the table be known in advance. Since the table name is embedded in the FITS headers, the name is often not known in advance. If a call-back is registered, the FitsChan will determine the name of the required table and invoke the call-back function to supply the table at the point where it is needed (i.e. within the astRead method).

Synopsis

void astTableSource( AstFitsChan this, void ( tabsource)( AstFitsChan , const char , int, int, int ) )

Parameters:

this
Pointer to the FitsChan.
tabsource
Pointer to the table source function to use. It takes five arguments - the first is a pointer to the FitsChan, the second is a string holding the name of the FITS extension containing the required binary table (" EXTNAME" ), the third is the integer FITS " EXTVER" header value for the required extension, the fourth is the integer FITS " EXTLEVEL" header value for the required extension, and the fifth is a pointer to an integer status value.

The call-back should read the entire contents (header and data) of the binary table in the named extension of the external FITS file, storing the contents in a newly created FitsTable object. It should then store this FitsTable in the FitsChan using the astPutTables or astPutTable method, and finally annull its local copy of the FitsTable pointer. If the table cannot be read for any reason, or if any other error occurs, it should return zero for the final (third) argument (otherwise any non-zero integer should be returned).

If " tabsource" is NULL, any registered call-back function will be removed.

Notes: