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 #ifdef HAVE_CONFIG_H
00029 #include <config.h>
00030 #endif
00031
00032
00033
00034
00035
00036 #include <cpl.h>
00037
00038 #include "irplib_detmon_lg.h"
00039 #include "irplib_plugin.h"
00040
00041
00042 #define NACO_IMG_LINGAIN_ON_RAW "CAL_LINGAIN_LAMP"
00043 #define NACO_IMG_LINGAIN_OFF_RAW "CAL_LINGAIN_DARK"
00044
00045 #define RECIPE_NAME "naco_img_lingain"
00046
00047
00048 #define INSTREGEXP "ESO DET MODE NAME|ESO DET NCORRS NAME|" \
00049 "ESO INS OPTI7 NAME|ESO INS OPTI6 NAME|" \
00050 "ESO INS OPTI5 NAME|ESO INS OPTI4 NAME"
00051
00052 #define PAFREGEXP "^(" REGEXP "|" INSTREGEXP ")$"
00053
00054 #define NIR TRUE
00055
00056 #ifndef NACO_REF_LEVEL
00057
00058
00059
00060 #define NACO_REF_LEVEL 2000
00061 #endif
00062
00063
00064
00065
00066 cpl_recipe_define(naco_img_lingain, NACO_BINARY_VERSION,
00067 "Lars Lundin", PACKAGE_BUGREPORT, "2007",
00068 "Linearity/Gain recipe for the IR domain",
00069 irplib_detmon_lg_get_description(RECIPE_NAME, "NACO",
00070 NACO_IMG_LINGAIN_ON_RAW,
00071 NACO_IMG_LINGAIN_OFF_RAW));
00072
00073
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 static int naco_img_lingain(cpl_frameset * frameset,
00094 const cpl_parameterlist * parlist)
00095 {
00096
00097 cpl_propertylist * pro_lintbl = cpl_propertylist_new();
00098 cpl_propertylist * pro_gaintbl = cpl_propertylist_new();
00099 cpl_propertylist * pro_coeffscube = cpl_propertylist_new();
00100 cpl_propertylist * pro_bpm = cpl_propertylist_new();
00101 cpl_propertylist * pro_corr = cpl_propertylist_new();
00102 cpl_propertylist * pro_diff = cpl_propertylist_new();
00103 cpl_error_code error = CPL_ERROR_NONE;
00104
00105 error |= cpl_propertylist_append_string(pro_lintbl, "ESO PRO CATG",
00106 "DET_LIN_INFO");
00107 error |= cpl_propertylist_append_string(pro_gaintbl, "ESO PRO CATG",
00108 "GAIN_INFO");
00109 error |= cpl_propertylist_append_string(pro_coeffscube, "ESO PRO CATG",
00110 "COEFFS_CUBE");
00111 error |= cpl_propertylist_append_string(pro_bpm, "ESO PRO CATG",
00112 "BP_MAP_NL");
00113 error |= cpl_propertylist_append_string(pro_corr, "ESO PRO CATG",
00114 "AUTOCORR");
00115 error |= cpl_propertylist_append_string(pro_diff, "ESO PRO CATG",
00116 "DIFF_FLAT");
00117
00118 error |= irplib_detmon_lg(frameset,
00119 parlist,
00120 NACO_IMG_LINGAIN_ON_RAW,
00121 NACO_IMG_LINGAIN_OFF_RAW,
00122 RECIPE_NAME,
00123 PACKAGE,
00124 PAFREGEXP,
00125 pro_lintbl,
00126 pro_gaintbl,
00127 pro_coeffscube,
00128 pro_bpm,
00129 pro_corr,
00130 pro_diff,
00131 PACKAGE "/" PACKAGE_VERSION,
00132 NULL, NULL, NIR);
00133
00134 cpl_propertylist_delete(pro_lintbl);
00135 cpl_propertylist_delete(pro_gaintbl);
00136 cpl_propertylist_delete(pro_coeffscube);
00137 cpl_propertylist_delete(pro_bpm);
00138 cpl_propertylist_delete(pro_corr);
00139 cpl_propertylist_delete(pro_diff);
00140
00141
00142 cpl_ensure_code(!error, cpl_error_get_code());
00143
00144 return CPL_ERROR_NONE;
00145 }
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157 static
00158 cpl_error_code naco_img_lingain_fill_parameterlist(cpl_parameterlist * self)
00159 {
00160
00161 cpl_error_code error =
00162 irplib_detmon_lg_fill_parlist_nir_default(self, RECIPE_NAME, PACKAGE);
00163 cpl_parameter * p;
00164
00165 cpl_ensure_code(!error, error);
00166
00167
00168
00169 p = cpl_parameterlist_find(self, PACKAGE "." RECIPE_NAME ".ref_level");
00170
00171 cpl_ensure_code(p != NULL, CPL_ERROR_DATA_NOT_FOUND);
00172
00173 error = cpl_parameter_set_default_int(p, NACO_REF_LEVEL);
00174
00175 cpl_ensure_code(!error, error);
00176
00177 return CPL_ERROR_NONE;
00178 }