UVES Pipeline Reference Manual  5.4.0
uves_extract_iterate.h
1 /*
2  * This file is part of the ESO UVES Pipeline
3  * Copyright (C) 2004,2005 European Southern Observatory
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
18  */
19 
20 /*
21  * $Author: amodigli $
22  * $Date: 2010-09-24 09:32:03 $
23  * $Revision: 1.8 $
24  * $Name: not supported by cvs2svn $
25  * $Log: not supported by cvs2svn $
26  * Revision 1.6 2010/02/13 12:22:31 amodigli
27  * removed inlines (let's do work to compiler)
28  *
29  * Revision 1.5 2007/06/06 08:17:33 amodigli
30  * replace tab with 4 spaces
31  *
32  * Revision 1.4 2007/05/02 13:17:25 jmlarsen
33  * Allow specifying offset in optimal extraction
34  *
35  * Revision 1.3 2006/11/16 09:48:30 jmlarsen
36  * Renamed data type position -> uves_iterate_position, for namespace reasons
37  *
38  * Revision 1.2 2006/09/11 14:19:28 jmlarsen
39  * Updated documentation
40  *
41  * Revision 1.1 2006/09/08 14:03:58 jmlarsen
42  * Simplified code by using iterators, sky subtraction much optimized
43  *
44  *
45  */
46 #ifndef UVES_EXTRACT_ITERATE_H
47 #define UVES_EXTRACT_ITERATE_H
48 
49 #include <uves_utils_polynomial.h>
50 
51 #include <stdbool.h>
52 
53 typedef struct {
54  double length;
55  double offset;
57 
58 /* @cond */
59 typedef struct
60 {
61  /* 'public' numbers that are iterated */
62 
64  int order;
66  int x, y;
68  double ycenter;
70  int ylow, yhigh;
71 
72 
73  /* private stuff which is set
74  for each iteration */
75 
77  int xmin, xmax;
80  int ordermax;
83  const cpl_binary *bpm;
86  bool loop_y;
88  bool end;
89 
90  /* public stuff which is always
91  constant (the geometry) */
92 
94  int nx, ny;
95 
97  int minorder, maxorder;
98 
99  const polynomial *order_locations;
100  slit_geometry sg;
101 
102 } uves_iterate_position;
103 /* @endcond */
104 
105 uves_iterate_position *
106 uves_iterate_new(int nx, int ny,
107  const polynomial *order_locations,
108  int minorder, int maxorder,
109  slit_geometry sg);
110 
111 void
112 uves_iterate_delete(uves_iterate_position **p);
113 
114 void
115 uves_iterate_set_first(uves_iterate_position *p,
116  int xmin, int xmax,
117  int ordermin, int ordermax,
118  const cpl_binary *bpm,
119  bool loop_y);
120 
121 void
122 uves_iterate_increment(uves_iterate_position *p);
123 
124 bool
125 uves_iterate_finished(const uves_iterate_position *p);
126 
127 void
128 uves_iterate_dump(const uves_iterate_position *p, FILE *stream);
129 
130 #endif