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: 2010/09/24 09:32:10 $ 00023 * $Revision: 1.10 $ 00024 * $Name: uves-5_0_0 $ 00025 * $Log: uves_wavecal_utils.h,v $ 00026 * Revision 1.10 2010/09/24 09:32:10 amodigli 00027 * put back QFITS dependency to fix problem spot by NRI on FIBER mode (with MIDAS calibs) data 00028 * 00029 * Revision 1.8 2007/06/06 08:17:34 amodigli 00030 * replace tab with 4 spaces 00031 * 00032 * Revision 1.7 2007/03/05 10:47:00 jmlarsen 00033 * Reject outliers based on line FWHM and fit residual 00034 * 00035 * Revision 1.6 2006/10/10 11:20:11 jmlarsen 00036 * Renamed line table columns to match MIDAS 00037 * 00038 * Revision 1.5 2006/07/14 12:52:57 jmlarsen 00039 * Exported/renamed function find_nearest 00040 * 00041 * Revision 1.4 2006/06/01 14:43:17 jmlarsen 00042 * Added missing documentation 00043 * 00044 * Revision 1.3 2006/04/21 12:29:30 jmlarsen 00045 * Write QC parameters to line table 00046 * 00047 * Revision 1.2 2006/02/15 13:19:15 jmlarsen 00048 * Reduced source code max. line length 00049 * 00050 * Revision 1.1 2006/02/03 07:46:30 jmlarsen 00051 * Moved recipe implementations to ./uves directory 00052 * 00053 * Revision 1.2 2005/12/19 16:17:55 jmlarsen 00054 * Replaced bool -> int 00055 * 00056 * Revision 1.1 2005/11/11 13:18:54 jmlarsen 00057 * Reorganized code, renamed source files 00058 * 00059 */ 00060 #ifndef UVES_WAVECAL_UTILS_H 00061 #define UVES_WAVECAL_UTILS_H 00062 00063 #include <uves_utils_polynomial.h> 00064 #include <cpl.h> 00065 #include <stdbool.h> 00066 00067 /*----------------------------------------------------------------------------- 00068 Defines 00069 -----------------------------------------------------------------------------*/ 00070 /* Use #defines to have consistent column names in all recipes */ 00071 #define LINETAB_PIXELSIZE "Pixel" 00072 #define LINETAB_RESIDUAL "Residual" /* in wlu, not pixels */ 00073 #define LINETAB_LAMBDAC "WaveC" /* computed wavelength */ 00074 00075 /*----------------------------------------------------------------------------- 00076 Typedefs 00077 -----------------------------------------------------------------------------*/ 00078 00088 typedef struct 00089 { 00091 int windows; 00092 00094 int traces; 00095 00097 cpl_table **table; 00098 00100 polynomial **dispersion_relation; 00101 00103 polynomial **absolute_order; 00104 00106 int *first_absolute_order; 00107 00109 int *last_absolute_order; 00110 00111 } lt_type; 00112 00113 00114 int uves_wavecal_find_nearest(const cpl_table *line_refer, double lambda, int lo, int hi); 00115 00116 cpl_error_code uves_draw_lines(cpl_image *image, 00117 polynomial *dispersion, 00118 const polynomial *order_locations, 00119 const cpl_table *t, 00120 const char *lambda_column, const char *abs_order, 00121 const int *relative_order, 00122 int minorder, int maxorder, bool vertical, int offset); 00123 00124 int uves_delete_bad_lines(cpl_table *table, double TOLERANCE, double kappa); 00125 00126 00127 lt_type *uves_lt_new(int windows, int traces); 00128 void uves_lt_delete(lt_type **lt); 00129 cpl_table **uves_lt_get_table(const lt_type *lt, int window, int trace); 00130 polynomial **uves_lt_get_disprel(const lt_type *lt, int window, int trace); 00131 polynomial **uves_lt_get_absord(const lt_type *lt, int window, int trace); 00132 int *uves_lt_get_firstabs(const lt_type *lt, int window, int trace); 00133 int *uves_lt_get_lastabs(const lt_type *lt, int window, int trace); 00134 00135 #endif 00136