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:03 $ 00023 * $Revision: 1.8 $ 00024 * $Name: uves-5_0_0 $ 00025 * $Log: uves_extract_iterate.h,v $ 00026 * Revision 1.8 2010/09/24 09:32:03 amodigli 00027 * put back QFITS dependency to fix problem spot by NRI on FIBER mode (with MIDAS calibs) data 00028 * 00029 * Revision 1.6 2010/02/13 12:22:31 amodigli 00030 * removed inlines (let's do work to compiler) 00031 * 00032 * Revision 1.5 2007/06/06 08:17:33 amodigli 00033 * replace tab with 4 spaces 00034 * 00035 * Revision 1.4 2007/05/02 13:17:25 jmlarsen 00036 * Allow specifying offset in optimal extraction 00037 * 00038 * Revision 1.3 2006/11/16 09:48:30 jmlarsen 00039 * Renamed data type position -> uves_iterate_position, for namespace reasons 00040 * 00041 * Revision 1.2 2006/09/11 14:19:28 jmlarsen 00042 * Updated documentation 00043 * 00044 * Revision 1.1 2006/09/08 14:03:58 jmlarsen 00045 * Simplified code by using iterators, sky subtraction much optimized 00046 * 00047 * 00048 */ 00049 #ifndef UVES_EXTRACT_ITERATE_H 00050 #define UVES_EXTRACT_ITERATE_H 00051 00052 #include <uves_utils_polynomial.h> 00053 00054 #include <stdbool.h> 00055 00056 typedef struct { 00057 double length; 00058 double offset; 00059 } slit_geometry; 00060 00061 /* @cond */ 00062 typedef struct 00063 { 00064 /* 'public' numbers that are iterated */ 00065 00067 int order; 00069 int x, y; 00071 double ycenter; 00073 int ylow, yhigh; 00074 00075 00076 /* private stuff which is set 00077 for each iteration */ 00078 00080 int xmin, xmax; 00083 int ordermax; 00086 const cpl_binary *bpm; 00089 bool loop_y; 00091 bool end; 00092 00093 /* public stuff which is always 00094 constant (the geometry) */ 00095 00097 int nx, ny; 00098 00100 int minorder, maxorder; 00101 00102 const polynomial *order_locations; 00103 slit_geometry sg; 00104 00105 } uves_iterate_position; 00106 /* @endcond */ 00107 00108 uves_iterate_position * 00109 uves_iterate_new(int nx, int ny, 00110 const polynomial *order_locations, 00111 int minorder, int maxorder, 00112 slit_geometry sg); 00113 00114 void 00115 uves_iterate_delete(uves_iterate_position **p); 00116 00117 void 00118 uves_iterate_set_first(uves_iterate_position *p, 00119 int xmin, int xmax, 00120 int ordermin, int ordermax, 00121 const cpl_binary *bpm, 00122 bool loop_y); 00123 00124 void 00125 uves_iterate_increment(uves_iterate_position *p); 00126 00127 bool 00128 uves_iterate_finished(const uves_iterate_position *p); 00129 00130 void 00131 uves_iterate_dump(const uves_iterate_position *p, FILE *stream); 00132 00133 #endif