00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef IRPLIB_DETMON_LG_H
00029 #define IRPLIB_DETMON_LG_H
00030
00031
00032
00033
00034
00035 #include <cpl.h>
00036
00037
00038
00039
00040
00041
00042 #define NIR TRUE
00043 #define OPT FALSE
00044
00045 #define DETMON_QC_CONAD "ESO QC CONAD"
00046 #define DETMON_QC_CONAD_C "CONAD value (inverse of GAIN)"
00047
00048 #define DETMON_QC_GAIN "ESO QC GAIN"
00049 #define DETMON_QC_GAIN_C "GAIN (see QC.METHOD)"
00050
00051 #define DETMON_QC_GAIN_MSE "ESO QC GAIN MSE"
00052 #define DETMON_QC_GAIN_MSE_C "Error of the GAIN computation"
00053
00054 #define DETMON_QC_RON "ESO QC RON"
00055 #define DETMON_QC_RON_C "RON obtained as independent term (PTC method)"
00056
00057 #define DETMON_QC_AUTOCORR "ESO QC AUTOCORR"
00058 #define DETMON_QC_AUTOCORR_C "Autocorrelation factor computed as sum of " \
00059 "all pixels in autocorrelation image"
00060 #define DETMON_QC_GAIN_CORR "ESO QC GAIN CORR"
00061 #define DETMON_QC_GAIN_CORR_C "GAIN taken QC.AUTOCORR into account"
00062
00063 #define DETMON_QC_LAMP_FLUX "ESO QC LAMP FLUX"
00064 #define DETMON_QC_LAMP_FLUX_C "Lamp flux"
00065
00066 #define DETMON_QC_NUM_BPM "ESO QC NUM BPM"
00067 #define DETMON_QC_NUM_BPM_C "Number of bad pixels detected according to "\
00068 "polynomial information"
00069
00070 #define DETMON_QC_LAMP_STAB "ESO QC LAMP STAB"
00071 #define DETMON_QC_LAMP_STAB_C "Lamp stability"
00072
00073 #define DETMON_QC_METHOD "ESO QC METHOD"
00074 #define DETMON_QC_METHOD_C "Method applied to compute GAIN"
00075
00076 #define DETMON_QC_LIN_EFF "ESO QC LIN EFF"
00077 #define DETMON_QC_LIN_EFF_C "Effective non-linearity correction"
00078
00079
00080 #define irplib_detmon_lg_get_description(RECIPE_NAME, PIPE_NAME, \
00081 DETMON_IR_LG_ON_RAW, \
00082 DETMON_IR_LG_OFF_RAW) \
00083 RECIPE_NAME " -- " PIPE_NAME " linearity/gain recipe for IR.\n" \
00084 "The files listed in the Set Of Frames must be tagged:\n" \
00085 "the raw-on-file.fits "DETMON_IR_LG_ON_RAW" and\n" \
00086 "the raw-off-file.fits "DETMON_IR_LG_OFF_RAW"\n" \
00087 "The recipe requires at least order+1 valid pairs of ON frames\n" \
00088 "and order+1 valid pairs of OFF frames, \n" \
00089 "where order is the value of the 'order' parameter.\n" \
00090 "There is no requirement for pairs of OFF frames if collapse parameter" \
00091 "is set to true.\n" \
00092 "Frames with median flux over --filter will be excluded from the" \
00093 "computation.\n" \
00094 "To perform a stability check you need frames with at least 2 DIT" \
00095 "values\n" \
00096 "NOTE for multiextension cases: it is mandatory to modify the --exts" \
00097 "parameter, either to -1 (all extensions) or to any valid extension nb.\n"
00098
00099 #define REGEXP "ARCFILE|MJD-OBS|ESO TPL ID|DATE-OBS|ESO DET DIT|ESO DET NDIT"
00100
00101 typedef unsigned long gain_flag;
00102
00103 #define IRPLIB_GAIN_PTC ((gain_flag) 1 << 1)
00104 #define IRPLIB_GAIN_MEDIAN ((gain_flag) 1 << 2)
00105 #define IRPLIB_GAIN_NO_COLLAPSE ((gain_flag) 1 << 3)
00106 #define IRPLIB_GAIN_COLLAPSE ((gain_flag) 1 << 4)
00107 #define IRPLIB_GAIN_WITH_AUTOCORR ((gain_flag) 1 << 5)
00108 #define IRPLIB_GAIN_WITH_RESCALE ((gain_flag) 1 << 6)
00109
00110 cpl_error_code
00111 irplib_detmon_lg(cpl_frameset *,
00112 const cpl_parameterlist *,
00113 const char *,
00114 const char *,
00115 const char *,
00116 const char *,
00117 const char *,
00118 const char *,
00119 const char *,
00120 const char *,
00121 const char *,
00122 const char *,
00123 const char *,
00124 const char *,
00125 int (*)(const cpl_frame *,
00126 const cpl_frame *),
00127 int (* load_fset) (const cpl_frameset *,
00128 cpl_type,
00129 cpl_imagelist *),
00130 const cpl_boolean );
00131
00132 cpl_image * irplib_detmon_image_correlate(const cpl_image *,
00133 const cpl_image *,
00134 const int ,
00135 const int );
00136
00137 cpl_error_code
00138 irplib_detmon_lg_fill_parlist_nir_default(cpl_parameterlist *,
00139 const char *,
00140 const char *);
00141
00142 cpl_error_code
00143 irplib_detmon_lg_fill_parlist_opt_default(cpl_parameterlist *,
00144 const char *,
00145 const char *);
00146
00147 cpl_error_code
00148 irplib_detmon_lg_fill_parlist(cpl_parameterlist * parlist,
00149 const char *recipe_name, const char *pipeline_name,
00150 const char *method,
00151 int order,
00152 int kappa,
00153 int niter,
00154 int llx,
00155 int lly,
00156 int urx,
00157 int ury,
00158 int ref_level,
00159 const char * intermediate,
00160 const char * autocorr,
00161 const char * collapse,
00162 const char * rescale,
00163 const char * pix2pix,
00164 const char * bpmbin,
00165 int filter,
00166 int m,
00167 int n,
00168 double tolerance,
00169 const char * pafname,
00170 int llx1,
00171 int lly1,
00172 int urx1,
00173 int ury1,
00174 int llx2,
00175 int lly2,
00176 int urx2,
00177 int ury2,
00178 int llx3,
00179 int lly3,
00180 int urx3,
00181 int ury3,
00182 int llx4,
00183 int lly4,
00184 int urx4,
00185 int ury4,
00186 int llx5,
00187 int lly5,
00188 int urx5,
00189 int ury5,
00190 int exts,
00191 cpl_boolean opt_nir);
00192
00193 cpl_image *
00194 irplib_detmon_autocorrelate(const cpl_image *,
00195 const int, const int);
00196
00197 cpl_table *
00198 irplib_detmon_gain(const cpl_imagelist *,
00199 const cpl_imagelist *,
00200 const cpl_vector *,
00201 int ,
00202 int ,
00203 int ,
00204 int ,
00205 double ,
00206 int ,
00207 int ,
00208 int ,
00209 cpl_propertylist *,
00210 unsigned ,
00211 cpl_imagelist **,
00212 cpl_imagelist **);
00213
00214
00215 #endif