FITS File Calculator

This is a special purpose calculator. It can be used to perform calculations on columns in a FITS table and write the result to the table. It can also be used to create new columns in the table.

Result entry

The entry field on the left hand side of the "=" sign is for entering the name of the resulting column. The arrow brings a pull down menu which lists all the existing columns in the table. If a new column name is entered, then a new column with that name will be created when the calculation is performed. Otherwise, the resulting column just replaces the old column with the same name.

Normally, when creating a new column, the column's data type will be the same as that of the expression. That is, an integer expression will create a 4-byte integer column (TFORM = 1J) and a real expression will create an 8-byte double column (TFORM = 1D). This can be overridden by placing the desired TFORM value within parentheses after the column's name. For example, specifying a column name NewCol(1E) will create a new column named 'NewCol' with a TFORM of '1E'. (The numerical value is optional and will be filled in with the vector size of the expression.) The expression's results will thus be converted to a 4-byte real when written to the column, even though the result could be of type integer or double.

Formula

The entry field on the right hand side of the "=" sign is for entering the expression for calculation. You can either type in the expression or use the buttons. To use a column in the calculation, one just inserts the column's name. Below are some sample expressions.

If a calculation involves a column with Nulls or NaNs for certain rows, then these rows in the result column will be Nulls. An exception is if the Null is encountered within an && or || construction whose value is determined by the nonNull value. For example, "TRUE || NULL" evaluates to TRUE. The calculator has several special functions which can be used to test for Null values in columns.

Calculator pad

Just like all the calculators.

Column name listing

All the column names are listed as buttons. Clicking on any of them will insert (replacing any selected text) the column name in the formula window. If the number of columns is greater than 24, the "Up" and "Down" buttons can be used to scroll through the column name list.

Functions

Below are lists of all the functions supported by the calculator. For detailed descriptions of its operations, see the Expressions help file.

Arithmetic functions supported:

Vector functions supported:

Boolean functions supported:

NULL functions supported:

Type conversions supported:


Go to About fv.