These routines all parse and evaluate an input string containing a user
defined arithmetic expression. The first 2 routines select rows in a
FITS table, based on whether the expression evaluates to true (not
equal to zero) or false (zero). The 3rd and 4th routines evaluate the
expression and calculate a value for each row of the table. The
allowed expression syntax is described in the row filter section in the
earlier `Extended File Name Syntax' chapter of this document.
1
Evaluate a boolean expression over the indicated rows, returning an
array of flags indicating which rows evaluated to TRUE/FALSE
int fits_find_rows / fffrow
(fitsfile *fptr, char *expr, long firstrow, long nrows,
> long *n_good_rows, char *row_status, int *status)
2
Evaluate an expression on all rows of a table. If the input and output
files are not the same, copy the TRUE rows to the output file. If the
files are the same, delete the FALSE rows (preserve the TRUE rows).
int fits_select_rows / ffsrow
(fitsfile *infptr, fitsfile *outfptr, char *expr, > int *status )
3
Calculate an expression for the indicated rows of a table, returning
the results, cast as datatype (TSHORT, TDOUBLE, etc), in array. If
nulval==NULL, UNDEFs will be zeroed out. For vector results, the number
of elements returned may be less than nelements if nelements is not an
even multiple of the result dimension. Call fits_test_expr to obtain
the dimensions of the results.
int fits_calc_rows / ffcrow
(fitsfile *fptr, int datatype, char *expr, long firstrow,
long nelements, void *nulval, > void *array, int *anynul, int *status)
4
Evalutate an expression for each row in the input FITS file and place
the results into the named column of the output fits file. It is the
caller's responsibility to make sure the column exists and is of the
proper type to hold the results, although type conversions are handled
by CFITSIO.
int fits_calc_col / ffccol
(fitsfile *infptr, char *expr, fitsfile *outfptr, char *colname,
> int *status)
5
Evaluate the given expression and return information on the result.
int fits_test_expr / fftexp
(fitsfile *fptr, char *expr, > int *datatype, long *nelem, int *naxis,
long *naxes, int *status)