File: uves_extract_iterate.h

package info (click to toggle)
cpl-plugin-uves 6.1.3+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 23,128 kB
  • sloc: ansic: 171,056; sh: 4,359; python: 3,002; makefile: 1,322
file content (130 lines) | stat: -rw-r--r-- 3,367 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
 * This file is part of the ESO UVES Pipeline
 * Copyright (C) 2004,2005 European Southern Observatory
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
 */

/*
 * $Author: amodigli $
 * $Date: 2010-09-24 09:32:03 $
 * $Revision: 1.8 $
 * $Name: not supported by cvs2svn $
 * $Log: not supported by cvs2svn $
 * Revision 1.6  2010/02/13 12:22:31  amodigli
 * removed inlines (let's do work to compiler)
 *
 * Revision 1.5  2007/06/06 08:17:33  amodigli
 * replace tab with 4 spaces
 *
 * Revision 1.4  2007/05/02 13:17:25  jmlarsen
 * Allow specifying offset in optimal extraction
 *
 * Revision 1.3  2006/11/16 09:48:30  jmlarsen
 * Renamed data type position -> uves_iterate_position, for namespace reasons
 *
 * Revision 1.2  2006/09/11 14:19:28  jmlarsen
 * Updated documentation
 *
 * Revision 1.1  2006/09/08 14:03:58  jmlarsen
 * Simplified code by using iterators, sky subtraction much optimized
 *
 *
 */
#ifndef UVES_EXTRACT_ITERATE_H
#define UVES_EXTRACT_ITERATE_H

#include <uves_utils_polynomial.h>

#include <stdbool.h>

typedef struct {
    double length;
    double offset;
} slit_geometry;

/* @cond */
typedef struct
{
    /* 'public' numbers that are iterated */

    /** Order number, pixel position */
    int order;
    /** Current pixel */
    int x, y;
    /** Center of current bin */
    double ycenter;
    /** y-range of current bin */
    int ylow, yhigh;


    /* private stuff which is set
       for each iteration */

    /** x-range */
    int xmin, xmax;
    /** last order (inclusive) of
    current iteration */
    int ordermax;
    /** bad pixel map used in this iteration,
    or NULL */
    const cpl_binary *bpm;
    /** Loop over y-values (true), or loop
    just over bins (false) */
    bool loop_y;
    /** Iteration finished? */
    bool end;

    /* public stuff which is always
       constant (the geometry) */

    /** Image size */
    int nx, ny;

    /** First/last order according to order table */
    int minorder, maxorder;

    const polynomial *order_locations;
    slit_geometry sg;

} uves_iterate_position;
/* @endcond */

uves_iterate_position *
uves_iterate_new(int nx, int ny,
         const polynomial *order_locations,
         int minorder, int maxorder,
         slit_geometry sg);

void
uves_iterate_delete(uves_iterate_position **p);

void
uves_iterate_set_first(uves_iterate_position *p,
               int xmin, int xmax, 
               int ordermin, int ordermax,
               const cpl_binary *bpm,
               bool loop_y);

void
uves_iterate_increment(uves_iterate_position *p);

bool
uves_iterate_finished(const uves_iterate_position *p);

void
uves_iterate_dump(const uves_iterate_position *p, FILE *stream);

#endif