irplib_detmon.h

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

Generated on 8 Mar 2011 for SINFONI Pipeline Reference Manual by  doxygen 1.6.1