GIRAFFE Pipeline Reference Manual

girebinning.h

00001 /* $Id: girebinning.h,v 1.15 2008/03/17 13:56:48 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: 2008/03/17 13:56:48 $
00024  * $Revision: 1.15 $
00025  * $Name: giraffe-2_9 $
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 #include <cpl_parameterlist.h>
00036 
00037 #include <giimage.h>
00038 #include <girange.h>
00039 #include <gilocalization.h>
00040 #include <giextraction.h>
00041 
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00047 
00048 #define O_NX          0     /* Optical parameters */
00049 #define O_PXSIZ       1
00050 #define O_FCOLL       2
00051 #define O_CFACT       3
00052 #define O_SOFFX       4
00053 #define O_SOFFY       5
00054 #define O_SPHI        6
00055 #define O_OPT_NPRMS   7
00056 
00057 #define G_THETA       0     /* Grating parameters */
00058 #define G_ORDER       1
00059 #define G_WLMIN       2
00060 #define G_WLEN0       3
00061 #define G_WLMAX       4
00062 #define G_RESOL       5
00063 #define G_SPACE       6
00064 #define G_GRAT_NPRMS  7
00065 
00066 /* optical model parameters indices */
00067 
00068 #define OG_NX           0
00069 #define OG_PXSIZ        1
00070 #define OG_FCOLL        2
00071 #define OG_CFACT        3
00072 #define OG_THETA        4
00073 #define OG_ORDER        5
00074 #define OG_SPACE        6
00075 #define OG_SOFFX        7
00076 #define OG_SOFFY        8
00077 #define OG_SPHI         9
00078 #define OG_OPTM_NPRMS  10
00079 
00080 #define GIREBIN_SIZE_Y_DEFAULT 5600
00081 
00082 enum GiRebinMethod {
00083     GIREBIN_METHOD_UNDEFINED,
00084     GIREBIN_METHOD_LINEAR,
00085     GIREBIN_METHOD_SPLINE
00086 };
00087 
00088 typedef enum GiRebinMethod GiRebinMethod;
00089 
00090 enum GiRebinScale {
00091     GIREBIN_SCALE_UNDEFINED,
00092     GIREBIN_SCALE_LOG,
00093     GIREBIN_SCALE_LINEAR
00094 };
00095 
00096 typedef enum GiRebinScale GiRebinScale;
00097 
00098 enum GiRebinRange {
00099     GIREBIN_RANGE_UNDEFINED,
00100     GIREBIN_RANGE_SETUP,
00101     GIREBIN_RANGE_COMMON
00102 };
00103 
00104 typedef enum GiRebinRange GiRebinRange;
00105 
00106 struct GiRebinConfig {
00107     GiRebinMethod  rmethod;
00108     cxbool         xresiduals;
00109     cxdouble       lstep;
00110     GiRebinScale   scmethod;
00111     cxint          size;
00112     GiRebinRange   range;
00113 };
00114 
00115 typedef struct GiRebinConfig GiRebinConfig;
00116 
00117 struct GiRebinning {
00118     GiImage *spectra;
00119     GiImage *errors;
00120 };
00121 
00122 typedef struct GiRebinning GiRebinning;
00123 
00124 struct GiRebinParams {
00125     cxdouble  min;       
00126     cxdouble  step;      
00127     cxint     log;       
00128     cxint     xres;      
00129     cxint     size;      
00130 };
00131 
00132 typedef struct GiRebinParams GiRebinParams;
00133 
00134 
00135 GiRange *giraffe_rebin_get_wavelength_range(GiImage *spectra,
00136                                             GiTable *wlsolution,
00137                                             GiTable *grating,
00138                                             GiTable *slitgeometry,
00139                                             cxbool common);
00140 
00141 cxint giraffe_rebin_spectra(GiRebinning *rebinning,
00142                             const GiExtraction *extraction,
00143                             const GiTable *fibers,
00144                             const GiLocalization *localization,
00145                             const GiTable *grating,
00146                             const GiTable *slitgeo,
00147                             const GiTable *solution,
00148                             const GiRebinConfig *config);
00149 
00150 
00151 /*
00152  * Convenience functions
00153  */
00154 
00155 GiRebinning *giraffe_rebinning_new(void);
00156 GiRebinning *giraffe_rebinning_create(GiImage *spectra, GiImage *errors);
00157 void giraffe_rebinning_delete(GiRebinning *rebinning);
00158 void giraffe_rebinning_destroy(GiRebinning *rebinning);
00159 
00160 GiRebinConfig *giraffe_rebin_config_create(cpl_parameterlist *list);
00161 void giraffe_rebin_config_destroy(GiRebinConfig *config);
00162 
00163 void giraffe_rebin_config_add(cpl_parameterlist *list);
00164 
00165 
00166 #ifdef __cplusplus
00167 }
00168 #endif
00169 
00170 #endif /* GIREBINNING_H */

This file is part of the GIRAFFE Pipeline Reference Manual 2.9.0.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Thu Jan 26 14:20:28 2012 by doxygen 1.6.3 written by Dimitri van Heesch, © 1997-2004