68 lb = (*b)->wavelength;
226 cpl_propertylist * res = NULL;
249 for(i=0; i< list->
size; i++) {
250 const char* name = list->
list[i]->
name;
252 if (name == NULL) name =
"";
253 if (comment == NULL) comment =
"";
254 xsh_msg(
" Wavelength %f name %s flux %d comment %s",
273 cpl_table* table = NULL;
274 const char* tablename = NULL;
282 check(tablename = cpl_frame_get_filename(frame));
290 check(result->
size = cpl_table_get_nrow(table));
295 check(result->
header = cpl_propertylist_load(tablename, 0));
298 for(i=0;i<result->
size;i++){
299 const char* name =
"";
300 const char* comment =
"";
306 CPL_TYPE_STRING, i, &name));
308 CPL_TYPE_INT, i, &(arc->
flux)));
310 CPL_TYPE_STRING, i, &comment));
317 if (comment != NULL) {
323 result->
list[i] = arc;
327 if (cpl_error_get_code () != CPL_ERROR_NONE) {
328 xsh_error_msg(
"can't load frame %s",cpl_frame_get_filename(frame));
344 if ((*arc)->name != NULL) {
345 cpl_free((*arc)->name);
347 if ((*arc)->comment != NULL) {
348 cpl_free((*arc)->comment);
367 for (i=0; i< (*list)->size; i++) {
371 cpl_free((*list)->list);
400 for( i=0; i< list->
size; i++){
402 double arc_lambda = 0.0;
406 for ( j = 0 ; j<
size ; j++ ) {
435 for( i=0; i< list->
size; i++){
437 double arc_lambda = 0.0;
440 for ( j = 0 ; j<
size ; j++ ) {
472 for(i=0;i<list->
size;i++)
502 cpl_table* table = NULL;
503 cpl_frame * result = NULL ;
540 check(cpl_table_set_size(table,list->
size));
543 for(i=0;i<list->
size;i++){
555 check(cpl_table_save(table, list->
header, NULL, filename, CPL_IO_DEFAULT));
559 CPL_FRAME_TYPE_TABLE,
560 CPL_FRAME_GROUP_PRODUCT,
561 CPL_FRAME_LEVEL_TEMPORARY));
void xsh_arclist_lambda_sort(xsh_arclist *list)
sort arcline list by increasing lambda
void xsh_dump_arclist(xsh_arclist *list)
Dump main info about an arcline_list.
void xsh_arclist_clean_from_list_not_flagged(xsh_arclist *list, double *lambda, int *flag, int size)
static int xsh_arclist_lambda_compare(const void *one, const void *two)
float xsh_arclist_get_wavelength(xsh_arclist *list, int idx)
get wavelength of a line in the arcline list
void xsh_arclist_clean(xsh_arclist *list)
void xsh_arclist_clean_from_list(xsh_arclist *list, double *lambda, int size)
Clean an arclist according to a list of valid lambda.
int xsh_arclist_get_nbrejected(xsh_arclist *list)
get nb lines rejected in arcline list
void xsh_arclist_free(xsh_arclist **list)
free memory associated to a arclist
void xsh_arclist_restore(xsh_arclist *list, int idx)
restore a line from the list
int xsh_arclist_get_size(xsh_arclist *list)
get size of arcline list
void xsh_arclist_reject(xsh_arclist *list, int idx)
reject a line from the list
xsh_arclist * xsh_arclist_load(cpl_frame *frame)
load an arcline list frame in arclist structure
void xsh_arcline_free(xsh_arcline **arc)
free memory associated to a arcline
int xsh_arclist_is_rejected(xsh_arclist *list, int idx)
give if a line is rejected
cpl_propertylist * xsh_arclist_get_header(xsh_arclist *list)
get header of the table
cpl_frame * xsh_arclist_save(xsh_arclist *list, const char *filename, const char *tag)
save a arclist to a frame
#define XSH_REGDEBUG(...)
#define XSH_ASSURE_NOT_ILLEGAL(cond)
#define xsh_error_msg(...)
#define XSH_ASSURE_NOT_NULL(pointer)
#define xsh_msg(...)
Print a message on info level.
char * xsh_stringdup(const char *s)
String duplication.
void xsh_free_propertylist(cpl_propertylist **p)
Deallocate a property list and set the pointer to NULL.
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.
cpl_propertylist * header
#define XSH_ARCLIST_TABLE_COLNAME_WAVELENGTH
#define XSH_ARCLIST_TABLE_UNIT_WAVELENGTH
#define XSH_ARCLIST_TABLE_COLNAME_NAME
#define XSH_ARCLIST_TABLE_UNIT_NAME
#define XSH_ARCLIST_TABLE_COLNAME_FLUX
#define XSH_ARCLIST_TABLE_UNIT_FLUX
#define XSH_ARCLIST_TABLE_NB_COL
#define XSH_ARCLIST_TABLE_COLNAME_COMMENT
#define XSH_ARCLIST_TABLE_UNIT_COMMENT
cpl_frame * xsh_frame_product(const char *fname, const char *tag, cpl_frame_type type, cpl_frame_group group, cpl_frame_level level)
Creates a frame with given characteristics.
#define WAVELENGTH_PRECISION
#define XSH_FREE(POINTER)
#define XSH_CALLOC(POINTER, TYPE, SIZE)
#define XSH_TABLE_LOAD(TABLE, NAME)
#define XSH_TABLE_FREE(TABLE)