Tables are one of the common formats of data that is stored in FITS files. Only one table may be stored in each FITS HDU/extension, but each table column must be viewed as a different dataset (with its own name, units and numeric data type for example). The only constraint of the column datasets in a table is that they must be one-dimensional and have the same number of elements as the other columns. The functions described here can be used to get the information of, read, or write columns into FITS tables.
Read the number of rows and columns in the table within CFITSIO’s
Return the format of the FITS table contained in CFITSIO’s
fitsptr. Recall that FITS tables can be in binary or ASCII
formats. This function will return
GAL_TABLE_FORMAT_BFITS (defined in Table input output (table.h)). If the
fitsptr is not a table, this function will abort the program with an
error message informing the user of the problem.
Store the information of each column in
an array of data structures with
numcols elements (one data
structure for each column) see Arrays of datasets. The total number
of rows in the table is also put into the memory that
to. The format of the table (e.g., FITS binary or ASCII table) will be put
tableformat (macros defined in Table input output (table.h)).
Note that other than the character strings (column name, units and
comments), nothing in the data structure(s) will be allocated by this
function for the actual data (e.g., the
elements). This function is just for column information. This is a
low-level function particular to reading tables in FITS format. It is
recommended to use
gal_table_info to be generic (see Table input output (table.h)).
Read the columns given in the list
indexll from a FITS table into a
linked list of data structures, see List of
size_t and List of
gal_data_t. If the necessary space for each column is larger than
minmapsize, don’t keep it in the RAM, but in a file in the HDD/SSD,
see the description under the same name in Generic data container (
Note that this is a low-level function, so the output data linked list is
the inverse of the input indexs linked list. It is recommended to use
gal_table_read for generic reading of tables, see Table input output (table.h).
Write the list of datasets in
cols (see List of
separate columns in a FITS table in
already exists and
dontdelete is non-zero, then this function will
abort with an error and will not write over the existing file. The format
of the table (ASCII or binary) may be specified with the
(see Table input output (table.h)). If
comments!=NULL, each node of the
list of strings will be written as a
COMMENT keywords in the output
FITS file (see List of strings.