uves_wavecal_utils.h

00001 /*
00002  * This file is part of the ESO UVES Pipeline
00003  * Copyright (C) 2004,2005 European Southern Observatory
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
00018  */
00019 
00020 /*
00021  * $Author: amodigli $
00022  * $Date: 2007/06/06 08:17:34 $
00023  * $Revision: 1.8 $
00024  * $Name: uves-3_9_0 $
00025  * $Log: uves_wavecal_utils.h,v $
00026  * Revision 1.8  2007/06/06 08:17:34  amodigli
00027  * replace tab with 4 spaces
00028  *
00029  * Revision 1.7  2007/03/05 10:47:00  jmlarsen
00030  * Reject outliers based on line FWHM and fit residual
00031  *
00032  * Revision 1.6  2006/10/10 11:20:11  jmlarsen
00033  * Renamed line table columns to match MIDAS
00034  *
00035  * Revision 1.5  2006/07/14 12:52:57  jmlarsen
00036  * Exported/renamed function find_nearest
00037  *
00038  * Revision 1.4  2006/06/01 14:43:17  jmlarsen
00039  * Added missing documentation
00040  *
00041  * Revision 1.3  2006/04/21 12:29:30  jmlarsen
00042  * Write QC parameters to line table
00043  *
00044  * Revision 1.2  2006/02/15 13:19:15  jmlarsen
00045  * Reduced source code max. line length
00046  *
00047  * Revision 1.1  2006/02/03 07:46:30  jmlarsen
00048  * Moved recipe implementations to ./uves directory
00049  *
00050  * Revision 1.2  2005/12/19 16:17:55  jmlarsen
00051  * Replaced bool -> int
00052  *
00053  * Revision 1.1  2005/11/11 13:18:54  jmlarsen
00054  * Reorganized code, renamed source files
00055  *
00056  */
00057 #ifndef UVES_WAVECAL_UTILS_H
00058 #define UVES_WAVECAL_UTILS_H
00059 
00060 #include <uves_utils_polynomial.h>
00061 #include <cpl.h>
00062 #include <stdbool.h>
00063 
00064 /*-----------------------------------------------------------------------------
00065                                 Defines
00066  -----------------------------------------------------------------------------*/
00067 /* Use #defines to have consistent column names in all recipes */
00068 #define LINETAB_PIXELSIZE "Pixel"
00069 #define LINETAB_RESIDUAL  "Residual"  /* in wlu, not pixels */
00070 #define LINETAB_LAMBDAC   "WaveC"     /* computed wavelength */
00071 
00072 /*-----------------------------------------------------------------------------
00073                                 Typedefs
00074  -----------------------------------------------------------------------------*/
00075 
00085 typedef struct
00086 {
00088     int windows;
00089 
00091     int traces;
00092 
00094     cpl_table        **table;
00095 
00097     polynomial       **dispersion_relation;
00098 
00100     polynomial       **absolute_order;
00101 
00103     int *first_absolute_order;
00104 
00106     int *last_absolute_order;
00107 
00108 } lt_type;
00109 
00110 
00111 int uves_wavecal_find_nearest(const cpl_table *line_refer, double lambda, int lo, int hi);
00112 
00113 cpl_error_code uves_draw_lines(cpl_image *image,
00114                    polynomial *dispersion, 
00115                    const polynomial *order_locations,
00116                    const cpl_table *t,
00117                    const char *lambda_column, const char *abs_order,
00118                    const int *relative_order, 
00119                    int minorder, int maxorder, bool vertical, int offset);
00120 
00121 int uves_delete_bad_lines(cpl_table *table, double TOLERANCE, double kappa);
00122 
00123 
00124 lt_type *uves_lt_new(int windows, int traces);
00125 void uves_lt_delete(lt_type **lt);
00126 cpl_table **uves_lt_get_table(const lt_type *lt, int window, int trace);
00127 polynomial **uves_lt_get_disprel(const lt_type *lt, int window, int trace);
00128 polynomial **uves_lt_get_absord(const lt_type *lt, int window, int trace);
00129 int *uves_lt_get_firstabs(const lt_type *lt, int window, int trace);
00130 int *uves_lt_get_lastabs(const lt_type *lt, int window, int trace);
00131 
00132 #endif
00133 

Generated on Fri Apr 18 14:11:44 2008 for UVES Pipeline Reference Manual by  doxygen 1.5.1