Lookup a funtools column
#include <funtools.h>
int FunColumnLookup(Fun fun, char *s, int which, char **name, int *type, int *mode, int *offset, int *n, int *width)
The FunColumnLookup() routine returns information about a named (or indexed) column. The first argument is the Fun handle associated with this set of columns. The second argument is the name of the column to look up. If the name argument is \s-1NULL\s0, the argument that follows is the zero-based index into the column array of the column for which information should be returned. The next argument is a pointer to a char *, which will contain the name of the column. The arguments that follow are the addresses of int values into which the following information will be returned:
type: data type of column:
A: \s-1ASCII\s0 characters
B: unsigned 8\-bit char
I: signed 16\-bit int
U: unsigned 16\-bit int (not standard \s-1FITS\s0)
J: signed 32\-bit int
V: unsigned 32\-bit int (not standard \s-1FITS\s0)
E: 32\-bit float
D: 64\-bit float
mode: bit flag status of column, including:
\s-1COL_ACTIVE\s0 1 is column activated?
\s-1COL_IBUF\s0 2 is column in the raw input data?
\s-1COL_PTR\s0 4 is column a pointer to an array?
\s-1COL_READ\s0 010 is read mode selected?
\s-1COL_WRITE\s0 020 is write mode selected?
\s-1COL_REPLACEME\s0 040 is this column being replaced by user data?
offset: byte offset in struct
n: number of elements (i.e. size of vector) in this column
width: size in bytes of this column
If the named column exists, the routine returns a positive integer, otherwise zero is returned. (The positive integer is the index+1 into the column array where this column was located.)
If \s-1NULL\s0 is passed as the return address of one (or more) of these values, no data is passed back for that information. For example:
if( !FunColumnLookup(fun, "phas", 0, NULL NULL, NULL, NULL, &npha, NULL) ) gerror(stderr, "can't find phas column\n");
only returns information about the size of the phas vector.
See funtools(7) for a list of Funtools help pages