DETMON Pipeline Reference Manual  1.3.0
detmon_ronbias.h
1 /* $Id: detmon.h,v 1.3 2013-01-25 16:08:41 jtaylor Exp $
2  *
3  * This file is part of the irplib package
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-01-25 16:08:41 $
24  * $Revision: 1.3 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifndef IRPLIB_DETMON_RONBIAS_H
29 #define IRPLIB_DETMON_RONBIAS_H
30 
31 /*----------------------------------------------------------------------------
32  Includes
33  ----------------------------------------------------------------------------*/
34 
35 #include <cpl.h>
36 #include <detmon_cpl_size.h>
37 
38 /*----------------------------------------------------------------------------
39  Prototypes
40  ----------------------------------------------------------------------------*/
41 
42 
43 #define NIR TRUE
44 #define OPT FALSE
45 
46 
47 #define DETMON_QC_DUTYCYCL "ESO QC DUTYCYCL"
48 #define DETMON_QC_DUTYCYCL_C "DUTYCYCL value (time to store a frame)"
49 
50 #define DETMON_QC_MASTER_MEAN "ESO QC MASTER MEAN"
51 #define DETMON_QC_MASTER_MEAN_C "Master Mean value"
52 
53 #define DETMON_QC_MASTER_RMS "ESO QC MASTER RMS"
54 #define DETMON_QC_MASTER_RMS_C "Master RMS value"
55 
56 #define DETMON_QC_NBCOLDPIX "ESO QC NBCOLPIX"
57 #define DETMON_QC_NBCOLDPIX_C "Number of cold pixels"
58 
59 #define DETMON_QC_NBHOTPIX "ESO QC NBHOTPIX"
60 #define DETMON_QC_NBHOTPIX_C "Number of hot pixels"
61 
62 #define DETMON_QC_NBDEVPIX "ESO QC NBDEVPIX"
63 #define DETMON_QC_NBDEVPIX_C "Number of deviating pixels"
64 
65 #define DETMON_QC_BIAS_RANDOM_VAL "ESO QC BIAS RANDOM VAL"
66 #define DETMON_QC_BIAS_RANDOM_VAL_C "Bias level (random sampling method) [ADU]"
67 
68 #define DETMON_QC_BIAS_RANDOM_RON "ESO QC BIAS RANDOM RON"
69 #define DETMON_QC_BIAS_RANDOM_RON_C "Bias Read Out Noise (random sampling method) [ADU]"
70 
71 #define DETMON_QC_BIAS_HISTO_VAL "ESO QC BIAS HISTO VAL"
72 #define DETMON_QC_BIAS_HISTO_VAL_C "Bias level (histogram method) [ADU]"
73 
74 #define DETMON_QC_BIAS_HISTO_RON "ESO QC BIAS HISTO RON"
75 #define DETMON_QC_BIAS_HISTO_RON_C "Bias Read Out Noise (histogram method) [e- rms]"
76 
77 #define DETMON_QC_BIAS_PRESCAN_MEAN "ESO QC BIAS PRESCAN MEAN"
78 #define DETMON_QC_BIAS_PRESCAN_MEAN_C "Bias mean level (on prescan region) [ADU]"
79 
80 #define DETMON_QC_BIAS_PRESCAN_MED "ESO QC BIAS PRESCAN MED"
81 #define DETMON_QC_BIAS_PRESCAN_MED_C "Bias median level (on prescan region) [ADU]"
82 
83 #define DETMON_QC_BIAS_PRESCAN_RON "ESO QC BIAS PRESCAN RON"
84 #define DETMON_QC_BIAS_PRESCAN_RON_C "Bias Read Out Noise (on prescan region) [e- rms]"
85 
86 
87 #define DETMON_QC_BIAS_OVERSCAN_MEAN "ESO QC BIAS OVERSCAN MEAN"
88 #define DETMON_QC_BIAS_OVERSCAN_MEAN_C "Bias mean level (on overscan region) [ADU]"
89 
90 #define DETMON_QC_BIAS_OVERSCAN_MED "ESO QC BIAS OVERSCAN MED"
91 #define DETMON_QC_BIAS_OVERSCAN_MED_C "Bias median level (on overscan region) [ADU]"
92 
93 #define DETMON_QC_BIAS_OVERSCAN_RON "ESO QC BIAS OVERSCAN RON"
94 #define DETMON_QC_BIAS_OVERSCAN_RON_C "Bias Read Out Noise (on overscan region) [e- rms]"
95 
96 #define DETMON_QC_BIAS_REGION_VAL "ESO QC BIAS REGION VAL"
97 #define DETMON_QC_BIAS_REGION_VAL_C "Bias level (o#include <cpl.h>n user defined region) [ADU]"
98 
99 #define DETMON_QC_BIAS_REGION_MED "ESO QC BIAS REGION MED"
100 #define DETMON_QC_BIAS_REGION_MED_C "Bias median level (on user defined region) [ADU]"
101 
102 #define DETMON_QC_BIAS_REGION_RON "ESO QC BIAS REGION RON"
103 #define DETMON_QC_BIAS_REGION_RON_C "Bias Read Out Noise (on user defined region) [e- rms]"
104 
105 
106 /* Macros to generate the recipe(s) description(s) */
107 #define detmon_ronbias_get_description(RECIPE_NAME, PIPE_NAME, \
108  DETMON_RONBIAS_RAW) \
109  RECIPE_NAME " -- " PIPE_NAME " ronbias recipe for OPT/IR.\n" \
110  "The files listed in the Set Of Frames must be tagged:\n" \
111  "raw-file.fits "DETMON_RONBIAS_RAW"\n"
112 
113 #define RANDOM ((irplib_ronbias_method) 1 << 1)
114 #define HISTO ((irplib_ronbias_method) 1 << 2)
115 #define PREOVERSCAN ((irplib_ronbias_method) 1 << 3)
116 #define REGION ((irplib_ronbias_method) 1 << 4)
117 
118 typedef unsigned long irplib_ronbias_method;
119 
120 #undef REGEXP
121 #define REGEXP "ARCFILE|MJD-OBS|ESO TPL ID|DATE-OBS|ESO DET DIT|ESO DET NDIT"
122 
123 
124 cpl_image *
125 irplib_imagelist_collapse_stdev_create(const cpl_imagelist * imlist);
126 
127 cpl_error_code
128 detmon_ronbias(cpl_frameset *,
129  const cpl_parameterlist *,
130  const char *,
131  const char *,
132  const char *,
133  const char *,
134  const cpl_propertylist *,
135  const cpl_propertylist *,
136  const cpl_propertylist *,
137  const cpl_propertylist *,
138  const cpl_propertylist *,
139  const cpl_propertylist *,
140  const cpl_propertylist *,
141  const char *,
142  int (*)(const cpl_frame *,
143  const cpl_frame *),
144  cpl_boolean);
145 
146 
147 cpl_error_code
148 detmon_ronbias_fill_parlist_default(cpl_parameterlist *,
149  const char *,
150  const char *);
151 
152 
153 cpl_error_code
154 detmon_ronbias_fill_parlist(cpl_parameterlist *,
155  const char *,
156  const char *,
157  const char *,
158  const char *,
159  const int,
160  const int,
161  const int,
162  const int,
163  const int,
164  const int,
165  const int,
166  const int,
167  const int,
168  const char *,
169  const int,
170  const int,
171  const int,
172  const int,
173  const int,
174  const int,
175  const int,
176  const int,
177  const int,
178  const int,
179  cpl_boolean);
180 
181 cpl_error_code
182 detmon_ronbias_histo_reduce(const cpl_image * c_raw,
183  double * bias,
184  double * fwhm,
185  double * max);
186 cpl_image *
187 detmon_build_synthetic(cpl_image *,
188  cpl_image *);
189 
190 cpl_error_code
191 irplib_flux_get_bias_window(const cpl_image *,
192  const int *,
193  int ,
194  int ,
195  double *,
196  double *);
197 
198 
199 int
200 detmon_retrieve_par_int(const char *,
201  const char *,
202  const char *, const cpl_parameterlist *);
203 
204 double
205 detmon_retrieve_par_double(const char *,
206  const char *,
207  const char *, const cpl_parameterlist *);
208 
209 
210 #endif