00001 /* * 00002 * This file is part of the ESO X-shooter Pipeline * 00003 * Copyright (C) 2006 European Southern Observatory * 00004 * * 00005 * This library is/ free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the Free Software * 00017 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA * 00018 * */ 00019 00020 /* 00021 * $Author: amodigli $ 00022 * $Date: 2009/09/27 10:37:36 $ 00023 * $Revision: 1.10 $ 00024 * $Name: HEAD $ 00025 */ 00026 #ifndef XSH_DATA_ARCLIST_H 00027 #define XSH_DATA_ARCLIST_H 00028 00029 #include <cpl.h> 00030 00031 00032 #define XSH_ARCLIST_TABLE_NB_COL 4 00033 #define XSH_ARCLIST_TABLE_COLNAME_WAVELENGTH "WAVELENGTH" 00034 #define XSH_ARCLIST_TABLE_UNIT_WAVELENGTH "none" 00035 #define XSH_ARCLIST_TABLE_COLNAME_NAME "NAME" 00036 #define XSH_ARCLIST_TABLE_UNIT_NAME "none" 00037 #define XSH_ARCLIST_TABLE_COLNAME_FLUX "FLUX" 00038 #define XSH_ARCLIST_TABLE_UNIT_FLUX "none" 00039 #define XSH_ARCLIST_TABLE_COLNAME_COMMENT "COMMENT" 00040 #define XSH_ARCLIST_TABLE_UNIT_COMMENT "none" 00041 00042 typedef struct{ 00043 /* wavelength of arc line */ 00044 float wavelength; 00045 /* name of arc line*/ 00046 char* name; 00047 /* value of flux */ 00048 int flux; 00049 /* comment */ 00050 char* comment; 00051 }xsh_arcline; 00052 00053 00054 typedef struct{ 00055 int size; 00056 int nbrejected; 00057 int* rejected; 00058 xsh_arcline** list; 00059 cpl_propertylist* header; 00060 }xsh_arclist; 00061 00062 xsh_arclist* xsh_arclist_load(cpl_frame* frame); 00063 void xsh_arcline_free(xsh_arcline** line); 00064 void xsh_arclist_free(xsh_arclist** list); 00065 void xsh_arclist_reject(xsh_arclist* l, int i); 00066 void xsh_arclist_restore(xsh_arclist* l, int i); 00067 int xsh_arclist_get_nbrejected(xsh_arclist* l); 00068 float xsh_arclist_get_wavelength(xsh_arclist* l, int i); 00069 int xsh_arclist_get_size(xsh_arclist* list); 00070 int xsh_arclist_is_rejected(xsh_arclist* list, int idx); 00071 void xsh_arclist_clean(xsh_arclist* list); 00072 void xsh_arclist_clean_from_list( xsh_arclist* list, double* lambda, int size); 00073 cpl_propertylist* xsh_arclist_get_header(xsh_arclist* list); 00074 void xsh_arclist_lambda_sort(xsh_arclist* list); 00075 cpl_frame* xsh_arclist_save(xsh_arclist* list,const char* filename,const char* tag); 00076 void xsh_dump_arclist( xsh_arclist* list ) ; 00077 #endif /* XSH_ARCLIST_H */