Functions | |
| cpl_table * | cpl_table_new (int) |
| Create an empty table structure. More... | |
| cpl_table * | cpl_table_new_from_model (cpl_table *table, int length) |
| Create a table from a model table. More... | |
| cpl_error_code | cpl_table_new_column_int (cpl_table *table, const char *name) |
| Create an empty integer column in a table. More... | |
| cpl_error_code | cpl_table_new_column_float (cpl_table *table, const char *name) |
| Create an empty float column in a table. More... | |
| cpl_error_code | cpl_table_new_column_double (cpl_table *table, const char *name) |
| Create an empty double column in a table. More... | |
| cpl_error_code | cpl_table_new_column_string (cpl_table *table, const char *name) |
| Create an empty string column in a table. More... | |
| cpl_error_code | cpl_table_new_column_from_data_int (cpl_table *table, int *data, const char *name) |
| Create in table a new integer column obtained from existing data. More... | |
| cpl_error_code | cpl_table_new_column_from_data_float (cpl_table *table, float *data, const char *name) |
| Create in table a new float column obtained from existing data. More... | |
| cpl_error_code | cpl_table_new_column_from_data_double (cpl_table *table, double *data, const char *name) |
| Create in table a new double column obtained from existing data. More... | |
| cpl_error_code | cpl_table_new_column_from_data_string (cpl_table *table, char **data, const char *name) |
| Create in table a new string column obtained from existing data. More... | |
| cpl_error_code | cpl_table_copy_data (cpl_table *table, const char *name, double *data) |
| Copy a numerical array to an existing table column. More... | |
| cpl_error_code | cpl_table_copy_data_int (cpl_table *table, const char *name, int *data) |
| Copy existing data to a table integer column. More... | |
| cpl_error_code | cpl_table_copy_data_float (cpl_table *table, const char *name, float *data) |
| Copy existing data to a table float column. More... | |
| cpl_error_code | cpl_table_copy_data_double (cpl_table *table, const char *name, double *data) |
| Copy existing data to a table double column. More... | |
| cpl_error_code | cpl_table_copy_data_string (cpl_table *table, const char *name, char **data) |
| Copy existing data to a table string column. More... | |
| void | cpl_table_delete (cpl_table *table) |
| Delete a table. More... | |
| int | cpl_table_get_nrow (cpl_table *table) |
| Get the number of rows in a table. More... | |
| int | cpl_table_get_ncol (cpl_table *table) |
| Get the number of columns in a table. More... | |
| cpl_type | cpl_table_get_column_type (cpl_table *table, const char *name) |
| Get the type of a table column. More... | |
| 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. More... | |
| const char * | cpl_table_get_column_unit (cpl_table *table, const char *name) |
| Get the unit of a table column. More... | |
| 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. More... | |
| const char * | cpl_table_get_column_format (cpl_table *table, const char *name) |
| Get the format of a table column. More... | |
| int * | cpl_table_get_data_int (cpl_table *table, const char *name) |
| Get a pointer to integer column data. More... | |
| float * | cpl_table_get_data_float (cpl_table *table, const char *name) |
| Get a pointer to float column data. More... | |
| double * | cpl_table_get_data_double (cpl_table *table, const char *name) |
| Get a pointer to double column data. More... | |
| char ** | cpl_table_get_data_string (cpl_table *table, const char *name) |
| Get a pointer to string column data. More... | |
| cpl_error_code | cpl_table_delete_column (cpl_table *table, const char *name) |
| Delete a column from a table. More... | |
| cpl_error_code | cpl_table_erase_segment (cpl_table *table, int start, int count) |
| Delete a table segment. More... | |
| cpl_error_code | cpl_table_erase_unselected (cpl_table *table) |
| Keep just the selected rows of a table. More... | |
| cpl_error_code | cpl_table_insert_segment (cpl_table *table, int start, int count) |
| Insert a segment of null rows into table data. More... | |
| int | cpl_table_compare_structures (cpl_table *table1, cpl_table *table2) |
| Compare the structure of two tables. More... | |
| cpl_error_code | cpl_table_merge (cpl_table *target_table, cpl_table *insert_table, int row) |
| Merge two tables that have the same structure. More... | |
| double | cpl_table_get (cpl_table *table, const char *name, int row, int *null) |
| Read a value from a numerical column. More... | |
| int | cpl_table_get_int (cpl_table *table, const char *name, int row, int *null) |
| Read a value from an integer column. More... | |
| float | cpl_table_get_float (cpl_table *table, const char *name, int row, int *null) |
| Read a value from a float column. More... | |
| double | cpl_table_get_double (cpl_table *table, const char *name, int row, int *null) |
| Read a value from a double column. More... | |
| const char * | cpl_table_get_string (cpl_table *table, const char *name, int row) |
| Read a value from a string column. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| cpl_error_code | cpl_table_set_null (cpl_table *table, const char *name, int row) |
| Flag a column element as invalid. More... | |
| cpl_error_code | cpl_table_fill_column (cpl_table *table, const char *name, int start, int count, double value) |
| Write a value to a numerical column segment. More... | |
| cpl_error_code | cpl_table_fill_column_int (cpl_table *table, const char *name, int start, int count, int value) |
| Write a value to an integer column segment. More... | |
| cpl_error_code | cpl_table_fill_column_float (cpl_table *table, const char *name, int start, int count, float value) |
| Write a value to a float column segment. More... | |
| cpl_error_code | cpl_table_fill_column_double (cpl_table *table, const char *name, int start, int count, double value) |
| Write a value to a double column segment. More... | |
| cpl_error_code | cpl_table_fill_column_string (cpl_table *table, const char *name, int start, int count, char *value) |
| Write a character string to a string column segment. More... | |
| cpl_error_code | cpl_table_fill_column_null (cpl_table *table, const char *name, int start, int count) |
| Invalidate a column segment. More... | |
| int | cpl_table_value_is_null (cpl_table *table, const char *name, int row) |
| Check if a column element is invalid. More... | |
| int | cpl_table_column_any_null (cpl_table *table, const char *name) |
| Check if a column contains at least one invalid value. More... | |
| int | cpl_table_column_any_valid (cpl_table *table, const char *name) |
| Check if a column contains at least one valid value. More... | |
| int | cpl_table_column_count_nulls (cpl_table *table, const char *name) |
| Count number of invalid values in a table column. More... | |
| 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. More... | |
| 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. More... | |
| cpl_error_code | cpl_table_rename_column (cpl_table *table, const char *from_name, const char *to_name) |
| Rename a table column. More... | |
| int | cpl_table_column_exists (cpl_table *table, const char *name) |
| Check if a column with a given name exists. More... | |
| int | cpl_table_is_empty (cpl_table *table) |
| Check if a table has columns. More... | |
| const char * | cpl_table_get_column_name (cpl_table *table) |
| Get table columns names. More... | |
| cpl_error_code | cpl_table_resize (cpl_table *table, int new_length) |
| Resize a table to a new number of rows. More... | |
| cpl_table * | cpl_table_duplicate (cpl_table *table) |
| Make a copy of a table. More... | |
| cpl_table * | cpl_table_extract (cpl_table *table, int start, int count) |
| Create a table from a section of another table. More... | |
| cpl_error_code | cpl_table_convert_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. More... | |
| 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. More... | |
| cpl_error_code | cpl_table_subtract_columns (cpl_table *table, const char *to_name, const char *from_name) |
| Subtract two numeric table columns. More... | |
| cpl_error_code | cpl_table_multiply_columns (cpl_table *table, const char *to_name, const char *from_name) |
| Multiply two numeric table columns. More... | |
| cpl_error_code | cpl_table_divide_columns (cpl_table *table, const char *to_name, const char *from_name) |
| Divide two numeric table columns. More... | |
| cpl_error_code | cpl_table_const_op (cpl_table *table, const char *name, double value, int operation) |
| Arithmetic between a numerical column and a constant. More... | |
| cpl_error_code | cpl_table_column_add_constant (cpl_table *table, const char *name, double value) |
| Add a constant value to a numerical column. More... | |
| cpl_error_code | cpl_table_column_subtract_constant (cpl_table *table, const char *name, double value) |
| Subtract a constant value from a numerical column. More... | |
| cpl_error_code | cpl_table_column_multiply_constant (cpl_table *table, const char *name, double value) |
| Multiply a numerical column by a constant. More... | |
| cpl_error_code | cpl_table_column_divide_constant (cpl_table *table, const char *name, double value) |
| Divide a numerical column by a constant. More... | |
| cpl_error_code | cpl_table_column_logarithm (cpl_table *table, const char *name, double base) |
| Compute the logarithm of column values. More... | |
| cpl_error_code | cpl_table_column_exponential (cpl_table *table, const char *name, double base) |
| Compute the exponential of column values. More... | |
| cpl_error_code | cpl_table_column_power (cpl_table *table, const char *name, double exponent) |
| Compute the power of column values. More... | |
| double | cpl_table_column_mean (cpl_table *table, const char *name) |
| Compute the mean value of a numerical column. More... | |
| double | cpl_table_column_median (cpl_table *table, const char *name) |
| Compute the median value of a numerical column. More... | |
| double | cpl_table_column_max (cpl_table *table, const char *name) |
| Get maximum value in a numerical column. More... | |
| double | cpl_table_column_min (cpl_table *table, const char *name) |
| Get minimum value in a numerical column. More... | |
| cpl_error_code | cpl_table_column_maxpos (cpl_table *table, const char *name, int *row) |
| Get position of maximum in a numerical column. More... | |
| cpl_error_code | cpl_table_column_minpos (cpl_table *table, const char *name, int *row) |
| Get position of minimum in a numerical column. More... | |
| cpl_error_code | cpl_table_prune (cpl_table *table) |
| Remove from a table columns and rows just containing invalid elements. More... | |
| cpl_error_code | cpl_table_clean (cpl_table *table) |
| Remove from a table all columns just containing invalid elements, and then all rows containing at least one invalid element. More... | |
| cpl_error_code | cpl_table_select_row (cpl_table *table, int row) |
| Flag a table row as selected. More... | |
| cpl_error_code | cpl_table_select_all (cpl_table *table) |
| Select all table rows. More... | |
| cpl_error_code | cpl_table_unselect_row (cpl_table *table, int row) |
| Flag a table row as unselected. More... | |
| cpl_error_code | cpl_table_unselect_all (cpl_table *table) |
| Unselect all table rows. More... | |
| void | cpl_table_show (cpl_table *table) |
| Describe the structure and the contents of a table. More... | |
| void | cpl_table_print (cpl_table *table, int start, int count) |
| Print a table. More... | |
| cpl_error_code | cpl_table_shift_column (cpl_table *table, const char *name, int shift) |
| Shift the positions of numeric column values. More... | |
| cpl_error_code | cpl_table_column_code_null_int (cpl_table *table, const char *name, int code) |
| Write to invalid integer column elements a numeric code. More... | |
| cpl_error_code | cpl_table_column_code_null_float (cpl_table *table, const char *name, float code) |
| Write to invalid float column elements a numeric code. More... | |
| cpl_error_code | cpl_table_column_code_null_double (cpl_table *table, const char *name, double code) |
| Write to invalid double column elements a numeric code. More... | |
| int | cpl_table_and_select_int (cpl_table *table, const char *name, cpl_table_select_operator operator, const int value) |
| Select from selected table rows, by comparing integer column values with a constant. More... | |
| int | cpl_table_or_select_int (cpl_table *table, const char *name, cpl_table_select_operator operator, const int value) |
| Select from unselected table rows, by comparing column values with a constant. More... | |
| int | cpl_table_and_select_float (cpl_table *table, const char *name, cpl_table_select_operator operator, const float value) |
| Select from selected table rows, by comparing float column values with a constant. More... | |
| int | cpl_table_or_select_float (cpl_table *table, const char *name, cpl_table_select_operator operator, const float value) |
| Select from unselected table rows, by comparing column values with a constant. More... | |
| int | cpl_table_and_select_double (cpl_table *table, const char *name, cpl_table_select_operator operator, const double value) |
| Select from selected table rows, by comparing double column values with a constant. More... | |
| int | cpl_table_or_select_double (cpl_table *table, const char *name, cpl_table_select_operator operator, const double value) |
| Select from unselected table rows, by comparing column values with a constant. More... | |
| int | cpl_table_and_select_string (cpl_table *table, const char *name, cpl_table_select_operator operator, const char *string) |
| Select from selected table rows, by comparing column values with a character string. More... | |
| int | cpl_table_or_select_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. More... | |
| int | cpl_table_and_select_nulls (cpl_table *table, const char *name) |
| Select from selected table rows all rows with invalid values in one column. More... | |
| int | cpl_table_or_select_nulls (cpl_table *table, const char *name) |
| Select from unselected table rows all rows with invalid values in one column. More... | |
| int | cpl_table_and_select_segment (cpl_table *table, int start, int count) |
| Select from selected rows only those within a table segment. More... | |
| int | cpl_table_or_select_segment (cpl_table *table, int start, int count) |
| Select from unselected rows only those within a table segment. More... | |
| int | cpl_table_reverse_selection (cpl_table *table) |
| Select unselected table rows, and unselect selected ones. More... | |
| int | cpl_table_and_select (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 columns. More... | |
| int | cpl_table_or_select (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 columns. More... | |
| cpl_table * | cpl_table_extract_selected (cpl_table *table) |
| Create a new table from the selected rows of another table. More... | |
| cpl_error_code | cpl_table_sort (cpl_table *table, char **names, int ncol, int *reverse) |
| Sort table rows according to columns values. More... | |
| cpl_table * | cpl_table_load (char *filename, int xtnum, int check_nulls) |
| Load a FITS table extension into a new cpl_table. More... | |
| cpl_error_code | cpl_table_save (cpl_table *table, cpl_plist *pheader, cpl_plist *header, char *filename, int append) |
| Save a cpl_table to a FITS file. More... | |
CPL_TYPE_INT, CPL_TYPE_FLOAT, and CPL_TYPE_DOUBLE, plus a type indicating columns made of character strings, CPL_TYPE_STRING. A table column should only be accessed through the cpl_table interface, 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' (null flagged). 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.
NULL pointer the functions will stop with an assertion failure, unless differently specified. An assertion failure would also be generated in case a NULL pointer would be used in place of the name of a table column to access.#include <cpl_table.h>
|
||||||||||||||||
|
Add the values of two numeric table columns.
|
|
||||||||||||||||||||
|
Select from selected table rows, by comparing the values of two columns.
EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, NOT_GREATER_THAN, LESS_THAN, NOT_LESS_THAN. See also the function cpl_table_or_select(). |
|
||||||||||||||||||||
|
Select from selected table rows, by comparing double column values with a constant.
cpl_table_and_select_int(). |
|
||||||||||||||||||||
|
Select from selected table rows, by comparing float column values with a constant.
cpl_table_and_select_int(). |
|
||||||||||||||||||||
|
Select from selected table rows, by comparing integer column values with a constant.
EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, NOT_GREATER_THAN, LESS_THAN, and NOT_LESS_THAN. See also the function cpl_table_or_select_int(). |
|
||||||||||||
|
Select from selected table rows all rows with invalid values in one column.
cpl_table_or_select_nulls(). |
|
||||||||||||||||
|
Select from selected rows only those within a table segment.
cpl_table_or_select_segment(). |
|
||||||||||||||||||||
|
Select from selected table rows, by comparing column values with a character string.
strcmp(), but in case the relational operators EQUAL_TO or NOT_EQUAL_TO are specified, the comparison string is treated as a regular expression. All table rows not fulfilling the comparison are unselected. An invalid element never fulfills any comparison by definition. Allowed relational operators are EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, NOT_GREATER_THAN, LESS_THAN, and NOT_LESS_THAN. See also the function cpl_table_or_select_string(). |
|
|
Remove from a table all columns just containing invalid elements, and then all rows containing at least one invalid element.
cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded. |
|
||||||||||||||||
|
Add a constant value to a numerical column.
|
|
||||||||||||
|
Check if a column contains at least one invalid value.
|
|
||||||||||||
|
Check if a column contains at least one valid value.
|
|
||||||||||||||||
|
Write to invalid double column elements a numeric code.
cpl_table_get_data_double(), invalid elements generally contain garbage. It is for this reason that before directly accessing the column data buffer it would be appropriate to replace the garbage with a conventional value (or code). This value would supposedly be recognised and handled properly by a given foreign method applied to the pointed data buffer. Note that assigning a code to invalid column values will not make them valid. Note also that the code is just momentarily assigned to the existing invalid values, and would not be maintained in any way during further processing of the table. For this reason the code should be applied just before it is actually needed. |
|
||||||||||||||||
|
Write to invalid float column elements a numeric code.
cpl_table_get_data_float(), invalid elements generally contain garbage. It is for this reason that before directly accessing the column data buffer it would be appropriate to replace the garbage with a conventional value (or code). This value will supposedly be recognised and handled properly by a given foreign method applied to the pointed data buffer. Note that assigning a code to invalid column values will not make them valid. Note also that the code is just momentarily assigned to the existing invalid values, and would not be maintained in any way during further processing of the table. For this reason the code should be applied just before it is actually needed. |
|
||||||||||||||||
|
Write to invalid integer column elements a numeric code.
cpl_table_get_data_int(), invalid elements generally contain garbage. It is for this reason that before directly accessing the column data buffer it would be appropriate to replace the garbage with a conventional value (or code). This value will supposedly be recognised and handled properly by a given foreign method applied to the pointed data buffer. Note that assigning a code to invalid column values will not make them valid. Note also that the code is just momentarily assigned to the existing invalid values, and would not be maintained in any way during further processing of the table. For this reason the code should be applied just before it is actually needed. |
|
||||||||||||
|
Count number of invalid values in a table column.
|
|
||||||||||||||||
|
Divide a numerical column by a constant.
|
|
||||||||||||
|
Check if a column with a given name exists.
|
|
||||||||||||||||
|
Compute the exponential of column values.
|
|
||||||||||||||||
|
Compute the logarithm of column values.
|
|
||||||||||||
|
Get maximum value in a numerical column.
cpl_table_column_mean(). |
|
||||||||||||||||
|
Get position of maximum in a numerical column.
|
|
||||||||||||
|
Compute the mean value of a numerical column.
|
|
||||||||||||
|
Compute the median value of a numerical column.
cpl_table_column_mean(). |
|
||||||||||||
|
Get minimum value in a numerical column.
cpl_table_column_mean(). |
|
||||||||||||||||
|
Get position of minimum in a numerical column.
cpl_table_column_maxpos(). |
|
||||||||||||||||
|
Multiply a numerical column by a constant.
cpl_table_column_add_constant(). |
|
||||||||||||||||
|
Compute the power of column values.
|
|
||||||||||||||||
|
Subtract a constant value from a numerical column.
cpl_table_column_add_constant(). |
|
||||||||||||
|
Compare the structure of two tables.
|
|
||||||||||||||||||||
|
Arithmetic between a numerical column and a constant.
cpl_table_const_op(table, name, 1.23, '^'); cpl_table_column_power(table, name, 1.23); |
|
||||||||||||||||||||
|
Cast a numeric column to a new numeric type column.
cpl_table_duplicate_column(). |
|
||||||||||||||||
|
Copy a numerical array to an existing table column.
cpl_table_set_null() and cpl_table_fill_column_null(). |
|
||||||||||||||||
|
Copy existing data to a table double column.
cpl_table_copy_data_int() for further details. |
|
||||||||||||||||
|
Copy existing data to a table float column.
cpl_table_copy_data_int() for further details. |
|
||||||||||||||||
|
Copy existing data to a table integer column.
cpl_table_set_null() and cpl_table_fill_column_null(). |
|
||||||||||||||||
|
Copy existing data to a table string column.
cpl_table_copy_data_int() for further details. In the particular case of a string column, it should be noted that the data are copied in-depth, i.e., also the pointed strings are duplicated. Strings contained in the existing table column are deallocated before being replaced by the new ones. |
|
|
Delete a table.
NULL, nothing is done. |
|
||||||||||||
|
Delete a column from a table.
|
|
||||||||||||||||
|
Divide two numeric table columns.
|
|
|
Make a copy of a table.
NULL, as in case of any other error, a NULL is returned. The copy operation is done "in depth": columns data are duplicated too, not just their pointers. Also the selection flags of the original table are transferred to the new table. |
|
||||||||||||||||||||
|
Copy a column from a table to another.
|
|
||||||||||||||||
|
Delete a table segment.
cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded. The table selection flags are reset. The specified segment can extend beyond the end of the table, but an attempt to remove all table rows would be flagged as an error because zero length tables are illegal, and the table will not be modified. |
|
|
Keep just the selected rows of a table.
cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded. The table selection flags are reset. An attempt to remove all table rows is flagged as an error because zero length tables are illegal, and the table will not be modified. |
|
||||||||||||||||
|
Create a table from a section of another table.
cpl_table_compare_structures() ). Specifying a start beyond the table boundaries, or a non-positive count, would generate an assertion failure. If the sum of start and count goes beyond the end of the input table, rows are copied up to the end. Existing null flags are also transferred to the new table columns, but not the selection flags. |
|
|
Create a new table from the selected rows of another table.
|
|
||||||||||||||||||||||||
|
Write a value to a numerical column segment.
cpl_table_fill_column_null() instead. Specifying a start beyond the table boundaries, or a non-positive count, would generate an assertion failure. If the sum of start and count exceeds the number of elements in the column, the column is filled up to its end. |
|
||||||||||||||||||||||||
|
Write a value to a double column segment.
CPL_TYPE_DOUBLE. For automatic conversion to the accessed column type use the function cpl_table_fill_column(). The written values are automatically marked as valid, and the table selection flags are reset. To set a column interval to null use cpl_table_fill_column_null() instead. Specifying a start beyond the table boundaries, or a non-positive count, would generate an assertion failure. If the sum of start and count exceeds the number of elements in the column, the column is filled up to its end. |
|
||||||||||||||||||||||||
|
Write a value to a float column segment.
CPL_TYPE_FLOAT. For automatic conversion to the accessed column type use the function cpl_table_fill_column(). The written values are automatically marked as valid, and the table selection flags are reset. To set a column interval to null use cpl_table_fill_column_null() instead. Specifying a start beyond the table boundaries, or a non-positive count, would generate an assertion failure. If the sum of start and count exceeds the number of elements in the column, the column is filled up to its end. |
|
||||||||||||||||||||||||
|
Write a value to an integer column segment.
CPL_TYPE_INT. For automatic conversion to the accessed column type use the function cpl_table_fill_column(). The written values are automatically marked as valid, and the table selection flags are reset. To set a column interval to null use cpl_table_fill_column_null() instead. Specifying a start beyond the table boundaries, or a non-positive count, would generate an assertion failure. If the sum of start and count exceeds the number of elements in the column, the column is filled up to its end. |
|
||||||||||||||||||||
|
Invalidate a column segment.
|
|
||||||||||||||||||||||||
|
Write a character string to a string column segment.
CPL_TYPE_STRING. If the input string is not a NULL, it is duplicated for each accessed column element. If the input string is NULL, this call is equivalent to a call to cpl_table_fill_column_null(). The table selection flags are always reset. Specifying a start beyond the table boundaries, or a non-positive count, would generate an assertion failure. If the sum of start and count exceeds the number of elements in the column, the column is filled up to its end. |
|
||||||||||||||||||||
|
Read a value from a numerical column.
NULL, and in that case this option will be disabled. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||
|
Get the format of a table column.
cpl_column_set_format() will turn it into garbage. Therefore, if a real copy of a column unit is required, this function should be called as an argument of the function strdup(). |
|
|
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_rename_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(). |
|
||||||||||||
|
Get the type of a table column.
CPL_TYPE_INVALID is returned and CPL_ERROR_DATA_NOT_FOUND is set. |
|
||||||||||||
|
Get the unit of a table column.
cpl_column_set_unit() will turn it into garbage. Therefore, if a real copy of a column unit is required, this function should be called as an argument of the function strdup(). If the input column has no unit, or in case of error, a NULL is returned. |
|
||||||||||||
|
Get a pointer to double column data.
CPL_TYPE_DOUBLE includes an array of values of type double. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_column_code_null_double() should be called just before this function, physically assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_column_code_null_double() for more details.
|
|
||||||||||||
|
Get a pointer to float column data.
CPL_TYPE_FLOAT includes an array of values of type float. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_column_code_null_float() should be called just before this function, physically assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_column_code_null_float() for more details.
|
|
||||||||||||
|
Get a pointer to integer column data.
CPL_TYPE_INT includes an array of values of type int. This function returns a pointer to this array. The data buffer elements corresponding to invalid column elements would in general contain garbage. To avoid this, cpl_table_column_code_null_int() should be called just before this function, physically assigning to all the invalid column elements an ad hoc numerical value. See the description of function cpl_table_column_code_null_int() for more details.
|
|
||||||||||||
|
Get a pointer to string column data.
CPL_TYPE_STRING includes an array of values of type char*. This function returns a pointer to this array.
|
|
||||||||||||||||||||
|
Read a value from a double column.
CPL_TYPE_DOUBLE. For automatic conversion (always to type double), use the function cpl_table_get(). In case of error, or of a null column element, the returned value is always set to zero. A null flag may be returned to indicate whether the accessed column element is a null (1) or not (0). The null flag also signals possible error conditions (-1), as specifying a column that is not double, or that cannot be found. The null flag pointer can also be NULL, and in that case this option will be disabled. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||||||||||
|
Read a value from a float column.
CPL_TYPE_FLOAT. For automatic conversion (always to type double), use the function cpl_table_get(). In case of error, or of a null column element, the returned value is always set to zero. A null flag may be returned to indicate whether the accessed column element is a null (1) or not (0). The null flag also signals possible error conditions (-1), as specifying a column that is not float, or that cannot be found. The null flag pointer can also be NULL, and in that case this option will be disabled. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||||||||||
|
Read a value from an integer column.
CPL_TYPE_INT. For automatic conversion (always to type double), use the function cpl_table_get(). In case of error, or of a null column element, the returned value is always set to zero. A null flag may be returned to indicate whether the accessed column element is a null (1) or not (0). The null flag also signals possible error conditions (-1), as specifying a column that is not integer, or that cannot be found. The null flag pointer can also be NULL, and in that case this option will be disabled. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
|
Get the number of columns in a table.
NULL, zero is returned. |
|
|
Get the number of rows in a table.
NULL, zero is returned. |
|
||||||||||||||||
|
Read a value from a string column.
CPL_TYPE_STRING. In case of error, or of a null column element, a NULL pointer is returned. Specifying a row beyond the table boundaries would generate an assertion failure. Note that the returned string is a pointer to a column element, not its copy. Its manipulation will directly affect that column element, while changing that column element using cpl_table_set_string() will turn it into garbage. Therefore, if a real copy of a string column element is required, this function should be called as the argument of the function strdup(). |
|
||||||||||||||||
|
Insert a segment of null rows into table data.
cpl_table_fill_column_null(): here a portion of new data is physically inserted. Setting start to a number greater than the column length is legal, and has the effect of appending null rows at the end of the table: this is equivalent to expanding the table using cpl_table_resize(). The pointers to column data values may change, therefore pointers previously retrieved by calling cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded. |
|
|
Check if a table has columns.
|
|
||||||||||||||||
|
Load a FITS table extension into a new cpl_table.
|
|
||||||||||||||||
|
Merge two tables that have the same structure.
cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded.
|
|
||||||||||||||||
|
Move a column from a table to another.
|
|
||||||||||||||||
|
Multiply two numeric table columns.
|
|
|
Create an empty table structure.
|
|
||||||||||||
|
Create an empty double column in a table.
CPL_TYPE_DOUBLE. See the description of cpl_table_new_column_int() for further details. |
|
||||||||||||
|
Create an empty float column in a table.
CPL_TYPE_FLOAT. See the description of cpl_table_new_column_int() for further details. |
|
||||||||||||||||
|
Create in table a new double column obtained from existing data.
CPL_TYPE_DOUBLE that will encapsulate the given data. See the description of cpl_table_new_column_from_data_int() for further details. |
|
||||||||||||||||
|
Create in table a new float column obtained from existing data.
CPL_TYPE_FLOAT that will encapsulate the given data. See the description of cpl_table_new_column_from_data_int() for further details. |
|
||||||||||||||||
|
Create in table a new integer column obtained from existing data.
CPL_TYPE_INT that will encapsulate the given data. To specify NULL pointers would cause an assertion failure. The size of the input data array is not checked in any way, and it is expected to match the number of rows assigned to the given table. The pointed data values are all taken as valid: invalid values should be marked using the functions cpl_table_set_null() and cpl_table_fill_column_null(). The data buffer is not copied, so it should not be deallocated while the table column is still in use: the functions cpl_table_delete_column() or cpl_table_delete() would take care of deallocating it. To avoid problems with the memory managment, the specified data buffer should have been allocated using the functions of the cpl_memory module, and statically allocated data should be avoided too. |
|
||||||||||||||||
|
Create in table a new string column obtained from existing data.
CPL_TYPE_STRING that will encapsulate the given data. See the description of cpl_table_new_column_from_data_int() for further details, especially with regard to memory managment. In the specific case of string columns the described restrictions applies also to the single column elements (strings). To deallocate specific column elements the functions cpl_table_set_null() and cpl_table_fill_column_null() should be used. |
|
||||||||||||
|
Create an empty integer column in a table.
CPL_TYPE_INT. The new column name must be different from any other column name in the table. All the elements of the new column are flagged as nulls. |
|
||||||||||||
|
Create an empty string column in a table.
CPL_TYPE_STRING. See the description of cpl_table_new_column_int() for further details. |
|
||||||||||||
|
Create a table from a model table.
NULL values. length must be positive, or an assertion failure would be generated. |
|
||||||||||||||||||||
|
Select from unselected table rows, by comparing the values of two columns.
EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, NOT_GREATER_THAN, LESS_THAN, NOT_LESS_THAN. See also the function cpl_table_and_select(). |
|
||||||||||||||||||||
|
Select from unselected table rows, by comparing column values with a constant.
cpl_table_or_select_int(). |
|
||||||||||||||||||||
|
Select from unselected table rows, by comparing column values with a constant.
cpl_table_or_select_int(). |
|
||||||||||||||||||||
|
Select from unselected table rows, by comparing column values with a constant.
EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, NOT_GREATER_THAN, LESS_THAN, and NOT_LESS_THAN. See also the description of the function cpl_table_and_select_int(). |
|
||||||||||||
|
Select from unselected table rows all rows with invalid values in one column.
cpl_table_and_select_nulls(). |
|
||||||||||||||||
|
Select from unselected rows only those within a table segment.
cpl_table_and_select_segment(). |
|
||||||||||||||||||||
|
Select from unselected table rows, by comparing column values with a constant.
strcmp(), but in case the relational operators EQUAL_TO or NOT_EQUAL_TO are specified, the comparison string is treated as a regular expression. All table rows fulfilling the comparison are selected. An invalid element never fulfills any comparison by definition. The returned value is the final number of selected rows in the whole table. Allowed relational operators are EQUAL_TO, NOT_EQUAL_TO, GREATER_THAN, NOT_GREATER_THAN, LESS_THAN, and NOT_LESS_THAN. See also the function cpl_table_and_select_string(). |
|
||||||||||||||||
|
Print a table.
cpl_table_set_column_format(). The default column formats have been choosen 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 an assertion failure. 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. |
|
|
Remove from a table columns and rows just containing invalid elements.
cpl_table_get_data_int(), cpl_table_get_data_string(), etc., should be discarded. If the input table contains just invalid elements nothing is done, and a failure is returned. |
|
||||||||||||||||
|
Rename a table column.
NULL pointer is passed, an assertion failure would be generated. |
|
||||||||||||
|
Resize a table to a new number of rows.
cpl_table_get_data_int(), cpl_table_get_data_string(), etc. should be discarded. Specifying a non-positive length would generate an assertion failure. |
|
|
Select unselected table rows, and unselect selected ones.
|
|
||||||||||||||||||||||||
|
Save a cpl_table to a FITS file.
NULL pheader is passed, the primary array would be created with just such entries, that are mandatory in any regular FITS file. The second property list, header, is assumed to contain entries for the FITS table extension header. In this property list any property name related to the FITS convention, as XTENSION, BITPIX, NAXIS, PCOUNT, GCOUNT, and END, and to the table structure, as TFIELDS, TTYPEi, TUNITi, TDISPi, TNULLi, TFORMi, would be ignored: such entries are always computed internally, to guarantee their consistency with the actual table structure. A DATE keyword containing the date of table creation in ISO8601 format is also added automatically.
|
|
|
Select all table rows.
|
|
||||||||||||
|
Flag a table row as selected.
|
|
||||||||||||||||||||
|
Write a value to a numerical table column element.
cpl_table_set_null() instead. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||||||
|
Give a new format to a table column.
NULL pointer, "%s" will be used if the column is of type CPL_TYPE_STRING, "% 1.5e" if the column is of type CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE, and "% 7d" if it is of type CPL_TYPE_INT. The format associated to a column has no effect on any operation performed on columns, and it is used just in the printf() calls made while printing a table using the function cpl_table_print(). |
|
||||||||||||||||
|
Give a new unit to a table column.
NULL pointer, the column will be unitless. The unit associated to a column has no effect on any operation performed on columns, and it must be considered just an optional description of the content of a column. |
|
||||||||||||||||||||
|
Write a value to a double table column element.
CPL_TYPE_DOUBLE. For automatic conversion to the accessed column type use the function cpl_table_set(). The written value is automatically marked as valid, and the table selection flags are reset. To set a column value to null use cpl_table_set_null() instead. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||||||||||
|
Write a value to a float table column element.
CPL_TYPE_FLOAT. For automatic conversion to the accessed column type use the function cpl_table_set(). The written value is automatically marked as valid, and the table selection flags are reset. To set a column value to null use cpl_table_set_null() instead. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||||||||||
|
Write a value to an integer table column element.
CPL_TYPE_INT. For automatic conversion to the accessed column type use the function cpl_table_set(). The written value is automatically marked as valid, and the table selection flags are reset. To set a column value to null use cpl_table_set_null() instead. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||||||
|
Flag a column element as invalid.
NULL. For other data types, the corresponding element is flagged internally as invalid. Invalidating any table column element resets the table selection flags. Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||||||||||
|
Write a character string to a string table column element.
CPL_TYPE_STRING. The written value can also be a NULL pointer, that is equivalent to a call to cpl_table_set_null(). Writing a value to any table column element resets the table selection flags. Note that the character string is physically copied, therefore the original can be modified without affecting the column content. To "plug" a character string directly into a column element, use the function cpl_table_get_data_string(). Specifying a row beyond the table boundaries would generate an assertion failure. |
|
||||||||||||||||
|
Shift the positions of numeric column values.
|
|
|
Describe the structure and the contents of a table.
|
|
||||||||||||||||||||
|
Sort table rows according to columns values.
NULL pointer, sorting according to increasing values is always assumed. If ncol is not positive, or exceeds the total number of columns in the table, an assertion failure is generated. |
|
||||||||||||||||
|
Subtract two numeric table columns.
|
|
|
Unselect all table rows.
|
|
||||||||||||
|
Flag a table row as unselected.
|
|
||||||||||||||||
|
Check if a column element is invalid.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002