00001 #ifndef COLTILT_H 00002 #define COLTILT_H 00003 /******************************************************************************* 00004 * E.S.O. - VLT project 00005 * 00006 * "@(#) $Id: coltilt.h,v 1.7 2005/04/19 11:42:41 amodigli Exp $" 00007 * 00008 * who when what 00009 * -------- -------- ---------------------------------------------- 00010 * schreib 20/12/00 created 00011 */ 00012 00013 /************************************************************************ 00014 * coltilt.h 00015 * routines to calculate and correct the spatial tilt of spectra in raw images 00016 *---------------------------------------------------------------------- 00017 */ 00018 00019 /* 00020 * header files 00021 */ 00022 00023 /* 00024 #include <stdio.h> 00025 #include <cpl.h> 00026 */ 00027 00028 /* 00029 #include "eclipse.h" 00030 #include "recipes.h" 00031 #include "spectrum_ops.h" 00032 #include <math.h> 00033 */ 00034 #include <qfits.h> 00035 #include "wave_calibration.h" 00036 00037 /*---------------------------------------------------------------------------- 00038 * Function ANSI C prototypes 00039 *--------------------------------------------------------------------------*/ 00040 00041 /*---------------------------------------------------------------------------- 00042 Function : slopeOfSpectrum() 00043 In : ns_image: image with at least one continuum spectrum 00044 of a pinhole 00045 box_length: width of the box in which the lines 00046 are fit by a gaussian 00047 fwhm: first guess of the full width at half maximum 00048 min_amplitude_factor: factor peak/background below given 00049 threshold the fit is not carried through 00050 Out : slope of a straight line fitted to the spectrum. 00051 -FLT_MAX if something went wrong. 00052 Job : determines the sub-pixel shifts of each row by using 00053 an image with at least one continuum spectrum of a pinhole 00054 this is done by searching the spectrum within the image 00055 then fitting the spectrum along the rows within a given box 00056 by a gaussian, so that the exact position is determined for 00057 each row. Afterwards, a straight line is fitted through the 00058 fitted positions. The slope of this linear fit is returned. 00059 ---------------------------------------------------------------------------*/ 00060 /* <python> */ 00061 float slopeOfSpectrum( OneImage * ns_image, 00062 int box_length, 00063 float fwhm, 00064 float min_amplitude_factor ) ; 00065 /* </python> */ 00066 00067 /*---------------------------------------------------------------------------- 00068 Function : shiftRows() 00069 In : image: raw image in which the rows should be shifted 00070 slope: slope of a fitted straight line along a spectrum 00071 output of slopeOfSpectrum 00072 n_order: order of the interpolation polynom 00073 Out : resulting image with shifted rows 00074 Job : shifts the rows of a raw image by using the output of 00075 slopeOfSpectrum and applying polynomial interpolation 00076 ---------------------------------------------------------------------------*/ 00077 00078 /* <python> */ 00079 OneImage * shiftRows( OneImage * image, 00080 float slope, 00081 int n_order ) ; 00082 /* </python> */ 00083 00084 /*---------------------------------------------------------------------------- 00085 Function : parameterToAscii() 00086 In : parameter: float parameter array to be stored in an ASCII file 00087 number: number of parameters 00088 filename: filename of ASCII file 00089 Out : nothing 00090 Job : stores parameters in an ASCII file 00091 ---------------------------------------------------------------------------*/ 00092 00093 /* <python> */ 00094 void parameterToAscii ( float * parameter, 00095 int n, 00096 char * filename ) ; 00097 /* </python> */ 00098 00099 /*---------------------------------------------------------------------------- 00100 Function : asciiToParameter() 00101 In : filename: filename of ASCII file 00102 Out : n: number of parameters in the parameter array 00103 array of parameters 00104 Job : writes parameters stored in an ASCII file in an float array 00105 ---------------------------------------------------------------------------*/ 00106 00107 /* <python> */ 00108 float * asciiToParameter ( char * filename, 00109 int * n ) ; 00110 /* </python> */ 00111 00112 /*---------------------------------------------------------------------------- 00113 Function : curvatureOfSpectrum() 00114 In : ns_image: image with at least one continuum spectrum 00115 of a pinhole 00116 order: order of the fit polynomial 00117 box_length: width of the box in which the lines 00118 are fit by a gaussian 00119 left_pos, right_pos: left and right positions between which 00120 the spectrum should be located 00121 fwhm: first guess of the full width at half maximum 00122 min_amplitude_factor: factor peak/background below given 00123 threshold the fit is not carried through 00124 Out : resulting polynomial coefficients. 00125 Job : this routine determines the curvature of a spectrum by fitting 00126 a polynomial to a continuum spectrum. This is done by using 00127 an image with at least one continuum spectrum of a pinhole. 00128 this is done by searching the spectrum within the image 00129 then fitting the spectrum along the rows within a given box 00130 by a gaussian, so that the exact position is determined for 00131 each row. Afterwards, a polynomial is fitted through the 00132 found positions. The polynomial coefficients are returned. 00133 -------------------------------------------------------------------------------*/ 00134 00135 double * curvatureOfSpectrum( OneImage * ns_image, 00136 int order, 00137 int box_length, 00138 int left_pos, 00139 int right_pos, 00140 float fwhm, 00141 float min_amplitude_factor ) ; 00142 /* <python> */ 00143 OneImage * image_warp( OneImage * image, 00144 char * kernel_type, 00145 char * poly_table ); 00146 /* </python> */ 00147 00148 /* <python> */ 00149 OneImage * image_warp_fits( OneImage * image, 00150 char * kernel_type, 00151 char * poly_table ); 00152 /* </python> */ 00153 #endif 00155 /*--------------------------------------------------------------------------*/
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001