Functions | |
cpl_table * | cpl_table_new (int) |
Create an empty table structure. | |
cpl_error_code | cpl_table_copy_structure (cpl_table *table, const cpl_table *mtable) |
Give to a table the same structure of another table. | |
cpl_error_code | cpl_table_new_column (cpl_table *table, const char *name, cpl_type type) |
Create an empty column in a table. | |
cpl_error_code | cpl_table_wrap_int (cpl_table *table, int *data, const char *name) |
Create in table a new integer column obtained from existing data. | |
cpl_error_code | cpl_table_wrap_float (cpl_table *table, float *data, const char *name) |
Create in table a new float column obtained from existing data. | |
cpl_error_code | cpl_table_wrap_double (cpl_table *table, double *data, const char *name) |
Create in table a new double column obtained from existing data. | |
cpl_error_code | cpl_table_wrap_string (cpl_table *table, char **data, const char *name) |
Create in table a new string column obtained from existing data. | |
void * | cpl_table_unwrap (cpl_table *table, const char *name) |
Unwrap a table column. | |
cpl_error_code | cpl_table_copy_data_int (cpl_table *table, const char *name, const int *data) |
Copy existing data to a table integer column. | |
cpl_error_code | cpl_table_copy_data_float (cpl_table *table, const char *name, const float *data) |
Copy existing data to a table float column. | |
cpl_error_code | cpl_table_copy_data_double (cpl_table *table, const char *name, const double *data) |
Copy existing data to a table double column. | |
cpl_error_code | cpl_table_copy_data_string (cpl_table *table, const char *name, const char **data) |
Copy existing data to a table string column. | |
void | cpl_table_delete (cpl_table *table) |
Delete a table. | |
int | cpl_table_get_nrow (const cpl_table *table) |
Get the number of rows in a table. | |
int | cpl_table_get_ncol (const cpl_table *table) |
Get the number of columns in a table. | |
cpl_type | cpl_table_get_column_type (const cpl_table *table, const char *name) |
Get the type of a table column. | |
cpl_error_code | cpl_table_set_column_unit (cpl_table *table, const char *name, const char *unit) |
Give a new unit to a table column. | |
const char * | cpl_table_get_column_unit (const cpl_table *table, const char *name) |
Get the unit of a table column. | |
cpl_error_code | cpl_table_set_column_format (cpl_table *table, const char *name, const char *format) |
Give a new format to a table column. | |
const char * | cpl_table_get_column_format (const cpl_table *table, const char *name) |
Get the format of a table column. | |
int * | cpl_table_get_data_int (const cpl_table *table, const char *name) |
Get a pointer to integer column data. | |
float * | cpl_table_get_data_float (const cpl_table *table, const char *name) |
Get a pointer to float column data. | |
double * | cpl_table_get_data_double (const cpl_table *table, const char *name) |
Get a pointer to double column data. | |
char ** | cpl_table_get_data_string (const cpl_table *table, const char *name) |
Get a pointer to string column data. | |
cpl_error_code | cpl_table_erase_column (cpl_table *table, const char *name) |
Delete a column from a table. | |
cpl_error_code | cpl_table_erase_window (cpl_table *table, int start, int count) |
Delete a table segment. | |
cpl_error_code | cpl_table_erase_selected (cpl_table *table) |
Delete the selected rows of a table. | |
cpl_error_code | cpl_table_insert_window (cpl_table *table, int start, int count) |
Insert a segment of rows into table data. | |
int | cpl_table_compare_structure (const cpl_table *table1, const cpl_table *table2) |
Compare the structure of two tables. | |
cpl_error_code | cpl_table_insert (cpl_table *target_table, const cpl_table *insert_table, int row) |
Merge two tables. | |
double | cpl_table_get (const cpl_table *table, const char *name, int row, int *null) |
Read a value from a numerical column. | |
int | cpl_table_get_int (const cpl_table *table, const char *name, int row, int *null) |
Read a value from an integer column. | |
float | cpl_table_get_float (const cpl_table *table, const char *name, int row, int *null) |
Read a value from a float column. | |
double | cpl_table_get_double (const cpl_table *table, const char *name, int row, int *null) |
Read a value from a double column. | |
const char * | cpl_table_get_string (const cpl_table *table, const char *name, int row) |
Read a value from a string column. | |
cpl_error_code | cpl_table_set (cpl_table *table, const char *name, int row, double value) |
Write a value to a numerical table column element. | |
cpl_error_code | cpl_table_set_int (cpl_table *table, const char *name, int row, int value) |
Write a value to an integer table column element. | |
cpl_error_code | cpl_table_set_float (cpl_table *table, const char *name, int row, float value) |
Write a value to a float table column element. | |
cpl_error_code | cpl_table_set_double (cpl_table *table, const char *name, int row, double value) |
Write a value to a double table column element. | |
cpl_error_code | cpl_table_set_string (cpl_table *table, const char *name, int row, const char *value) |
Write a character string to a string table column element. | |
cpl_error_code | cpl_table_set_invalid (cpl_table *table, const char *name, int row) |
Flag a column element as invalid. | |
cpl_error_code | cpl_table_fill_column_window (cpl_table *table, const char *name, int start, int count, double value) |
Write a value to a numerical column segment. | |
cpl_error_code | cpl_table_fill_column_window_int (cpl_table *table, const char *name, int start, int count, int value) |
Write a value to an integer column segment. | |
cpl_error_code | cpl_table_fill_column_window_float (cpl_table *table, const char *name, int start, int count, float value) |
Write a value to a float column segment. | |
cpl_error_code | cpl_table_fill_column_window_double (cpl_table *table, const char *name, int start, int count, double value) |
Write a value to a double column segment. | |
cpl_error_code | cpl_table_fill_column_window_string (cpl_table *table, const char *name, int start, int count, char *value) |
Write a character string to a string column segment. | |
cpl_error_code | cpl_table_set_column_invalid (cpl_table *table, const char *name, int start, int count) |
Invalidate a column segment. | |
int | cpl_table_is_valid (const cpl_table *table, const char *name, int row) |
Check if a column element is valid. | |
int | cpl_table_has_invalid (const cpl_table *table, const char *name) |
Check if a column contains at least one invalid value. | |
int | cpl_table_has_valid (const cpl_table *table, const char *name) |
Check if a column contains at least one valid value. | |
int | cpl_table_count_invalid (const cpl_table *table, const char *name) |
Count number of invalid values in a table column. | |
cpl_error_code | cpl_table_move_column (cpl_table *to_table, const char *name, cpl_table *from_table) |
Move a column from a table to another. | |
cpl_error_code | cpl_table_duplicate_column (cpl_table *to_table, const char *to_name, cpl_table *from_table, const char *from_name) |
Copy a column from a table to another. | |
cpl_error_code | cpl_table_name_column (cpl_table *table, const char *from_name, const char *to_name) |
Rename a table column. | |
int | cpl_table_has_column (const cpl_table *table, const char *name) |
Check if a column with a given name exists. | |
const char * | cpl_table_get_column_name (const cpl_table *table) |
Get table columns names. | |
cpl_error_code | cpl_table_set_size (cpl_table *table, int new_length) |
Resize a table to a new number of rows. | |
cpl_table * | cpl_table_duplicate (const cpl_table *table) |
Make a copy of a table. | |
cpl_table * | cpl_table_extract (const cpl_table *table, int start, int count) |
Create a table from a section of another table. | |
cpl_error_code | cpl_table_cast_column (cpl_table *table, const char *from_name, const char *to_name, cpl_type type) |
Cast a numeric column to a new numeric type column. | |
cpl_error_code | cpl_table_add_columns (cpl_table *table, const char *to_name, const char *from_name) |
Add the values of two numeric table columns. | |
cpl_error_code | cpl_table_subtract_columns (cpl_table *table, const char *to_name, const char *from_name) |
Subtract two numeric table columns. | |
cpl_error_code | cpl_table_multiply_columns (cpl_table *table, const char *to_name, const char *from_name) |
Multiply two numeric table columns. | |
cpl_error_code | cpl_table_divide_columns (cpl_table *table, const char *to_name, const char *from_name) |
Divide two numeric table columns. | |
cpl_error_code | cpl_table_add_scalar (cpl_table *table, const char *name, double value) |
Add a constant value to a numerical column. | |
cpl_error_code | cpl_table_subtract_scalar (cpl_table *table, const char *name, double value) |
Subtract a constant value from a numerical column. | |
cpl_error_code | cpl_table_multiply_scalar (cpl_table *table, const char *name, double value) |
Multiply a numerical column by a constant. | |
cpl_error_code | cpl_table_divide_scalar (cpl_table *table, const char *name, double value) |
Divide a numerical column by a constant. | |
cpl_error_code | cpl_table_logarithm_column (cpl_table *table, const char *name, double base) |
Compute the logarithm of column values. | |
cpl_error_code | cpl_table_exponential_column (cpl_table *table, const char *name, double base) |
Compute the exponential of column values. | |
cpl_error_code | cpl_table_power_column (cpl_table *table, const char *name, double exponent) |
Compute the power of column values. | |
double | cpl_table_get_column_mean (const cpl_table *table, const char *name) |
Compute the mean value of a numerical column. | |
double | cpl_table_get_column_median (const cpl_table *table, const char *name) |
Compute the median value of a numerical column. | |
double | cpl_table_get_column_stdev (const cpl_table *table, const char *name) |
Find the standard deviation of a table column. | |
double | cpl_table_get_column_max (const cpl_table *table, const char *name) |
Get maximum value in a numerical column. | |
double | cpl_table_get_column_min (const cpl_table *table, const char *name) |
Get minimum value in a numerical column. | |
cpl_error_code | cpl_table_get_column_maxpos (const cpl_table *table, const char *name, int *row) |
Get position of maximum in a numerical column. | |
cpl_error_code | cpl_table_get_column_minpos (const cpl_table *table, const char *name, int *row) |
Get position of minimum in a numerical column. | |
cpl_error_code | cpl_table_erase_invalid_rows (cpl_table *table) |
Remove from a table columns and rows just containing invalid elements. | |
cpl_error_code | cpl_table_erase_invalid (cpl_table *table) |
Remove from a table all columns just containing invalid elements, and then all rows containing at least one invalid element. | |
cpl_error_code | cpl_table_select_row (cpl_table *table, int row) |
Flag a table row as selected. | |
cpl_error_code | cpl_table_select_all (cpl_table *table) |
Select all table rows. | |
cpl_error_code | cpl_table_unselect_row (cpl_table *table, int row) |
Flag a table row as unselected. | |
cpl_error_code | cpl_table_unselect_all (cpl_table *table) |
Unselect all table rows. | |
void | cpl_table_dump_structure (const cpl_table *table, FILE *stream) |
Describe the structure and the contents of a table. | |
void | cpl_table_dump (const cpl_table *table, int start, int count, FILE *stream) |
Print a table. | |
cpl_error_code | cpl_table_shift_column (cpl_table *table, const char *name, int shift) |
Shift the position of numeric column values. | |
cpl_error_code | cpl_table_fill_invalid_int (cpl_table *table, const char *name, int code) |
Write to invalid integer column elements a numeric code. | |
cpl_error_code | cpl_table_fill_invalid_float (cpl_table *table, const char *name, float code) |
Write to invalid float column elements a numeric code. | |
cpl_error_code | cpl_table_fill_invalid_double (cpl_table *table, const char *name, double code) |
Write to invalid double column elements a numeric code. | |
int | cpl_table_and_selected_int (cpl_table *table, const char *name, cpl_table_select_operator operator, int value) |
Select from selected table rows, by comparing integer column values with a constant. | |
int | cpl_table_or_selected_int (cpl_table *table, const char *name, cpl_table_select_operator operator, int value) |
Select from unselected table rows, by comparing integer column values with a constant. | |
int | cpl_table_and_selected_float (cpl_table *table, const char *name, cpl_table_select_operator operator, float value) |
Select from selected table rows, by comparing float column values with a constant. | |
int | cpl_table_or_selected_float (cpl_table *table, const char *name, cpl_table_select_operator operator, float value) |
Select from unselected table rows, by comparing float column values with a constant. | |
int | cpl_table_and_selected_double (cpl_table *table, const char *name, cpl_table_select_operator operator, double value) |
Select from selected table rows, by comparing double column values with a constant. | |
int | cpl_table_or_selected_double (cpl_table *table, const char *name, cpl_table_select_operator operator, double value) |
Select from unselected table rows, by comparing double column values with a constant. | |
int | cpl_table_and_selected_string (cpl_table *table, const char *name, cpl_table_select_operator operator, const char *string) |
Select from selected table rows, by comparing string column values with a character string. | |
int | cpl_table_or_selected_string (cpl_table *table, const char *name, cpl_table_select_operator operator, const char *string) |
Select from unselected table rows, by comparing column values with a constant. | |
int | cpl_table_and_selected_invalid (cpl_table *table, const char *name) |
Select from selected table rows all rows with an invalid value in a specified column. | |
int | cpl_table_or_selected_invalid (cpl_table *table, const char *name) |
Select from unselected table rows all rows with an invalid value in a specified column. | |
int | cpl_table_and_selected_window (cpl_table *table, int start, int count) |
Select from selected rows only those within a table segment. | |
int | cpl_table_or_selected_window (cpl_table *table, int start, int count) |
Select from unselected rows only those within a table segment. | |
int | cpl_table_not_selected (cpl_table *table) |
Select unselected table rows, and unselect selected ones. | |
int | cpl_table_and_selected (cpl_table *table, const char *name1, cpl_table_select_operator operator, const char *name2) |
Select from selected table rows, by comparing the values of two numerical columns. | |
int | cpl_table_or_selected (cpl_table *table, const char *name1, cpl_table_select_operator operator, const char *name2) |
Select from unselected table rows, by comparing the values of two numerical columns. | |
int | cpl_table_is_selected (cpl_table *table, int row) |
Determine whether a table row is selected or not. | |
int | cpl_table_count_selected (const cpl_table *table) |
Get number of selected rows in given table. | |
cpl_table * | cpl_table_extract_selected (const cpl_table *table) |
Create a new table from the selected rows of another table. | |
cpl_error_code | cpl_table_sort (cpl_table *table, const cpl_propertylist *reflist) |
Sort table rows according to columns values. | |
cpl_table * | cpl_table_load (const char *filename, int xtnum, int check_nulls) |
Load a FITS table extension into a new cpl_table. | |
cpl_error_code | cpl_table_save (const cpl_table *table, const cpl_propertylist *pheader, const cpl_propertylist *header, const char *filename, unsigned mode) |
Save a cpl_table to a FITS file. |
CPL_TYPE_INT
, CPL_TYPE_FLOAT
, and CPL_TYPE_DOUBLE
, plus a type indicating columns containing character strings, CPL_TYPE_STRING
. A table column is accessed by specifying its name. The ordering of the columns within a table is undefined: a cpl_table is not an n-tuple of columns, but just a set of columns. The N elements of a column are counted from 0 to N-1, with element 0 on top. The set of all the table columns elements with the same index constitutes a table row, and table rows are counted according to the same convention. It is possible to flag each cpl_table row as "selected" or "unselected", and each column element as "valid" or "invalid". Selecting table rows is mainly a way to extract just those table parts fulfilling any given condition, while invalidating column elements is a way to exclude such elements from any computation. A cpl_table is created with all raw selected, and a column is created with all elements invalidated.
NULL
pointer the functions will set a CPL_ERROR_NULL_INPUT
error code, unless differently specified. #include <cpl_table.h>
|
Add the values of two numeric table columns.
The columns are summed element by element, and the result of the sum is stored in the target column. The columns' types may differ, and in that case the operation would be performed using the standard C upcasting rules, with a final cast of the result to the target column type. Invalid elements are propagated consistently: if either or both members of the sum are invalid, the result will be invalid too. Underflows and overflows are ignored. |
|
Add a constant value to a numerical column.
The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are are not modified by this operation. |
|
Select from selected table rows, by comparing the values of two numerical columns.
Both columns must be numerical. For all the already selected table rows, the values of the specified columns are compared. The table rows not fulfilling the comparison are unselected. Invalid elements from either columns never fulfill any comparison by definition. Allowed relational operators are |
|
Select from selected table rows, by comparing double column values with a constant.
For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are |
|
Select from selected table rows, by comparing float column values with a constant.
For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are |
|
Select from selected table rows, by comparing integer column values with a constant.
For all the already selected table rows, the values of the specified column are compared with the reference value. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are |
|
Select from selected table rows all rows with an invalid value in a specified column.
For all the already selected table rows, all the rows containing valid values at the specified column are unselected. See also the function |
|
Select from selected table rows, by comparing string column values with a character string.
For all the already selected table rows, the values of the specified column are compared with the reference string. The comparison function used is the C standard |
|
Select from selected rows only those within a table segment.
All the selected table rows that are outside the specified interval are unselected. If the sum of start and count goes beyond the end of the input table, rows are checked up to the end of the table. See also the function |
|
Cast a numeric column to a new numeric type column.
A new column of the specified type is created, and the content of the given numeric column is cast to the new type. If the input column type is identical to the specified type the column is duplicated as is done by the function |
|
Compare the structure of two tables.
Two tables have the same structure if they have the same number of columns, with the same names and the same types. The order of the columns is not relevant. |
|
Copy existing data to a table double column.
See the description of |
|
Copy existing data to a table float column.
See the description of |
|
Copy existing data to a table integer column.
The input data values are copied to the specified column. The size of the input array is not checked in any way, and it is expected to be compatible with the number of rows in the given table. The copied data values are all taken as valid: invalid values should be marked using the functions |
|
Copy existing data to a table string column.
See the description of |
|
Give to a table the same structure of another table.
This function assignes to a columnless table the same column structure (names, types, etc.) of a given model table. All columns are physically created in the new table, and they are initialised to contain just invalid elements. |
|
Count number of invalid values in a table column.
Count number of invalid elements in a table column. |
|
Get number of selected rows in given table.
Get number of selected rows in given table. |
|
Delete a table.
NULL , nothing is done, and no error is set. |
|
Divide two numeric table columns.
The columns are divided element by element, and the result of the division is stored in the target column. The columns' types may differ, and in that case the operation would be performed using the standard C upcasting rules, with a final cast of the result to the target column type. Invalid elements are propagated consistently: if either or both members of the division are invalid, the result will be invalid too. Underflows and overflows are ignored, but a division by exactly zero will set an invalid column element. |
|
Divide a numerical column by a constant.
The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation. |
|
Print a table.
cpl_table_set_column_format() . The default column formats have been chosen to provide a reasonable printout in most cases. Table rows are counted from 0, and their sequence number is printed at the left of each row. Invalid table elements are represented as a sequence of dashes as wide as the field occupied by the column to which they belong. It is not shown whether a table row is selected or not. Specifying a start beyond the table boundaries, or a non-positive count, would generate a warning message, but no error would be set. The specified number of rows to print may exceed the table end, and in that case the table would be printed up to its last row. If the specified stream is NULL , it is set to stdout. The function used for printing is the standard C fprintf() . |
|
Describe the structure and the contents of a table.
If the specified stream is |
|
Make a copy of a table.
|
|
Copy a column from a table to another.
Copy a column from a table to another. The column is duplicated. A column may be duplicated also within the same table. |
|
Delete a column from a table.
Delete a column from a table. If the table is left without columns, the selection flags are reset. |
|
Remove from a table all columns just containing invalid elements, and then all rows containing at least one invalid element.
Firstly, all columns consisting just of invalid elements are deleted from the table. Next, the remaining table rows containing at least one invalid element are also deleted from the table. The selection flags are reset even if no rows or columns are erased. The pointers to data may change, therefore pointers previously retrieved by calling
|
|
Remove from a table columns and rows just containing invalid elements.
Table columns and table rows just containing invalid elements are deleted from the table. The selection flags are reset even if no rows or columns are removed. The pointers to data may change, therefore pointers previously retrieved by
|
|
Delete the selected rows of a table.
A portion of the table data is physically removed. The pointer to column data may change, therefore pointers previously retrieved by calling |
|
Delete a table segment.
A portion of the table data is physically removed. The pointers to column data may change, therefore pointers previously retrieved by calling |
|
Compute the exponential of column values.
Each column element is replaced by its exponential in the specified base. The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation. |
|
Create a table from a section of another table.
A number of consecutive rows are copied from an input table to a newly created table. The new table will have the same structure of the original table (see function |
|
Create a new table from the selected rows of another table.
A new table is created, containing a copy of all the selected rows of the input table. In the output table all rows are selected. |
|
Write a value to a numerical column segment.
Write the same value to a numerical column segment. The value is cast to the type of the accessed column according to the C casting rules. The written values are automatically marked as valid. To invalidate a column interval use |
|
Write a value to a double column segment.
Write the same value to a double column segment. The written values are automatically marked as valid. To invalidate a column interval use |
|
Write a value to a float column segment.
Write the same value to a float column segment. The written values are automatically marked as valid. To invalidate a column interval use |
|
Write a value to an integer column segment.
Write the same value to an integer column segment. The written values are automatically marked as valid. To invalidate a column interval use
|
|
Write a character string to a string column segment.
Write the same value to a string column segment. If the input string is not a |
|
Write to invalid double column elements a numeric code.
In general, numeric column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (using a call to
|
|
Write to invalid float column elements a numeric code.
In general, numeric column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (using a call to
|
|
Write to invalid integer column elements a numeric code.
In general, numeric column elements that are flagged as invalid may contain any value, that should not be given any meaning whatsoever. In order to export the column data (using a call to
|
|
Read a value from a numerical column.
Rows are counted starting from 0. The null flag is used to indicate whether the accessed table element is valid (0) or invalid (1). The null flag also signals an error condition (-1). The null argument can be left to |
|
Get the format of a table column.
Return the format of a column. Note that the returned string is a pointer to the column format, not its copy. Its manipulation will directly affect the column format, while changing the column format using |
|
Get maximum value in a numerical column.
cpl_table_get_column_mean() . |
|
Get position of maximum in a numerical column.
Invalid column values are excluded from the search. The row argument will be assigned the position of the maximum value, where rows are counted starting from 0. If more than one column element correspond to the max value, the position with the lowest row number is returned. In case of error, row is left untouched. The table selection flags have no influence on the result. |
|
Compute the mean value of a numerical column.
Invalid column values are excluded from the computation. The table selection flags have no influence on the result. |
|
Compute the median value of a numerical column.
cpl_table_get_column_mean() . |
|
Get minimum value in a numerical column.
cpl_table_get_column_mean() . |
|
Get position of minimum in a numerical column.
cpl_table_get_column_maxpos() . |
|
Get table columns names.
NULL pointer the name of the first table column will be returned. Further calls made with a NULL pointer would return the next columns names, till the end of the list of columns when a NULL would be returned. This function only guarantees that all the table column names would be returned by subsequent calls to this function, but the order in which the column names are returned is undefined. The table structure must not be modified (e.g. by deleting, creating, moving, or renaming columns) between a sequence of calls to cpl_table_get_column_name() related to the same table, or this function behaviour will be undetermined. This function returns a pointer to the table column name, and not to its copy, therefore the pointed string shouldn't be deallocated or manipulated in any way. Its manipulation would directly affect the column name, while changing the column name using cpl_table_name_column() would turn it into garbage. Therefore, if a real copy of a column name is required, this function should be called as an argument of the function strdup() . |
|
Find the standard deviation of a table column.
Invalid column values are excluded from the computation of the standard deviation. If just one valid element is found, 0.0 is returned but no error is set. The table selection flags have no influence on the result. |
|
Get the type of a table column.
Get the type of a column. |
|
Get the unit of a table column.
Return the unit of a column, if present. Note that the returned string is a pointer to the column unit, not its copy. Its manipulation will directly affect the column unit, while changing the column unit using |
|
Get a pointer to double column data.
A cpl_table column of type
|
|
Get a pointer to float column data.
A cpl_table column of type
|
|
Get a pointer to integer column data.
A cpl_table column of type
|
|
Get a pointer to string column data.
A table column of type
|
|
Read a value from a double column.
Read a value from a column of type |
|
Read a value from a float column.
Read a value from a column of type |
|
Read a value from an integer column.
Read a value from a column of type
|
|
Get the number of columns in a table.
Get the number of columns in a table. |
|
Get the number of rows in a table.
Get the number of rows in a table. |
|
Read a value from a string column.
Read a value from a column of type
|
|
Check if a column with a given name exists.
Check if a column with a given name exists in the specified table. |
|
Check if a column contains at least one invalid value.
Check if there are invalid elements in a column. |
|
Check if a column contains at least one valid value.
Check if there are valid elements in a column. |
|
Merge two tables.
The input tables must have the same structure, as defined by the function |
|
Insert a segment of rows into table data.
Insert a segment of empty rows, just containing invalid elements. Setting start to a number greater than the column length is legal, and has the effect of appending extra rows at the end of the table: this is equivalent to expanding the table using |
|
Determine whether a table row is selected or not.
Check if a table row is selected. |
|
Check if a column element is valid.
Check if a column element is valid. |
|
Load a FITS table extension into a new cpl_table.
The selected FITS file table extension is just read and converted into the cpl_table conventions. |
|
Compute the logarithm of column values.
Each column element is replaced by its logarithm in the specified base. The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation, but zero or negative elements are invalidated by this operation. |
|
Move a column from a table to another.
Move a column from a table to another. |
|
Multiply two numeric table columns.
The columns are multiplied element by element, and the result of the multiplication is stored in the target column. See the documentation of the function |
|
Multiply a numerical column by a constant.
See the description of the function |
|
Rename a table column.
This function is used to change the name of a column. |
|
Create an empty table structure.
This function allocates and initialises memory for a table data container. A new table is created with no columns, but the size of the columns that will be created is defined in advance, to ensure that all columns will be created with the same length. All table rows are marked a priori as selected. This should be considered the normal status of a table, as long as no row selection has been applied to it. |
|
Create an empty column in a table.
This function allocates memory for a new column of specified type. The new column name must be different from any other column name in the table. All the elements of the new column are marked as invalid. |
|
Select unselected table rows, and unselect selected ones.
Select unselected table rows, and unselect selected ones. |
|
Select from unselected table rows, by comparing the values of two numerical columns.
Both columns must be numerical. For all the unselected table rows, the values of the specified columns are compared. The table rows fulfilling the comparison are selected. Invalid elements from either columns never fulfill any comparison by definition. Allowed relational operators are |
|
Select from unselected table rows, by comparing double column values with a constant.
For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are |
|
Select from unselected table rows, by comparing float column values with a constant.
For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are |
|
Select from unselected table rows, by comparing integer column values with a constant.
For all the unselected table rows, the values of the specified column are compared with the reference value. The table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. Allowed relational operators are |
|
Select from unselected table rows all rows with an invalid value in a specified column.
For all the unselected table rows, all the rows containing invalid values at the specified column are selected. See also the function |
|
Select from unselected table rows, by comparing column values with a constant.
For all the unselected table rows, the values of the specified column are compared with the reference value. The comparison function used is the C standard |
|
Select from unselected rows only those within a table segment.
All the unselected table rows that are within the specified interval are selected. If the sum of start and count goes beyond the end of the input table, rows are checked up to the end of the table. See also the function |
|
Compute the power of column values.
Each column element is replaced by its power to the specified exponent. The operation is always performed in double precision, with a final cast of the result to the target column type. Invalid elements are not modified by this operation, but elements are invalidated at any illegal operation: if the specified exponent is not negative, all column elements must be not negative, and if the specified exponent is negative, all column elements must be positive; column values not fulfilling this condition will be invalidated. If the exponent is 0.0, then any (valid) column element would be assigned the value 1.0. |
|
Save a cpl_table to a FITS file.
This function can be used to convert a CPL table into a binary FITS table extension. If the mode is set to
|
|
Select all table rows.
The table selection flags are reset, meaning that they are all marked as selected. This is the initial state of any table. |
|
Flag a table row as selected.
Flag a table row as selected. Any previous selection is kept. |
|
Write a value to a numerical table column element.
Write a value to a numerical column element. The value is cast to the accessed column type according to the C casting rules. The written value is automatically marked as valid. To invalidate a column value use |
|
Give a new format to a table column.
The input format string is duplicated before being used as the column format. If format is a |
|
Invalidate a column segment.
All the column elements in the specified interval are invalidated. In the case of a string column, the corresponding strings are set free. If the sum of start and count exceeds the number of rows in the table, the column is invalidated up to its end. |
|
Give a new unit to a table column.
The input unit string is duplicated before being used as the column unit. If unit is a |
|
Write a value to a double table column element.
Write a value to a table column of type
|
|
Write a value to a float table column element.
Write a value to a table column of type
|
|
Write a value to an integer table column element.
Write a value to a table column of type
|
|
Flag a column element as invalid.
In the case of a string column, the corresponding string is set free and its pointer is set to |
|
Resize a table to a new number of rows.
The contents of the columns will be unchanged up to the lesser of the new and old sizes. If the table is expanded, the extra table rows would just contain invalid elements. The table selection flags are reset. The pointer to column data may change, therefore pointers previously retrieved by calling |
|
Write a character string to a string table column element.
Write a string to a table column of type |
|
Shift the position of numeric column values.
The position of all column values is shifted by the specified amount. If shift is positive, all values will be moved toward the bottom of the column, otherwise toward its top. In either case as many column elements as the amount of the shift will be left undefined, either at the top or at the bottom of the column according to the direction of the shift. These column elements will be marked as invalid. This function is applicable just to numeric columns. The selection flags are always reset after this operation. |
|
Sort table rows according to columns values.
The table rows are sorted according to the values of the specified reference columns. The reference column names are listed in the input reflist, that associates to each reference column a boolean value. If the associated value is |
|
Subtract two numeric table columns.
The columns are subtracted element by element, and the result of the subtraction is stored in the target column. See the documentation of the function |
|
Subtract a constant value from a numerical column.
See the description of the function |
|
Unselect all table rows.
The table selection flags are all unset, meaning that no table rows are selected. |
|
Flag a table row as unselected.
Flag a table row as unselected. Any previous selection is kept. |
|
Unwrap a table column.
This function deallocates all the memory associated to a table column, with the exception of its data buffer. This type of destructor should be used on columns created with the |
|
Create in table a new double column obtained from existing data.
This function creates a new column of type |
|
Create in table a new float column obtained from existing data.
This function creates a new column of type |
|
Create in table a new integer column obtained from existing data.
This function creates a new column of type |
|
Create in table a new string column obtained from existing data.
This function creates a new column of type |