GIRAFFE Pipeline Reference Manual

girebinning.h

00001 /* $Id: girebinning.h,v 1.14 2007/07/06 13:06:31 rpalsa Exp $
00002  *
00003  * This file is part of the GIRAFFE Pipeline
00004  * Copyright (C) 2002-2006 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 /*
00022  * $Author: rpalsa $
00023  * $Date: 2007/07/06 13:06:31 $
00024  * $Revision: 1.14 $
00025  * $Name: giraffe-2_5_1 $
00026  */
00027 
00028 #ifndef GIREBINNING_H
00029 #define GIREBINNING_H
00030 
00031 #include <cxtypes.h>
00032 
00033 #include <cpl_macros.h>
00034 #include <cpl_matrix.h>
00035 
00036 #include <giimage.h>
00037 #include <girange.h>
00038 #include <gilocalization.h>
00039 #include <giextraction.h>
00040 
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 
00047 #define O_NX          0     /* Optical parameters */
00048 #define O_PXSIZ       1
00049 #define O_FCOLL       2
00050 #define O_CFACT       3
00051 #define O_SOFFX       4
00052 #define O_SOFFY       5
00053 #define O_SPHI        6
00054 #define O_OPT_NPRMS   7
00055 
00056 #define G_THETA       0     /* Grating parameters */
00057 #define G_ORDER       1
00058 #define G_WLMIN       2
00059 #define G_WLEN0       3
00060 #define G_WLMAX       4
00061 #define G_RESOL       5
00062 #define G_SPACE       6
00063 #define G_GRAT_NPRMS  7
00064 
00065 /* optical model parameters indices */
00066 
00067 #define OG_NX           0
00068 #define OG_PXSIZ        1
00069 #define OG_FCOLL        2
00070 #define OG_CFACT        3
00071 #define OG_THETA        4
00072 #define OG_ORDER        5
00073 #define OG_SPACE        6
00074 #define OG_SOFFX        7
00075 #define OG_SOFFY        8
00076 #define OG_SPHI         9
00077 #define OG_OPTM_NPRMS  10
00078 
00079 #define GIREBIN_SIZE_Y_DEFAULT 5600
00080 
00081 enum GiRebinMethod {
00082     GIREBIN_METHOD_UNDEFINED,
00083     GIREBIN_METHOD_LINEAR,
00084     GIREBIN_METHOD_SPLINE
00085 };
00086 
00087 typedef enum GiRebinMethod GiRebinMethod;
00088 
00089 enum GiRebinScale {
00090     GIREBIN_SCALE_UNDEFINED,
00091     GIREBIN_SCALE_LOG,
00092     GIREBIN_SCALE_LINEAR
00093 };
00094 
00095 typedef enum GiRebinScale GiRebinScale;
00096 
00097 enum GiRebinRange {
00098     GIREBIN_RANGE_UNDEFINED,
00099     GIREBIN_RANGE_SETUP,
00100     GIREBIN_RANGE_COMMON
00101 };
00102 
00103 typedef enum GiRebinRange GiRebinRange;
00104 
00105 struct GiRebinConfig {
00106     GiRebinMethod  rmethod;
00107     cxbool         xresiduals;
00108     cxdouble       lstep;
00109     GiRebinScale   scmethod;
00110     cxint          size;
00111     GiRebinRange   range;
00112 };
00113 
00114 typedef struct GiRebinConfig GiRebinConfig;
00115 
00116 struct GiRebinning {
00117     GiImage *spectra;
00118     GiImage *errors;
00119 };
00120 
00121 typedef struct GiRebinning GiRebinning;
00122 
00123 struct GiRebinParams {
00124     cxdouble  min;       
00125     cxdouble  step;      
00126     cxint     log;       
00127     cxint     xres;      
00128     cxint     size;      
00129 };
00130 
00131 typedef struct GiRebinParams GiRebinParams;
00132 
00133 
00134 GiRange *giraffe_rebin_get_wavelength_range(GiImage *spectra,
00135                                             GiTable *wlsolution,
00136                                             GiTable *grating,
00137                                             GiTable *slitgeometry,
00138                                             cxbool common);
00139 
00140 cxint giraffe_rebin_spectra(GiRebinning *rebinning,
00141                             const GiExtraction *extraction,
00142                             const GiTable *fibers,
00143                             const GiLocalization *localization,
00144                             const GiTable *grating,
00145                             const GiTable *slitgeo,
00146                             const GiTable *solution,
00147                             const GiRebinConfig *config);
00148 
00149 
00150 /*
00151  * Convenience functions
00152  */
00153 
00154 GiRebinning *giraffe_rebinning_new(void);
00155 GiRebinning *giraffe_rebinning_create(GiImage *spectra, GiImage *errors);
00156 void giraffe_rebinning_delete(GiRebinning *rebinning);
00157 void giraffe_rebinning_destroy(GiRebinning *rebinning);
00158 
00159 GiRebinConfig *giraffe_rebin_config_create(cpl_parameterlist *list);
00160 void giraffe_rebin_config_destroy(GiRebinConfig *config);
00161 
00162 void giraffe_rebin_config_add(cpl_parameterlist *list);
00163 
00164 
00165 #ifdef __cplusplus
00166 }
00167 #endif
00168 
00169 #endif /* GIREBINNING_H */

This file is part of the GIRAFFE Pipeline Reference Manual 2.5.1.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Tue Mar 18 10:47:43 2008 by doxygen 1.4.6 written by Dimitri van Heesch, © 1997-2004