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/12/09 18:25:31 $ 00023 * $Revision: 1.5 $ 00024 * $Name: HEAD $ 00025 */ 00026 #ifndef XSH_DATA_SPECTRUM1D_H 00027 #define XSH_DATA_SPECTRUM1D_H 00028 00029 #include <cpl.h> 00030 #include <xsh_data_instrument.h> 00031 00032 #define XSH_SPECTRUM1D_DATA_TYPE CPL_TYPE_FLOAT 00033 #define XSH_SPECTRUM1D_DATA_BPP CPL_BPP_IEEE_FLOAT 00034 #define XSH_SPECTRUM1D_ERRS_TYPE CPL_TYPE_FLOAT 00035 #define XSH_SPECTRUM1D_ERRS_BPP CPL_BPP_IEEE_FLOAT 00036 #define XSH_SPECTRUM1D_QUAL_TYPE CPL_TYPE_INT 00037 #define XSH_SPECTRUM1D_QUAL_BPP CPL_BPP_32_SIGNED 00038 00039 typedef struct{ 00040 /* size of the order */ 00041 int size; 00042 /* Minimal spectrum lambda */ 00043 double lambda_min; 00044 /* Maximal spectrum lambda */ 00045 double lambda_max; 00046 /* step in lambda */ 00047 double lambda_step; 00048 /* flux data */ 00049 cpl_propertylist* flux_header; 00050 cpl_image *flux; 00051 /* errs */ 00052 cpl_propertylist* errs_header; 00053 cpl_image *errs; 00054 /* qual */ 00055 cpl_propertylist* qual_header; 00056 cpl_image *qual; 00057 }xsh_spectrum1D; 00058 00059 xsh_spectrum1D* xsh_spectrum1D_create( double lambda_min, double lambda_max, 00060 double lambda_step); 00061 xsh_spectrum1D* xsh_spectrum1D_load( cpl_frame* s1d_frame, 00062 xsh_instrument* instr); 00063 int xsh_spectrum1D_get_size( xsh_spectrum1D* s); 00064 double xsh_spectrum1D_get_lambda_min( xsh_spectrum1D* s); 00065 double xsh_spectrum1D_get_lambda_max( xsh_spectrum1D* s); 00066 double xsh_spectrum1D_get_lambda_step( xsh_spectrum1D* s); 00067 double* xsh_spectrum1D_get_flux( xsh_spectrum1D* s); 00068 double* xsh_spectrum1D_get_errs( xsh_spectrum1D* s); 00069 int* xsh_spectrum1D_get_qual( xsh_spectrum1D* s); 00070 cpl_frame* xsh_spectrum1D_save( xsh_spectrum1D* s, const char* filename); 00071 void xsh_spectrum1D_free( xsh_spectrum1D** list); 00072 cpl_error_code 00073 xsh_monitor_spectrum1D_flux(cpl_frame* in_frm,xsh_instrument* instrument); 00074 00075 00076 #endif /* XSH_DATA_SPECTRUM1D_H */