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