VISIR Pipeline Reference Manual  4.1.0
visir_inputs.h
1 /* $Id: visir_inputs.h,v 1.55 2013-02-21 16:39:11 jtaylor Exp $
2  *
3  * This file is part of the VISIR Pipeline
4  * Copyright (C) 2002,2003 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
19  */
20 
21 /*
22  * $Author: jtaylor $
23  * $Date: 2013-02-21 16:39:11 $
24  * $Revision: 1.55 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifndef VISIR_INPUTS_H
29 #define VISIR_INPUTS_H
30 
31 /*-----------------------------------------------------------------------------
32  Includes
33  -----------------------------------------------------------------------------*/
34 
35 #include <cpl.h>
36 
37 #include "irplib_framelist.h"
38 
39 #include "visir_spc_optmod.h"
40 
41 /*-----------------------------------------------------------------------------
42  Define
43  -----------------------------------------------------------------------------*/
44 
45 /* The values range from 0 (or 1) to 2**16-1 (or 2**16) */
46 #define VISIR_HCYCLE_BPM_THRESHOLD 65000.0
47 
48 /* Due to a inconsistency in the chosen VISIR FITS-format the pixels in
49  the half-cycle image are offset, such that the lowest pixel value is
50  -32768 (or perhaps -32767?). This is fixed by adding 32768 to each
51  pixel value */
52 #define VISIR_HCYCLE_OFFSET 32768.0
53 
54 typedef enum {
55  /* VISIR nod/chopping mode detection */
56 
57  /* Mode can be assumed to be: PERPENDICULAR */
58  VISIR_CHOPNOD_PERPENDICULAR,
59 
60  /* Mode can be assumed to be: PARALLEL */
61  VISIR_CHOPNOD_PARALLEL,
62 
63  /* Mode is determined from FITS header */
64  VISIR_CHOPNOD_AUTO
65 
66 } visir_chopnod_mode;
67 
68 typedef enum {
69  VISIR_ERROR,
70  VISIR_VARIANCE,
71  VISIR_WEIGHT
72 } visir_error_type;
73 
74 typedef enum {
75  VISIR_DATA_CUBE1,
76  VISIR_DATA_CUBE2,
77  VISIR_DATA_BURST,
78  VISIR_DATA_AQU_HCYCLE,
79  VISIR_DATA_AQU_BURST,
80  VISIR_DATA_AQU_BURST_EXT,
81  VISIR_DATA_AQU_INT,
82 } visir_data_type;
83 
84 static inline cpl_boolean
85 visir_data_is_aqu(const visir_data_type dtype)
86 {
87  return dtype == VISIR_DATA_AQU_HCYCLE || dtype == VISIR_DATA_AQU_BURST ||
88  dtype == VISIR_DATA_AQU_BURST_EXT || dtype == VISIR_DATA_AQU_INT;
89 }
90 
91 static inline cpl_boolean
92 visir_data_is_drs(const visir_data_type dtype)
93 {
94  return !visir_data_is_aqu(dtype);
95 }
96 
97 static inline cpl_boolean
98 visir_data_is_burst(const visir_data_type dtype)
99 {
100  return dtype == VISIR_DATA_BURST || dtype == VISIR_DATA_AQU_BURST ||
101  dtype == VISIR_DATA_AQU_BURST_EXT;
102 }
103 
104 
105 /*-----------------------------------------------------------------------------
106  Functions prototypes
107  -----------------------------------------------------------------------------*/
108 
109 cpl_imagelist * visir_inputs_combine(const char *, const cpl_parameterlist *,
110  const irplib_framelist *, const char *,
111  const char *, int *, cpl_boolean,
112  double, visir_spc_resol);
113 cpl_image ** visir_img_recombine_list(const char *,
114  const cpl_parameterlist *,
115  cpl_imagelist *,
116  const cpl_propertylist **,
117  cpl_geom_combine, cpl_boolean *);
118 cpl_image ** visir_img_recombine(const char *, const cpl_parameterlist *,
119  const irplib_framelist *, const char *,
120  const char *, cpl_geom_combine, cpl_boolean *,
121  cpl_boolean, double, visir_spc_resol);
122 cpl_imagelist * visir_load_imagelist(const irplib_framelist *, int,
123  cpl_boolean);
124 cpl_imagelist * visir_load_hcycle(const irplib_framelist *, int);
125 cpl_error_code visir_image_reject_hot(cpl_image *, const char *);
126 
127 cpl_imagelist * visir_imagelist_load_last(const irplib_framelist *);
128 
129 cpl_image ** visir_img_collapse_beam(cpl_propertylist *,
130  const cpl_image *,
131  const cpl_parameterlist *,
132  const char *,
133  visir_chopnod_mode,
134  const cpl_propertylist *);
135 
136 double visir_img_check_box(const cpl_apertures *, int, int,
137  const cpl_apertures *, int, int,
138  double, double, cpl_boolean *, cpl_boolean *);
139 
140 double visir_img_check_align(const cpl_apertures *, int,
141  const cpl_apertures *, int, int,
142  double, double,
143  cpl_boolean *);
144 
145 double visir_img_check_line(const cpl_apertures *, int,
146  const cpl_apertures *, int,
147  double, double);
148 
149 cpl_error_code visir_get_data_type(const cpl_frame * frame,
150  const cpl_propertylist * plist,
151  visir_data_type * ptype, cpl_size * pnext);
152 
153 cpl_error_code visir_load_cube2_split(cpl_imagelist *, cpl_imagelist *,
154  const irplib_framelist *, const int,
155  const int, const int);
156 
157 cpl_error_code visir_load_burst(cpl_imagelist *, cpl_imagelist *,
158  const cpl_frame *, const cpl_propertylist *,
159  const int, const int, const int, const int,
160  const int, const int);
161 
162 cpl_error_code visir_img_burst_find_delta_chop(const cpl_propertylist *,
163  int *, int *);
164 
165 
166 visir_chopnod_mode visir_img_find_beam(cpl_propertylist *,
167  const cpl_image *,
168  const cpl_image *,
169  const cpl_propertylist *,
170  const cpl_parameterlist *,
171  const char *,
172  double [],
173  double []);
174 
175 cpl_error_code visir_img_find_beam_two(cpl_propertylist *, const cpl_image *,
176  const cpl_image *, double, double, double,
177  double [], double [], cpl_boolean);
178 
179 #endif
cpl_imagelist * visir_imagelist_load_last(const irplib_framelist *)
Load the last frame of the input files to an image list.
cpl_error_code visir_load_cube2_split(cpl_imagelist *, cpl_imagelist *, const irplib_framelist *, const int, const int, const int)
Load and split the data in a CUBE2 file.
Definition: visir_inputs.c:238
cpl_error_code visir_image_reject_hot(cpl_image *, const char *)
Reject the hot pixels in an image.
cpl_image ** visir_img_recombine_list(const char *, const cpl_parameterlist *, cpl_imagelist *, const cpl_propertylist **, cpl_geom_combine, cpl_boolean *)
The VISIR imaging combination using cross correlation.
cpl_image ** visir_img_collapse_beam(cpl_propertylist *, const cpl_image *, const cpl_parameterlist *, const char *, visir_chopnod_mode, const cpl_propertylist *)
Collapse the 3/4 beams of a combined image.
Definition: visir_inputs.c:504
cpl_imagelist * visir_load_imagelist(const irplib_framelist *, int, cpl_boolean)
Load either a INTERM or Half-Cycle cube from a VISIR file.
cpl_imagelist * visir_inputs_combine(const char *, const cpl_parameterlist *, const irplib_framelist *, const char *, const char *, int *, cpl_boolean, double, visir_spc_resol)
The VISIR input data re-combination is performed here.
Definition: visir_inputs.c:686
cpl_imagelist * visir_load_hcycle(const irplib_framelist *, int)
Load the HCYCLE images from a VISIR file.
cpl_image ** visir_img_recombine(const char *, const cpl_parameterlist *, const irplib_framelist *, const char *, const char *, cpl_geom_combine, cpl_boolean *, cpl_boolean, double, visir_spc_resol)
The VISIR imaging combination using cross correlation.