uves_cal_mkmaster_sflat_impl.c

00001 /*                                                                              *
00002  *   This file is part of the ESO UVES Pipeline                                 *
00003  *   Copyright (C) 2004,2005 European Southern Observatory                      *
00004  *                                                                              *
00005  *   This library is free software; you can redistribute it and/or modify       *
00006  *   it under the terms of the GNU General Public License as published by       *
00007  *   the Free Software Foundation; either version 2 of the License, or          *
00008  *   (at your option) any later version.                                        *
00009  *                                                                              *
00010  *   This program is distributed in the hope that it will be useful,            *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
00013  *   GNU General Public License for more details.                               *
00014  *                                                                              *
00015  *   You should have received a copy of the GNU General Public License          *
00016  *   along with this program; if not, write to the Free Software                *
00017  *   Foundation, 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA       *
00018  *                                                                              */
00019  
00020 /*
00021  * $Author: jmlarsen $
00022  * $Date: 2007/06/11 13:28:26 $
00023  * $Revision: 1.5 $
00024  * $Name: uves-3_3_1 $
00025  * $Log: uves_cal_mkmaster_sflat_impl.c,v $
00026  * Revision 1.5  2007/06/11 13:28:26  jmlarsen
00027  * Changed recipe contact address to cpl at eso.org
00028  *
00029  * Revision 1.4  2007/06/08 13:06:16  jmlarsen
00030  * Send bug reports to Andrea
00031  *
00032  * Revision 1.3  2007/06/06 08:17:33  amodigli
00033  * replace tab with 4 spaces
00034  *
00035  * Revision 1.2  2007/05/14 08:09:48  amodigli
00036  * updated input frames and tag description in recipe man page
00037  *
00038  * Revision 1.1  2007/02/09 13:34:31  jmlarsen
00039  * Added mkmaster+spatred recipes
00040  *
00041  * Revision 1.37  2006/11/06 15:19:41  jmlarsen
00042  * Removed unused include directives
00043  *
00044  * Revision 1.36  2006/10/25 07:21:52  jmlarsen
00045  * Documentation bug fix
00046  *
00047  * Revision 1.35  2006/10/24 14:02:38  jmlarsen
00048  * Factored out common UVES/FLAMES code
00049  *
00050  * Revision 1.34  2006/10/17 12:33:02  jmlarsen
00051  * Added semicolon at UVES_RECIPE_DEFINE invocation
00052  *
00053  * Revision 1.33  2006/10/09 13:01:13  jmlarsen
00054  * Use macro to define recipe interface functions
00055  *
00056  * Revision 1.32  2006/09/20 12:53:57  jmlarsen
00057  * Replaced stringcat functions with uves_sprintf()
00058  *
00059  * Revision 1.31  2006/09/19 14:31:10  jmlarsen
00060  * uves_insert_frame(): use bitmap to specify which 
00061  * image statistics keywords must be computed
00062  *
00063  * Revision 1.30  2006/09/19 06:55:11  jmlarsen
00064  * Changed interface of uves_frameset to optionally write image statistics kewwords
00065  *
00066  * Revision 1.29  2006/08/24 11:36:37  jmlarsen
00067  * Write recipe start/stop time to header
00068  *
00069  * Revision 1.28  2006/08/18 13:35:42  jmlarsen
00070  * Fixed/changed QC parameter formats
00071  *
00072  * Revision 1.27  2006/08/11 14:56:05  amodigli
00073  * removed Doxygen warnings
00074  *
00075  * Revision 1.26  2006/08/07 11:35:35  jmlarsen
00076  * Disabled parameter environment variable mode
00077  *
00078  * Revision 1.25  2006/07/14 12:19:28  jmlarsen
00079  * Support multiple QC tests per product
00080  *
00081  * Revision 1.24  2006/07/03 14:20:39  jmlarsen
00082  * Exclude bad pixels from order tracing
00083  *
00084  * Revision 1.23  2006/07/03 13:09:24  amodigli
00085  * adjusted description display layout
00086  *
00087  * Revision 1.22  2006/07/03 12:46:34  amodigli
00088  * updated description
00089  *
00090  * Revision 1.21  2006/06/22 12:13:10  amodigli
00091  * removed ESO prefix
00092  *
00093  * Revision 1.20  2006/06/22 06:44:06  amodigli
00094  * added some QC param
00095  *
00096  * Revision 1.19  2006/06/16 08:25:34  jmlarsen
00097  * Do the order tracing on non-median filtered frame
00098  *
00099  * Revision 1.18  2006/06/13 11:57:02  jmlarsen
00100  * Check that calibration frames are from the same chip ID
00101  *
00102  * Revision 1.17  2006/06/08 11:40:50  amodigli
00103  * added check to have output order table as input guess, if provided
00104  *
00105  * Revision 1.16  2006/06/08 08:42:53  jmlarsen
00106  * Added support for computing Hough transform on image subwindow
00107  *
00108  * Revision 1.15  2006/06/07 13:06:28  jmlarsen
00109  * Changed doxygen tag addtogroup -> defgroup
00110  *
00111  * Revision 1.14  2006/06/07 09:01:28  amodigli
00112  * added some doc
00113  *
00114  * Revision 1.13  2006/06/06 08:40:10  jmlarsen
00115  * Shortened max line length
00116  *
00117  * Revision 1.12  2006/05/09 15:42:00  amodigli
00118  * added QC log
00119  *
00120  * Revision 1.11  2006/05/08 15:41:32  amodigli
00121  * added order table chopping (commented out)
00122  *
00123  * Revision 1.10  2006/05/05 13:55:17  jmlarsen
00124  * Minor doc update
00125  *
00126  * Revision 1.9  2006/04/20 10:47:39  amodigli
00127  * added qclog
00128  *
00129  * Revision 1.8  2006/04/06 09:48:15  amodigli
00130  * changed uves_frameset_insert interface to have QC log
00131  *
00132  * Revision 1.7  2006/04/06 08:46:40  jmlarsen
00133  * Changed default polynomial degrees to auto
00134  *
00135  * Revision 1.6  2006/03/24 14:04:14  jmlarsen
00136  * Changed background subtraction sample density default parameter value
00137  *
00138  * Revision 1.5  2006/03/09 10:53:41  jmlarsen
00139  * Changed default bivariate degrees to MIDAS values
00140  *
00141  * Revision 1.4  2006/03/03 13:54:11  jmlarsen
00142  * Changed syntax of check macro
00143  *
00144  * Revision 1.3  2006/02/28 09:15:22  jmlarsen
00145  * Minor update
00146  *
00147  * Revision 1.2  2006/02/21 14:26:54  jmlarsen
00148  * Minor changes
00149  *
00150  * Revision 1.1  2006/02/03 07:46:30  jmlarsen
00151  * Moved recipe implementations to ./uves directory
00152  *
00153  * Revision 1.63  2006/01/19 08:47:24  jmlarsen
00154  * Inserted missing doxygen end tag
00155  *
00156  * Revision 1.62  2006/01/05 14:31:31  jmlarsen
00157  * Checking for guess DRS table before guess order table
00158  *
00159  * Revision 1.61  2005/12/20 16:10:32  jmlarsen
00160  * Added some documentation
00161  *
00162  * Revision 1.60  2005/12/19 16:17:55  jmlarsen
00163  * Replaced bool -> int
00164  *
00165  */
00166 #ifdef HAVE_CONFIG_H
00167 #  include <config.h>
00168 #endif
00169 
00170 /*----------------------------------------------------------------------------*/
00176 /*----------------------------------------------------------------------------*/
00177 
00178 /*-----------------------------------------------------------------------------
00179                                 Includes
00180  -----------------------------------------------------------------------------*/
00181 
00182 #include <uves_reduce_mflat.h>
00183 #include <uves_recipe.h>
00184 #include <uves.h>
00185 
00186 #include <cpl.h>
00187 
00188 
00189 const char * const uves_cal_mkmaster_sflat_desc =
00190 "This recipe creates a composite master flat frame to reduce FIBER mode data by:\n"
00191 "1) Group each input raw flat frame per grating setting. Then for each set:\n"
00192 "1a) subtracts the master bias frame from each flat field frame, \n"
00193 "1b) divides each flat field frame by the exposure time for that frame, \n"
00194 "1c) takes the median of all bias subtracted, normalized raw flat frames,\n"
00195 "1d) optionally subtracts the master dark frame, and \n"
00196 "1e) subtracts the background to get the bias subtracted, \n"
00197 "optionally dark subtracted, normalized, background subtracted master \n"
00198 "flat-field frame.\n"
00199 "2) Creates a synthetic master frame resulting from the coaddition of\n"
00200 "each master flat frame obtained by each set\n"
00201 "Symbolically,\n"
00202 " masterflat = median( (flat_i - masterbias)/exptime_i ) - masterdark/exptime\n"
00203 "            - background.\n"
00204 "\n"
00205 "The input flat field frames must have same tag which must match\n"
00206 "(SFLAT_(BLUE|RED), for example SFLAT_BLUE or FLAT_RED. Also, a\n"
00207 "master bias (MASTER_BIAS_xxxx) and ordertable (ORDER_TABLE_xxxx) must be\n"
00208 "provided for each chip (xxxx = BLUE, REDL, REDU). A master dark frame\n"
00209 "(MASTER_(P)DARK_xxxx) may optionally be provided. On blue input the recipe\n"
00210 "computes one master flat field frame; on red input the recipe produces a\n"
00211 "master flat field frame for each chip (MASTER_SFLAT_xxxx).";
00212 
00213 
00214 
00215 
00216 
00217 /*-----------------------------------------------------------------------------
00218                             Forward declarations
00219  -----------------------------------------------------------------------------*/
00220 static int uves_cal_mkmaster_sflat_define_parameters(cpl_parameterlist *parameters);
00221 
00222 /*-----------------------------------------------------------------------------
00223                             Recipe standard code
00224  -----------------------------------------------------------------------------*/
00225 #define cpl_plugin_get_info uves_cal_mkmaster_sflat_get_info
00226 UVES_RECIPE_DEFINE(
00227     UVES_MKMASTER_SFLAT_ID, UVES_MKMASTER_SFLAT_DOM, 
00228     uves_cal_mkmaster_sflat_define_parameters,
00229     "Jonas M. Larsen", "cpl@eso.org",
00230     "Creates a master flat frame to support FIBER mode data reduction ",
00231     uves_cal_mkmaster_sflat_desc);
00232 
00233 /*-----------------------------------------------------------------------------
00234                               Functions code
00235  -----------------------------------------------------------------------------*/
00237 /*----------------------------------------------------------------------------*/
00243 /*----------------------------------------------------------------------------*/
00244 static int
00245 uves_cal_mkmaster_sflat_define_parameters(cpl_parameterlist *parameters)
00246 {
00247     return uves_mflat_define_parameters_body(parameters, 
00248                          make_str(UVES_MKMASTER_SFLAT_ID));
00249 }
00250 
00251 /*----------------------------------------------------------------------------*/
00259 /*----------------------------------------------------------------------------*/
00260 static void
00261 IRPLIB_CONCAT2X(UVES_MKMASTER_SFLAT_ID,exe)(cpl_frameset *frames,
00262                       const cpl_parameterlist *parameters,
00263                       const char *starttime)
00264 {
00265     uves_mflat_exe_body(frames, parameters, starttime,
00266             make_str(UVES_MKMASTER_SFLAT_ID));
00267     return;
00268 }

Generated on Tue Jun 19 14:39:15 2007 for UVES Pipeline Reference Manual by  doxygen 1.4.6