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.h"
00039 #include "irplib_detmon_lg.h"
00040 #include "irplib_plugin.h"
00041 
00042 
00043 #define ISAAC_IMG_LINGAIN_ON_RAW                    "CAL_LINGAIN_LAMP"
00044 #define ISAAC_IMG_LINGAIN_OFF_RAW           "CAL_LINGAIN_DARK"
00045 
00046 #define RECIPE_NAME "isaac_img_lingain"
00047 
00048 
00049 #define INSTREGEXP   "ESO DET CHIP NAME|ESO DET MODE NAME"
00050 
00051 #define PAFREGEXP    "^(" REGEXP "|" INSTREGEXP ")$"
00052 
00053 #define NIR TRUE
00054 
00055 
00056 
00057 
00058 
00059 cpl_recipe_define(isaac_img_lingain, ISAAC_BINARY_VERSION,
00060                   "Lars Lundin", PACKAGE_BUGREPORT, "2008", 
00061                   "Linearity/Gain recipe for the IR domain",
00062                   irplib_detmon_lg_get_description(RECIPE_NAME, "ISAAC",
00063                                                    ISAAC_IMG_LINGAIN_ON_RAW,
00064                                                    ISAAC_IMG_LINGAIN_OFF_RAW));
00065 
00066 
00067 
00068 
00069 
00070 
00078 
00079 static
00080 cpl_error_code isaac_img_lingain_fill_parameterlist(cpl_parameterlist * self) {
00081 
00082     return irplib_detmon_lg_fill_parlist_nir_default(self, RECIPE_NAME,
00083                                                      PACKAGE_TARNAME)
00084         ? cpl_error_set_where(cpl_func) : CPL_ERROR_NONE;
00085 }
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 static int isaac_img_lingain(cpl_frameset            * frameset,
00097              const cpl_parameterlist * parlist)
00098 {
00099     cpl_propertylist * lintbl = 
00100     irplib_detmon_fill_prolist("DET_LIN_INFO", "TYPE", "TECH", CPL_TRUE);
00101 
00102     cpl_propertylist * gaintbl = 
00103     irplib_detmon_fill_prolist("GAIN_INFO",    "TYPE", "TECH", CPL_TRUE);
00104 
00105     cpl_propertylist * coeffscube = 
00106     irplib_detmon_fill_prolist("COEFFS_CUBE",  "TYPE", "TECH", CPL_TRUE);
00107 
00108     cpl_propertylist * bpm = 
00109     irplib_detmon_fill_prolist("BP_MAP_NL",    "TYPE", "TECH", CPL_TRUE);
00110 
00111     cpl_propertylist * corr = 
00112     irplib_detmon_fill_prolist("AUTOCORR",     "TYPE", "TECH", CPL_TRUE);
00113 
00114     cpl_propertylist * diff_flat = 
00115     irplib_detmon_fill_prolist("DIFF_FLAT",    "TYPE", "TECH", CPL_TRUE);
00116 
00117     const cpl_error_code error = irplib_detmon_lg(frameset,
00118                                                   parlist,
00119                                                   ISAAC_IMG_LINGAIN_ON_RAW,
00120                                                   ISAAC_IMG_LINGAIN_OFF_RAW,
00121                                                   RECIPE_NAME,
00122                                               PACKAGE_TARNAME,
00123                                                   PAFREGEXP,
00124                                                   lintbl, gaintbl, coeffscube,
00125                           bpm, corr, diff_flat,
00126                                                   PACKAGE "/" PACKAGE_VERSION,
00127                                                   NULL, NULL, NIR);
00128 
00129     cpl_propertylist_delete(lintbl);
00130     cpl_propertylist_delete(gaintbl);
00131     cpl_propertylist_delete(coeffscube);
00132     cpl_propertylist_delete(bpm);
00133     cpl_propertylist_delete(corr);
00134     cpl_propertylist_delete(diff_flat);
00135 
00136     
00137     cpl_ensure_code(!error, error);
00138 
00139     return CPL_ERROR_NONE;
00140 }