detmon.h

00001 /* $Id: detmon.h,v 1.2 2011/12/09 07:45:32 amodigli Exp $
00002  *
00003  * This file is part of the irplib package
00004  * Copyright (C) 2002, 2003 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 02111-1307 USA
00019  */
00020 
00021 /*
00022  * $Author: amodigli $
00023  * $Date: 2011/12/09 07:45:32 $
00024  * $Revision: 1.2 $
00025  * $Name: detmon-1_2_0 $
00026  */
00027 
00028 #ifndef IRPLIB_DETMON_H
00029 #define IRPLIB_DETMON_H
00030 
00031 /*----------------------------------------------------------------------------
00032                                    Includes
00033  ----------------------------------------------------------------------------*/
00034 
00035 #include <cpl.h>
00036 #include <detmon_cpl_size.h>
00037 
00038 /*----------------------------------------------------------------------------
00039                                    Prototypes
00040  ----------------------------------------------------------------------------*/
00041 
00042 
00043 #define NIR TRUE
00044 #define OPT FALSE
00045 
00046 #define DETMON_QC_FREQ       "ESO QC FREQ"
00047 #define DETMON_QC_FREQ_C     "Spectrum frequency"
00048 
00049 #define DETMON_QC_POW       "ESO QC POW"
00050 #define DETMON_QC_POW_C     "Spectrum power"
00051 
00052 #define DETMON_QC_DUTYCYCL       "ESO QC DUTYCYCL"
00053 #define DETMON_QC_DUTYCYCL_C     "DUTYCYCL value (time to store a frame)"
00054 
00055 #define DETMON_QC_MASTER_MEAN    "ESO QC MASTER MEAN"
00056 #define DETMON_QC_MASTER_MEAN_C  "Master Mean value"
00057 
00058 #define DETMON_QC_MASTER_RMS    "ESO QC MASTER RMS"
00059 #define DETMON_QC_MASTER_RMS_C  "Master RMS value"
00060 
00061 #define DETMON_QC_NBCOLDPIX    "ESO QC NBCOLPIX"
00062 #define DETMON_QC_NBCOLDPIX_C  "Number of cold pixels"
00063 
00064 #define DETMON_QC_NBHOTPIX    "ESO QC NBHOTPIX"
00065 #define DETMON_QC_NBHOTPIX_C  "Number of hot pixels"
00066 
00067 #define DETMON_QC_NBDEVPIX    "ESO QC NBDEVPIX"
00068 #define DETMON_QC_NBDEVPIX_C  "Number of deviating pixels"
00069 
00070 #define DETMON_QC_BIAS_RANDOM_VAL    "ESO QC BIAS RANDOM VAL"
00071 #define DETMON_QC_BIAS_RANDOM_VAL_C  "Bias level (random sampling method) [ADU]"
00072 
00073 #define DETMON_QC_BIAS_RANDOM_RON    "ESO QC BIAS RANDOM RON"
00074 #define DETMON_QC_BIAS_RANDOM_RON_C  "Bias Read Out Noise (random sampling method) [ADU]"
00075 
00076 #define DETMON_QC_BIAS_HISTO_VAL    "ESO QC BIAS HISTO VAL"
00077 #define DETMON_QC_BIAS_HISTO_VAL_C  "Bias level (histogram method) [ADU]"
00078 
00079 #define DETMON_QC_BIAS_HISTO_RON    "ESO QC BIAS HISTO RON"
00080 #define DETMON_QC_BIAS_HISTO_RON_C  "Bias Read Out Noise (histogram method) [e- rms]"
00081 
00082 #define DETMON_QC_BIAS_PRESCAN_MEAN    "ESO QC BIAS PRESCAN MEAN"
00083 #define DETMON_QC_BIAS_PRESCAN_MEAN_C  "Bias mean level (on prescan region) [ADU]"
00084 
00085 #define DETMON_QC_BIAS_PRESCAN_MED    "ESO QC BIAS PRESCAN MED"
00086 #define DETMON_QC_BIAS_PRESCAN_MED_C  "Bias median level (on prescan region) [ADU]"
00087 
00088 #define DETMON_QC_BIAS_PRESCAN_RON    "ESO QC BIAS PRESCAN RON"
00089 #define DETMON_QC_BIAS_PRESCAN_RON_C  "Bias Read Out Noise (on prescan region) [e- rms]"
00090 
00091 
00092 #define DETMON_QC_BIAS_OVERSCAN_MEAN    "ESO QC BIAS OVERSCAN MEAN"
00093 #define DETMON_QC_BIAS_OVERSCAN_MEAN_C  "Bias mean level (on overscan region) [ADU]"
00094 
00095 #define DETMON_QC_BIAS_OVERSCAN_MED    "ESO QC BIAS OVERSCAN MED"
00096 #define DETMON_QC_BIAS_OVERSCAN_MED_C  "Bias median level (on overscan region) [ADU]"
00097 
00098 #define DETMON_QC_BIAS_OVERSCAN_RON    "ESO QC BIAS OVERSCAN RON"
00099 #define DETMON_QC_BIAS_OVERSCAN_RON_C  "Bias Read Out Noise (on overscan region) [e- rms]"
00100 
00101 #define DETMON_QC_BIAS_REGION_VAL    "ESO QC BIAS REGION VAL"
00102 #define DETMON_QC_BIAS_REGION_VAL_C  "Bias level (on user defined region) [ADU]"
00103 
00104 #define DETMON_QC_BIAS_REGION_MED    "ESO QC BIAS REGION MED"
00105 #define DETMON_QC_BIAS_REGION_MED_C  "Bias median level (on user defined region) [ADU]"
00106 
00107 #define DETMON_QC_BIAS_REGION_RON    "ESO QC BIAS REGION RON"
00108 #define DETMON_QC_BIAS_REGION_RON_C  "Bias Read Out Noise (on user defined region) [e- rms]"
00109 
00110 
00111 #define DETMON_QC_DARK    "ESO QC DARK"
00112 #define DETMON_QC_DARK_C  "Dark level [ADU]"
00113 
00114 #define DETMON_QC_DARK_STDEV    "ESO QC DARK STDEV"
00115 #define DETMON_QC_DARK_STDEV_C  "Dark stdev level [ADU]"
00116 
00117 
00118 
00119 /* Macros to generate the recipe(s) description(s) */
00120 #define detmon_ronbias_get_description(RECIPE_NAME, PIPE_NAME,          \
00121                                               DETMON_RONBIAS_RAW)              \
00122     RECIPE_NAME " -- " PIPE_NAME " ronbias recipe for OPT/IR.\n"            \
00123     "The files listed in the Set Of Frames must be tagged:\n"                  \
00124     "raw-file.fits  "DETMON_RONBIAS_RAW"\n"
00125 
00126 #define detmon_pernoise_get_description(RECIPE_NAME, PIPE_NAME,         \
00127                                               DETMON_PERNOISE_RAW)             \
00128     RECIPE_NAME " -- " PIPE_NAME " Recipe for Periodic Noise Characterisation.\n"            \
00129     "The files listed in the Set Of Frames must be tagged:\n"                  \
00130     "raw-file.fits  "DETMON_PERNOISE_RAW"\n"
00131 
00132 #define detmon_dark_get_description(RECIPE_NAME, PIPE_NAME,         \
00133                                               DETMON_DARK_RAW)             \
00134     RECIPE_NAME " -- " PIPE_NAME " Dark Recipe.\n"            \
00135     "The files listed in the Set Of Frames must be tagged:\n"                  \
00136     "raw-file.fits  "DETMON_DARK_RAW"\n"
00137 
00138 #define RANDOM       ((irplib_ronbias_method) 1 << 1)
00139 #define HISTO        ((irplib_ronbias_method) 1 << 2)
00140 #define PREOVERSCAN  ((irplib_ronbias_method) 1 << 3)
00141 #define REGION       ((irplib_ronbias_method) 1 << 4)
00142 
00143 typedef unsigned long irplib_ronbias_method;
00144 
00145 #undef REGEXP
00146 #define REGEXP "ARCFILE|MJD-OBS|ESO TPL ID|DATE-OBS|ESO DET DIT|ESO DET NDIT"
00147 
00148 #if defined CPL_VERSION_CODE && CPL_VERSION_CODE < CPL_VERSION(4, 2, 0) 
00149 
00150 #define CPL_DFS_PRO_CATG     "ESO PRO CATG"
00151 #define CPL_DFS_PRO_TYPE     "ESO PRO TYPE"
00152 #define CPL_DFS_PRO_SCIENCE  "ESO PRO SCIENCE"
00153 #define CPL_DFS_PRO_TECH     "ESO PRO TECH"
00154 
00155 #endif
00156 
00157 cpl_image * 
00158 irplib_imagelist_collapse_stdev_create(const cpl_imagelist * imlist);
00159 
00160 cpl_error_code
00161 detmon_ronbias(cpl_frameset      *,
00162                       const cpl_parameterlist *,
00163                       const char        *,
00164                       const char        *,
00165                       const char        *,
00166                       const char        *,
00167               const cpl_propertylist *,
00168               const cpl_propertylist *,
00169               const cpl_propertylist *,
00170               const cpl_propertylist *,
00171               const cpl_propertylist *,
00172               const cpl_propertylist *,
00173               const cpl_propertylist *,
00174                       const char        *,
00175                       int              (*)(const cpl_frame *,
00176                                            const cpl_frame *),
00177                       cpl_boolean);
00178 
00179 cpl_propertylist *
00180 detmon_fill_prolist(const char *,
00181                const char *,
00182                const char *,
00183                cpl_boolean);
00184 
00185 cpl_error_code
00186 detmon_ronbias_fill_parlist_default(cpl_parameterlist *,
00187                        const char        *,
00188                        const char        *);
00189 
00190 cpl_error_code
00191 detmon_darkron_fill_parlist_default(cpl_parameterlist *,
00192                        const char        *,
00193                        const char        *);
00194 
00195 cpl_error_code
00196 detmon_ronbias_fill_parlist(cpl_parameterlist *,
00197                    const char *,
00198                    const char *,
00199                    const char *,
00200                    const char *,
00201                    const int,
00202                    const int,
00203                    const int,
00204                    const int,
00205                    const int,
00206                    const int,
00207                    const int,
00208                    const int,
00209                    const int,
00210                    const char *,
00211                    const int,
00212                    const int,
00213                    const int,
00214                    const int,
00215                    const int,
00216                    const int,
00217                    const int,
00218                    const int,
00219                    const int,
00220                    const int,
00221                                    cpl_boolean);
00222 
00223 cpl_error_code
00224 detmon_ronbias_histo_reduce(const cpl_image * c_raw,
00225                    double * bias,
00226                    double * fwhm,
00227                    double * max);
00228 cpl_image *
00229 detmon_build_synthetic(cpl_image *,
00230                               cpl_image *);
00231 
00232 cpl_error_code
00233 irplib_flux_get_bias_window(const cpl_image *,
00234                             const int       *,
00235                             int              ,
00236                             int              ,
00237                             double          *,
00238                             double          *);
00239 
00240 cpl_error_code
00241 detmon_fill_pernoise_params(cpl_parameterlist *,
00242                                    const char *,
00243                                    const char *,
00244                                    int mode,
00245                                    const char *direction,
00246                                    double speed,
00247                                    int llx,
00248                                    int lly,
00249                                    int urx,
00250                                    int ury,
00251                                    double kappa,
00252                                    int exts);
00253 
00254 int detmon_fill_pernoise_params_default(cpl_parameterlist        *,
00255                               const char        *,
00256                               const char        *);
00257 
00258 cpl_error_code
00259 detmon_pernoise(cpl_frameset      *,
00260                       const cpl_parameterlist *,
00261                       const char        *,
00262                       const char        *,
00263                       const char        *,
00264                       const char        *,
00265                       const char        *,
00266                       int              (*)(const cpl_frame *,
00267                                            const cpl_frame *));
00268 
00269 cpl_table *
00270 detmon_pernoise_reduce(cpl_image       *);
00271 
00272 cpl_error_code
00273 detmon_dark(cpl_frameset      *,
00274                    const cpl_parameterlist *,
00275                    const char        *,
00276                    const char        *,
00277                    const char        *,
00278                    const char        *,
00279                    const char        *,
00280                    const char        *,
00281                    const char        *,
00282                    int              (*)(const cpl_frame *,
00283                                         const cpl_frame *));
00284 
00285 cpl_error_code
00286 detmon_fill_dark_params(cpl_parameterlist * parlist,
00287                                const char *recipe_name,
00288                                const char *pipeline_name,
00289                                const char * ron_method,
00290                                const char * dsnu_method,
00291                                const char * optnir,
00292                                int exts);
00293 
00294 int
00295 detmon_fill_dark_params_default(cpl_parameterlist * parlist,
00296                                        const char *recipe_name,
00297                                        const char *pipeline_name);
00298 
00299 int
00300 detmon_compare_dits(const cpl_frame *, const cpl_frame *);
00301 
00302 double                  irplib_pfits_get_exptime(const cpl_propertylist *);
00303 
00304 cpl_error_code
00305 detmon_fill_parlist(cpl_parameterlist *,
00306                            const char *, const char *, int, ...);
00307 
00308 int
00309 detmon_retrieve_par_int(const char *,
00310                             const char *,
00311                             const char *, const cpl_parameterlist *);
00312 
00313 double
00314 detmon_retrieve_par_double(const char *,
00315                             const char *,
00316                             const char *, const cpl_parameterlist *);
00317 
00318 
00319 #endif

Generated on 7 Mar 2012 for DETMON Pipeline Reference Manual by  doxygen 1.6.1