astAddColumnastAddColumn
-
Add a new column definition to a table
- Description:
- Adds the definition of a new column to the supplied table. Initially,
the column is empty. Values may be added subsequently using the
methods of the KeyMapKeyMap class.
- Synopsis:
- void astAddColumn( AstTable
this, const char
name, int type, int ndim,
int
dims, const char
unit )
- Parameters:
-
this
-
Pointer to the TableTable.
-
name
-
The column name. Trailing spaces are ignored (all other spaces
are significant). The supplied string is converted to upper case.
-
type
-
The data type associated with the column. See "Applicability:"
below.
-
ndim
-
The number of dimensions spanned by the values stored in a single
cell of the column. Zero if the column holds scalar values.
-
dims
-
An array holding the the lengths of each of the axes spanned by
the values stored in a single cell of the column. Ignored if the
column holds scalara values.
-
unit
-
A string specifying the units of the column. Supply a blank
string if the column is unitless.
- Class Applicability:
-
Table
-
Tables can hold columns with any of the following data types -
AST__INTTYPE (for integer), AST__SINTTYPE (for
short int),
AST__BYTETYPE (for
unsigned bytes - i.e. unsigned chars),
AST__DOUBLETYPE (for double
precision floating point), AST__FLOATTYPE (for single
precision floating point), AST__STRINGTYPE (for character string),
AST__OBJECTTYPE (for AST ObjectObject pointer), AST__POINTERTYPE (for
arbitrary C pointer) or AST__UNDEFTYPE (for undefined values
created by
astMapPutUastMapPutU).
-
FitsTableFitsTable
-
FitsTables can hold columns with any of the following data types -
AST__INTTYPE (for integer), AST__SINTTYPE (for
short int),
AST__BYTETYPE (for
unsigned bytes - i.e. unsigned chars),
AST__DOUBLETYPE (for double
precision floating point), AST__FLOATTYPE (for single
precision floating point), AST__STRINGTYPE (for character string).
- Notes:
- This
function
returns without action if a column already exists in the Table
with the supplied name and properties. However an error is
reported if any of the properties differ.