Register a source function for accessing tables in FITS files astTableSource
"
-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). "
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.
Application code can pass arbitrary data (such as file descriptors, etc) to the table source function using the astPutChannelData function. The source function should use the astChannelData macro to retrieve this data.