X-shooter Pipeline Reference Manual 3.8.15
Macros | Functions
xsh_utils_table.h File Reference
#include <cpl.h>
#include <xsh_error.h>

Go to the source code of this file.

Macros

#define XSH_TABLE_LOAD(TABLE, NAME)
 
#define XSH_TABLE_FREE(TABLE)
 
#define XSH_TABLE_GET_ARRAY(TYPE)
 

Functions

cpl_error_code xsh_get_table_value (const cpl_table *table, const char *colname, cpl_type coltype, int i, void *result)
 Read a table value from a fits table.
 
void xsh_table_get_array_int (cpl_table *table, const char *colname, int *pointer, int nb)
 
void xsh_table_get_array_float (cpl_table *table, const char *colname, float *pointer, int nb)
 
void xsh_table_get_array_double (cpl_table *table, const char *colname, double *pointer, int nb)
 
cpl_error_code xsh_sort_table_1 (cpl_table *t, const char *column1, cpl_boolean reverse1)
 Sort a table by one column.
 
cpl_error_code xsh_sort_table_2 (cpl_table *t, const char *column1, const char *column2, cpl_boolean reverse1, cpl_boolean reverse2)
 Sort a table by two columns.
 
cpl_error_code xsh_sort_table_3 (cpl_table *t, const char *column1, const char *column2, const char *column3, cpl_boolean reverse1, cpl_boolean reverse2, cpl_boolean reverse3)
 Sort a table by two columns.
 
double xsh_data_interpolate (double wav, int nrow, double *pw, double *pe)
 Interpolate data points.
 
double xsh_table_interpolate (cpl_table *tbl, double wav, const char *colx, const char *coly)
 Interpolate table columns.
 
cpl_error_code xsh_frame_table_monitor_flux_qc (cpl_frame *frm, const char *colw, const char *colf, const char *prefix, xsh_instrument *instrument)
 Computes statistics on spectrum for QC.
 
cpl_error_code xsh_wavecal_qclog_intmon (cpl_frame *table_check, const cpl_frame *line_intmon, const double exptime, xsh_instrument *inst)
 computes intmon QC log
 
cpl_error_code xsh_table_merge_clean_and_resid_tabs (cpl_frame *frm_resid, cpl_frame *frm_clean)
 
cpl_table * xsh_table_shift_rv (cpl_table *orig, const char *col_wave, const double offset)
 
cpl_table * xsh_histogram (const cpl_table *data, const char *cname, const int nbins, const double min, const double max)
 

Macro Definition Documentation

◆ XSH_TABLE_FREE

#define XSH_TABLE_FREE (   TABLE)
Value:
if (TABLE != NULL){\
cpl_table_delete ( TABLE);\
TABLE = NULL;\
}

Definition at line 44 of file xsh_utils_table.h.

◆ XSH_TABLE_GET_ARRAY

#define XSH_TABLE_GET_ARRAY (   TYPE)
Value:
void xsh_table_get_array_##TYPE( cpl_table* table, const char* colname, \
TYPE* pointer, int nb)\
{\
const cpl_array* array = NULL;\
int array_size = 0, k=0;\
const TYPE* data = NULL;\
\
XSH_ASSURE_NOT_NULL( pointer);\
check( array = cpl_table_get_array( table, colname, 0));\
check( array_size = cpl_array_get_size( array));\
XSH_ASSURE_NOT_ILLEGAL( nb == array_size);\
check( data = cpl_array_get_data_##TYPE##_const( array));\
for( k=0; k< array_size; k++){\
pointer[k] = data[k];\
}\
cleanup:\
return;\
}

Definition at line 51 of file xsh_utils_table.h.

◆ XSH_TABLE_LOAD

#define XSH_TABLE_LOAD (   TABLE,
  NAME 
)
Value:
check_msg( TABLE = cpl_table_load( NAME, 1, 0),\
"Can't load %s FITS table", NAME)
#define check_msg(COMMAND,...)
Definition: xsh_error.h:62

Definition at line 40 of file xsh_utils_table.h.

Function Documentation

◆ xsh_table_get_array_double()

void xsh_table_get_array_double ( cpl_table *  table,
const char *  colname,
double *  pointer,
int  nb 
)

Referenced by xsh_rec_list_load().

◆ xsh_table_get_array_float()

void xsh_table_get_array_float ( cpl_table *  table,
const char *  colname,
float *  pointer,
int  nb 
)

Referenced by xsh_rec_list_load().

◆ xsh_table_get_array_int()

void xsh_table_get_array_int ( cpl_table *  table,
const char *  colname,
int *  pointer,
int  nb 
)