00001 #ifndef SPIFFI_TYPES_H
00002 #define SPIFFI_TYPES_H
00003 /*******************************************************************************
00004 * E.S.O. - VLT project
00005 *
00006 * "@(#) $Id: spiffi_types.h,v 1.5 2005/08/23 12:13:22 amodigli Exp $"
00007 *
00008 * who when what
00009 * -------- -------- ----------------------------------------------
00010 * schreib 25/05/00 created
00011 */
00012
00013 /************************************************************************
00014 * spiffi_types.h
00015 * all shared local new data types and defines for spiffi data reduction
00016 *----------------------------------------------------------------------
00017 */
00018
00019 /*
00020 * header files
00021 */
00022
00023 #include <sys/types.h>
00024 #include <limits.h>
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027 #include <string.h>
00028
00029 #include "local_types.h"
00030
00031 /*----------------------------------------------------------------------------
00032 Defines
00033 *--------------------------------------------------------------------------*/
00034
00035 #define NullVector (Vector *) NULL
00036 #define SLOPE 1000. /*slope limit of the linear fit*/
00037 #define SATURATION 50000. /*saturation level of the detector pixel values*/
00038 #define ESTIMATE 200 /*estimation of number of parameters stored in an
00039 ascii file*/
00040 #define THRESH 100000. /* Threshold for operation 1/pixelvalue of an image division*/
00041
00042 /*-------------------------------------------------------------------------------*/
00043
00044 #define PIXEL_WIDTH 0.0185 /* mm */
00045 #define FOCAL_LENGTH 178. /* mm */
00046
00047 #define N_SLITLETS 32 /* number of slitlets */
00048 #define SLITLENGTH 64 /* nominal pixel length of one slitlet */
00049 #define SLIT_LEN_ERR 5 /* error on SLITLENGTH */
00050 #define SLIT_POS_ERR 5 /* error on SLITLENGTH */
00051
00052 #define LOW_REJECT 0.1 /* fraction of rejected extreme low values of fit
00053 coefficients in coefsCrossFit() */
00054 #define HIGH_REJECT 0.9 /* fraction of rejected extreme high values of fit
00055 coefficients in coefsCrossFit() */
00056 #define PIXEL 25 /* number of pixels for offsets in coeffsCrossSlitFit() */
00057
00058 #define CENTRALLAMBDA_K 2.2 /* defined central wavelengths and pixel dispersions
00059 for each grating for definedResampling() */
00060 #define CENTRALLAMBDA_H 1.65
00061 #define CENTRALLAMBDA_J 1.25
00062 #define CENTRALLAMBDA_HK 1.95
00063 #define DISPERSION_K 0.00049
00064 #define DISPERSION_K_DITH 0.000245
00065 #define DISPERSION_H 0.00039
00066 #define DISPERSION_H_DITH 0.000195
00067 #define DISPERSION_J 0.00029
00068 #define DISPERSION_J_DITH 0.000145
00069 #define DISPERSION_HK 0.001
00070 #define DISPERSION_HK_DITH 0.0005
00071
00072 /*----------------------------------------------------------------------------
00073 New types
00074 ---------------------------------------------------------------------------*/
00075
00076 /*--------------------------------------------------------------------------*/
00077 /* The following structure stores a vector */
00078 /*--------------------------------------------------------------------------*/
00079
00080 /* <python> */
00081 typedef struct _VECTOR_
00082 {
00083 int n_elements ; /* number of vector elements */
00084 pixelvalue * data ; /* array of vector values */
00085 } Vector ;
00086 /* </python> */
00087
00088 /*--------------------------------------------------------------------------*/
00089 /* The following structure stores the (gauss) fitting parameters of the */
00090 /* emission lines of the calibration lamps */
00091 /*--------------------------------------------------------------------------*/
00092
00093 /* <python> */
00094 typedef struct _FIT_PARAMS_
00095 {
00096 int n_params ; /* total number of fits to allocate FitParams array */
00097 int column ; /* index of the column in image coordinates */
00098 int line ; /* index of fitted emission line
00099 of the column */
00100 float wavelength ; /* associated wavelength of the calibration
00101 lamp emission line taken from the
00102 line center list file */
00103 float * fit_par ; /* fit_par[0]: amplitude,
00104 fit_par[1]: FWHM,
00105 fit_par[2]: position of
00106 center of gauss,
00107 fit_par[3]: zero level offset */
00108 float * derv_par ; /* corresponding derivatives of fit_par[] */
00109 } FitParams ;
00110 /* </python> */
00111
00112 /* <python> */
00113 typedef struct _STATS_
00114 {
00115 float cleanmean ; /* mean of pixel values without considering the extreme values */
00116 float cleanstdev ; /* standard deviation of pixel values without considering the
00117 extreme values */
00118 int npix ; /* number of clean pixel values */
00119 } Stats ;
00120 /* </python> */
00121
00122 /* <python> */
00123 typedef struct _BCOEFFS_
00124 {
00125 int slitlet ; /* current slitlet */
00126 int n_slitlets ; /* number of slitlets */
00127 int n_acoeffs ; /* number of a fit coefficients */
00128 int n_bcoeffs ; /* number of b fit coefficients */
00129 float ** b ; /* matrix of fit coefficients: b[index acoefs][index bcoefs] */
00130 } Bcoeffs ;
00131 /* </python> */
00132
00133 #endif
00135 /*--------------------------------------------------------------------------*/
00136
00137
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001