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

Generated on Mon Apr 21 10:56:55 2008 for UVES Pipeline Reference Manual by  doxygen 1.5.1