GIRAFFE Pipeline Reference Manual

giccdron.c

00001 /* $Id: giccdron.c,v 1.6 2011/02/08 10:08:31 rpalsa Exp $
00002  *
00003  * This file is part of the GIRAFFE Pipeline
00004  * Copyright (C) 2002-2008 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 /*
00022  * $Author: rpalsa $
00023  * $Date: 2011/02/08 10:08:31 $
00024  * $Revision: 1.6 $
00025  * $Name: giraffe-2_8_8 $
00026  */
00027 
00028 #ifdef HAVE_CONFIG_H
00029 #  include <config.h>
00030 #endif
00031 
00032 #include <cxmessages.h>
00033 #include <cxmemory.h>
00034 
00035 #include <cpl_recipe.h>
00036 #include <cpl_plugininfo.h>
00037 #include <cpl_parameterlist.h>
00038 #include <cpl_frameset.h>
00039 #include <cpl_msg.h>
00040 
00041 #include "giframe.h"
00042 #include "gierror.h"
00043 #include "giutils.h"
00044 
00045 #include "irplib_detmon.h"
00046 
00047 
00048 static cxint giccdron(cpl_parameterlist* config, cpl_frameset* set);
00049 
00050 
00051 /*
00052  * Create the recipe instance, i.e. setup the parameter list for this
00053  * recipe and make it availble to the application using the interface.
00054  */
00055 
00056 static cxint
00057 giccdron_create(cpl_plugin* plugin)
00058 {
00059 
00060     cpl_recipe* recipe = (cpl_recipe*)plugin;
00061 
00062 
00063     giraffe_error_init();
00064 
00065 
00066     /*
00067      * We have to provide the option we accept to the application. We
00068      * need to setup our parameter list and hook it into the recipe
00069      * interface.
00070      */
00071 
00072     recipe->parameters = cpl_parameterlist_new();
00073     cx_assert(recipe->parameters != NULL);
00074 
00075 
00076     /*
00077      * Fill the parameter list.
00078      */
00079 
00080      irplib_detmon_ronbias_fill_parlist(recipe->parameters,
00081             "giccdron", "giraffe",
00082             "ALL", /* --method */
00083             "NORM",/* --pmethod */
00084             1,     /* --preoverscan_degree */
00085             -1,    /* --random_nsamples */
00086             10,    /* --random_sizex */
00087             -1,    /* --random_sizey */
00088             0,     /* --criteria */
00089             -1,    /* --ref_llx */
00090             -1,    /* --ref_lly */
00091             -1,    /* --ref_urx */
00092             -1,    /* --ref_ury */
00093             "MEAN",/* --stacking_method */
00094             3,     /* --stacking_ks_low */
00095             3,     /* --stacking_ks_high */
00096             25,    /* --stacking_ks_iter */
00097             0,     /* --master_shift_x */
00098             0,     /* --master_shift_y */
00099             -1,    /* --ron_llx */
00100             -1,    /* --ron_lly */
00101             -1,    /* --ron_urx */
00102             -1,    /* --ron_ury */
00103             0,     /* --exts */
00104             OPT);
00105 
00106 
00107     if (cpl_error_get_code() != CPL_ERROR_NONE) {
00108         return 1;
00109     }
00110 
00111     return 0;
00112 
00113 }
00114 
00115 
00116 /*
00117  * Execute the plugin instance given by the interface.
00118  */
00119 
00120 static cxint
00121 giccdron_exec(cpl_plugin* plugin)
00122 {
00123 
00124     cpl_recipe* recipe = (cpl_recipe*)plugin;
00125 
00126 
00127     cx_assert(recipe->parameters != NULL);
00128     cx_assert(recipe->frames != NULL);
00129 
00130     return giccdron(recipe->parameters, recipe->frames);
00131 
00132 }
00133 
00134 
00135 static cxint
00136 giccdron_destroy(cpl_plugin* plugin)
00137 {
00138 
00139     cpl_recipe* recipe = (cpl_recipe*)plugin;
00140 
00141 
00142     /*
00143      * We just destroy what was created during the plugin initialization
00144      * phase, i.e. the parameter list. The frame set is managed by the
00145      * application which called us, so we must not touch it,
00146      */
00147 
00148     cpl_parameterlist_delete(recipe->parameters);
00149 
00150     giraffe_error_clear();
00151 
00152     return 0;
00153 
00154 }
00155 
00156 
00157 /*
00158  * The actual recipe starts here.
00159  */
00160 
00161 static cxint
00162 giccdron(cpl_parameterlist* config, cpl_frameset* set)
00163 {
00164 
00165     cpl_propertylist* mbias_properties = NULL;
00166     cpl_propertylist* synth_properties = NULL;
00167     cpl_propertylist* hpm_properties = NULL;
00168     cpl_propertylist* cpm_properties = NULL;
00169     cpl_propertylist* dpm_properties = NULL;
00170 
00171     cpl_error_code status = CPL_ERROR_NONE;
00172 
00173 
00174     mbias_properties = irplib_detmon_fill_prolist("MASTER_BIAS_RON",
00175                                                   NULL, NULL, CPL_FALSE);
00176     synth_properties = irplib_detmon_fill_prolist("SYNTH",
00177                                                   NULL, NULL, CPL_FALSE);
00178     hpm_properties = irplib_detmon_fill_prolist("HOT_PIXEL_MAP",
00179                                                 NULL, NULL, CPL_FALSE);
00180     cpm_properties = irplib_detmon_fill_prolist("COLD_PIXEL_MAP",
00181                                                 NULL, NULL, CPL_FALSE);
00182     dpm_properties = irplib_detmon_fill_prolist("DEVIANT_PIXEL_MAP",
00183                                                 NULL, NULL, CPL_FALSE);
00184 
00185     status = irplib_detmon_ronbias(set, config,
00186                                    GIFRAME_LINEARITY_BIAS,
00187                                    "giccdron", "giraffe",
00188                                    REGEXP,
00189                                    mbias_properties,
00190                                    NULL,
00191                                    NULL,
00192                                    synth_properties,
00193                                    hpm_properties,
00194                                    cpm_properties,
00195                                    dpm_properties,
00196                                    PACKAGE "/" PACKAGE_VERSION,
00197                                    NULL,
00198                                    OPT);
00199 
00200     cpl_propertylist_delete(mbias_properties);
00201     cpl_propertylist_delete(synth_properties);
00202     cpl_propertylist_delete(hpm_properties);
00203     cpl_propertylist_delete(cpm_properties);
00204     cpl_propertylist_delete(dpm_properties);
00205 
00206     if (status != CPL_ERROR_NONE) {
00207         return 1;
00208     }
00209 
00210     return 0;
00211 
00212 }
00213 
00214 
00215 /*
00216  * Build table of contents, i.e. the list of available plugins, for
00217  * this module. This function is exported.
00218  */
00219 
00220 int
00221 cpl_plugin_get_info(cpl_pluginlist* list)
00222 {
00223 
00224     cpl_recipe* recipe = cx_calloc(1, sizeof *recipe);
00225     cpl_plugin* plugin = &recipe->interface;
00226 
00227 
00228     cpl_plugin_init(plugin,
00229                     CPL_PLUGIN_API,
00230                     GIRAFFE_BINARY_VERSION,
00231                     CPL_PLUGIN_TYPE_RECIPE,
00232                     "giccdron",
00233                     "Compute CCD readout noise and create a bad pixel map.",
00234                     "For detailed information please refer to the "
00235                     "GIRAFFE pipeline user manual.\nIt is available at "
00236                     "http://www.eso.org/pipelines.",
00237                     "Giraffe Pipeline",
00238                     PACKAGE_BUGREPORT,
00239                     giraffe_get_license(),
00240                     giccdron_create,
00241                     giccdron_exec,
00242                     giccdron_destroy);
00243 
00244     cpl_pluginlist_append(list, plugin);
00245 
00246     return 0;
00247 
00248 }

This file is part of the GIRAFFE Pipeline Reference Manual 2.8.8.
Documentation copyright © 2002-2006 European Southern Observatory.
Generated on Fri Mar 4 10:50:26 2011 by doxygen 1.6.3 written by Dimitri van Heesch, © 1997-2004