00001 #ifndef SINFO_SPIFFI_TYPES_H 00002 #define SINFO_SPIFFI_TYPES_H 00003 /* 00004 * This file is part of the ESO SINFONI Pipeline 00005 * Copyright (C) 2004,2005 European Southern Observatory 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA 00020 */ 00021 /******************************************************************************* 00022 * E.S.O. - VLT project 00023 * 00024 * "@(#) $Id: sinfo_spiffi_types.h,v 1.3 2007/06/06 07:10:45 amodigli Exp $" 00025 * 00026 * who when what 00027 * -------- -------- ---------------------------------------------- 00028 * schreib 25/05/00 created 00029 */ 00030 00031 /************************************************************************ 00032 * sinfo_spiffi_types.h 00033 * all shared local new data types and defines for spiffi data reduction 00034 *---------------------------------------------------------------------- 00035 */ 00036 00037 /* 00038 * header files 00039 */ 00040 00041 #include <sys/types.h> 00042 #include <limits.h> 00043 #include <stdlib.h> 00044 #include <stdio.h> 00045 #include <string.h> 00046 00047 #include "sinfo_local_types.h" 00048 00049 /*---------------------------------------------------------------------------- 00050 Defines 00051 *--------------------------------------------------------------------------*/ 00052 00053 #define NullVector (Vector *) NULL 00054 #define SLOPE 1000. /*slope limit of the linear fit*/ 00055 #define SATURATION 50000. /*saturation level of the detector pixel values*/ 00056 #define ESTIMATE 200 /*estimation of number of parameters stored in an 00057 ascii file*/ 00058 #define THRESH 100000. /* Threshold for operation 1/pixelvalue of 00059 an image division*/ 00060 00061 /*--------------------------------------------------------------------------*/ 00062 00063 #define PIXEL_WIDTH 0.0185 /* mm */ 00064 #define FOCAL_LENGTH 178. /* mm */ 00065 00066 #define N_SLITLETS 32 /* number of slitlets */ 00067 #define SLITLENGTH 64 /* nominal pixel length of one slitlet */ 00068 #define SLIT_LEN_ERR 5 /* error on SLITLENGTH */ 00069 #define SLIT_POS_ERR 5 /* error on SLITLENGTH */ 00070 00071 #define LOW_REJECT 0.1 /* fraction of rejected extreme low values of fit 00072 coefficients in sinfo_coefsCrossFit() */ 00073 #define HIGH_REJECT 0.9 /* fraction of rejected extreme high values of fit 00074 coefficients in sinfo_coefsCrossFit() */ 00075 #define PIXEL 25 /* number of pixels for offsets in 00076 sinfo_coeffsCrossSlitFit() */ 00077 00078 #define CENTRALLAMBDA_K 2.2 /* defined central wavelengths and pixel 00079 dispersions for each grating for 00080 sinfo_definedResampling() */ 00081 #define CENTRALLAMBDA_H 1.65 00082 #define CENTRALLAMBDA_J 1.25 00083 #define CENTRALLAMBDA_HK 1.95 00084 #define DISPERSION_K 0.00049 00085 #define DISPERSION_K_DITH 0.000245 00086 #define DISPERSION_H 0.00039 00087 #define DISPERSION_H_DITH 0.000195 00088 #define DISPERSION_J 0.00029 00089 #define DISPERSION_J_DITH 0.000145 00090 #define DISPERSION_HK 0.001 00091 #define DISPERSION_HK_DITH 0.0005 00092 00093 /*---------------------------------------------------------------------------- 00094 New types 00095 ---------------------------------------------------------------------------*/ 00096 00097 /*--------------------------------------------------------------------------*/ 00098 /* The following structure stores a sinfo_vector */ 00099 /*--------------------------------------------------------------------------*/ 00100 00101 typedef struct _VECTOR_ 00102 { 00103 int n_elements ; /* number of sinfo_vector elements */ 00104 pixelvalue * data ; /* array of sinfo_vector values */ 00105 } Vector ; 00106 00107 /*--------------------------------------------------------------------------*/ 00108 /* The following structure stores the (gauss) fitting parameters of the */ 00109 /* emission lines of the calibration lamps */ 00110 /*--------------------------------------------------------------------------*/ 00111 00112 typedef struct _FIT_PARAMS_ 00113 { 00114 int n_params ; /* total number of fits to allocate 00115 FitParams array */ 00116 int column ; /* index of the column in image coordinates */ 00117 int line ; /* index of fitted emission line 00118 of the column */ 00119 float wavelength ; /* associated wavelength of the calibration 00120 lamp emission line taken from the 00121 line center list file */ 00122 float * fit_par ; /* fit_par[0]: amplitude, 00123 fit_par[1]: FWHM, 00124 fit_par[2]: position of 00125 center of gauss, 00126 fit_par[3]: zero level offset */ 00127 float * derv_par ; /* corresponding derivatives of fit_par[] */ 00128 } FitParams ; 00129 00130 typedef struct _STATS_ 00131 { 00132 float cleanmean ; /* mean of pixel values without considering 00133 the extreme values */ 00134 float cleanstdev ; /* standard deviation of pixel values without 00135 considering the extreme values */ 00136 int npix ; /* number of clean pixel values */ 00137 } Stats ; 00138 00139 typedef struct _BCOEFFS_ 00140 { 00141 int slitlet ; /* current slitlet */ 00142 int n_slitlets ; /* number of slitlets */ 00143 int n_acoeffs ; /* number of a fit coefficients */ 00144 int n_bcoeffs ; /* number of b fit coefficients */ 00145 float ** b ; /* sinfo_matrix of fit coefficients: 00146 b[index acoefs][index bcoefs] */ 00147 } Bcoeffs ; 00148 00149 #endif 00151 /*--------------------------------------------------------------------------*/ 00152 00153