75 double * plambda=NULL;
84 if((fout=fopen(filename,
"w"))==NULL) {
86 return CPL_ERROR_FILE_IO ;
89 fprintf(fout,
"%f %f \n", plambda[i], pK[i]);
92 if ( fout ) fclose( fout ) ;
95 return cpl_error_get_code() ;
101 cpl_table *table = NULL ;
102 const char * tablename = NULL ;
105 double * plambda, * pK ;
111 check(tablename = cpl_frame_get_filename( ext_frame ));
115 check( nentries = cpl_table_get_nrow( table ) ) ;
120 plambda = result->
lambda ;
123 xsh_msg_warning(
"You are using an obsolete atm extinction line table");
128 for( i = 0 ; i< nentries ; i++, plambda++, pK++ ) {
132 CPL_TYPE_FLOAT, i, &value ) ) ;
135 CPL_TYPE_FLOAT, i, &value ) ) ;
140 if (cpl_error_get_code () != CPL_ERROR_NONE) {
141 xsh_error_msg(
"can't load frame %s",cpl_frame_get_filename(ext_frame));
151 if ( list != NULL && *list != NULL ) {
152 check( cpl_free( (*list)->lambda ) ) ;
153 check( cpl_free( (*list)->K ) ) ;
154 check( cpl_free( *list ) ) ;
#define XSH_ASSURE_NOT_NULL_MSG(pointer, msg)
#define xsh_error_msg(...)
#define XSH_ASSURE_NOT_NULL(pointer)
#define xsh_msg_warning(...)
Print an warning message.
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.
xsh_atmos_ext_list * xsh_atmos_ext_list_create(int size)
double * xsh_atmos_ext_list_get_K(xsh_atmos_ext_list *list)
cpl_error_code xsh_atmos_ext_dump_ascii(xsh_atmos_ext_list *list, const char *filename)
xsh_atmos_ext_list * xsh_atmos_ext_list_load(cpl_frame *ext_frame)
void xsh_atmos_ext_list_free(xsh_atmos_ext_list **list)
double * xsh_atmos_ext_list_get_lambda(xsh_atmos_ext_list *list)
#define XSH_ATMOS_EXT_LIST_COLNAME_OLD
#define XSH_ATMOS_EXT_LIST_COLNAME_K
#define XSH_ATMOS_EXT_LIST_COLNAME_WAVELENGTH
#define XSH_CALLOC(POINTER, TYPE, SIZE)
#define XSH_TABLE_LOAD(TABLE, NAME)
#define XSH_TABLE_FREE(TABLE)