uves_qclog.h

00001 /*
00002  * This file is part of the UVES Pipeline
00003  * Copyright (C) 2002, 2003, 2004, 2005 European Southern Observatory
00004  *
00005  * This program 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: amodigli $
00022  * $Date: 2007/06/06 08:17:33 $
00023  * $Revision: 1.21 $
00024  * $Name: uves-3_3_1 $
00025  * $Log: uves_qclog.h,v $
00026  * Revision 1.21  2007/06/06 08:17:33  amodigli
00027  * replace tab with 4 spaces
00028  *
00029  * Revision 1.20  2007/04/24 14:09:29  jmlarsen
00030  * Removed obsolete log_slitwidth option to uves_qclog_add_common_wave()
00031  *
00032  * Revision 1.19  2007/04/24 12:50:29  jmlarsen
00033  * Replaced cpl_propertylist -> uves_propertylist which is much faster
00034  *
00035  * Revision 1.18  2007/02/26 10:16:42  jmlarsen
00036  * Support not logging slit width
00037  *
00038  * Revision 1.17  2007/01/29 12:11:02  jmlarsen
00039  * Log QC parameters (pos, fwhm, s/n) also for simple extraction
00040  *
00041  * Revision 1.16  2007/01/26 12:33:57  amodigli
00042  * added function for common QC
00043  *
00044  * Revision 1.15  2006/12/07 08:26:21  jmlarsen
00045  * Added uves_pfits_get_readspeed
00046  *
00047  * Revision 1.14  2006/12/01 12:28:18  jmlarsen
00048  * Added function to create QC parameter names
00049  *
00050  * Revision 1.13  2006/10/04 10:59:04  jmlarsen
00051  * Implemented QC.VRAD parameters
00052  *
00053  * Revision 1.12  2006/10/02 08:35:01  jmlarsen
00054  * const bugfix
00055  *
00056  * Revision 1.11  2006/09/19 14:32:43  jmlarsen
00057  * Factored out common code to compute extraction QC parameters
00058  *
00059  * Revision 1.10  2006/08/24 11:38:32  jmlarsen
00060  * Write QC dictionary ID to product header
00061  *
00062  * Revision 1.9  2006/07/14 12:28:02  jmlarsen
00063  * Added function to write common QC parameters
00064  *
00065  * Revision 1.8  2006/06/28 13:27:50  amodigli
00066  * Fixed problem dumping ARCFILE key changing uves_save_paf interface
00067  *
00068  * Revision 1.7  2006/06/22 08:58:33  jmlarsen
00069  * Use correct port number for QC
00070  *
00071  * Revision 1.6  2006/05/05 13:55:45  jmlarsen
00072  * Removed lone CPL_END_DECLS
00073  *
00074  */
00075 
00076 #ifndef UVES_QCLOG_H
00077 #define UVES_QCLOG_H
00078 
00079 #include <uves_propertylist.h>
00080 #include <uves_chip.h>
00081 
00082 #include <cpl.h>
00083 
00084 #include <stdbool.h>
00085 
00086 #define KEY_NAME_PRO_REC1_RAW1_NAME        "ESO PRO REC1 RAW1 NAME"
00087 
00088 #define KEY_NAME_PRO_DRSID                 "ESO PRO REC1 DRS ID"
00089 #define PAF_NAME_PRO_DRSID                 "PRO REC1 DRS ID"
00090 #define KEY_HELP_PRO_DRSID                 "Data Reduction System identifier"
00091 
00092 #define KEY_NAME_PIPE_ID                   "ESO PRO REC1 PIPE ID"
00093 #define PAF_NAME_PIPE_ID                   "PRO REC1 PIPE ID"
00094 #define KEY_HELP_PIPE_ID                   "Pipeline (unique) identifier"
00095 #define KEY_NAME_PIPEFILE                  "PIPEFILE"
00096 #define KEY_HELP_PIPEFILE                  "Filename of data product"
00097 
00098 #define KEY_NAME_QC_DID                    "ESO QC DID"
00099 #define PAF_NAME_QC_DID                    "QC DID"
00100 #define KEY_HELP_QC_DID                    "Data dictionary for QC"
00101 
00102 #define KEY_NAME_PRO_TYPE                  "ESO PRO TYPE"
00103 #define PAF_NAME_PRO_TYPE                  "PRO TYPE"
00104 #define KEY_HELP_PRO_TYPE                  "Product Type"
00105 
00106 #define KEY_NAME_DATE_OBS                  "DATE-OBS"
00107 #define KEY_HELP_DATE_OBS                  "Observing date"
00108 
00109 #define KEY_NAME_PRO_RECID                 "ESO PRO REC1 ID"
00110 #define PAF_NAME_PRO_RECID                 "PRO REC1 ID"
00111 #define KEY_HELP_PRO_RECID                 "Pipeline recipe(unique) identifier"
00112 
00113 #define KEY_NAME_DPR_TYPE                  "ESO DPR TYPE"
00114 #define KEY_NAME_DPR_CATG                  "ESO DPR CATG"
00115 #define KEY_NAME_DPR_TECH                  "ESO DPR TECH"
00116 #define KEY_NAME_PRO_CATG                  "ESO PRO CATG"
00117 #define KEY_NAME_TPL_ID                    "ESO TPL ID"
00118 #define KEY_NAME_ARCFILE                   "ARCFILE"
00119 
00120 #define PAF_NAME_DPR_TYPE                  "DPR TYPE"
00121 #define PAF_NAME_DPR_CATG                  "DPR CATG"
00122 #define PAF_NAME_DPR_TECH                  "DPR TECH"
00123 #define PAF_NAME_PRO_CATG                  "PRO CATG"
00124 #define PAF_NAME_TPL_ID                    "TPL ID"
00125 #define PAF_NAME_PRO_DRSID                 "PRO REC1 DRS ID"
00126 
00127 #define KEY_HELP_DPR_TYPE                  "Observation type"
00128 #define KEY_HELP_DPR_CATG                  "Observation category"
00129 #define KEY_HELP_DPR_TECH                  "Observation technique"
00130 #define KEY_HELP_PRO_CATG                  "Category of pipeline product frame"
00131 #define KEY_HELP_TPL_ID                    "Template sig"
00132 #define KEY_HELP_ARCFILE                   "Archive file name"
00133 #define KEY_HELP_PRO_DRSID                 "Data Reduction System identifier"
00134 #define MAX_NAME_SIZE 255      /* fixme: Is this always enough? */
00135 
00136 #define PORT_ID(chip) (((chip) == UVES_CHIP_REDL) ? 4 : 1)
00137 
00138 char * uves_get_rootname(const char * filename);
00139 void uves_get_paf_name(const char* in, int paf_no, char** paf);
00140 
00141 int uves_blank2dot(const char * in, char* ou);
00142 
00143 int uves_save_paf(const char* filename, 
00144           int paf_no,
00145                   const char* rec_id,  
00146                   const cpl_table* qclog,
00147                   uves_propertylist*   plist,
00148                   const uves_propertylist*   rhead,
00149                   const char*      pro_catg);
00150 
00151 cpl_table *
00152 uves_qclog_init(const uves_propertylist *raw_header,
00153         enum uves_chip chip);
00154 int
00155 uves_qclog_add_int(cpl_table* table,
00156                  const char* name,  
00157                  const int   value,
00158                  const char* help,
00159          const char* format);
00160 
00161 int
00162 uves_qclog_add_bool(cpl_table* table,
00163                  const char* name,  
00164                  const char  value,
00165                  const char* help,
00166          const char* format);
00167 
00168 
00169 int
00170 uves_qclog_add_float(cpl_table* table,
00171                  const char* name,  
00172                  const float value,
00173                  const char* help,
00174          const char* format);
00175 
00176 
00177 int
00178 uves_qclog_add_double(cpl_table* table,
00179                  const char* name,  
00180                  const double value,
00181                  const char* help,
00182          const char* format);
00183 
00184 
00185 int
00186 uves_qclog_add_string(cpl_table* table,
00187                  const char* name,  
00188                  const char* value,
00189                  const char* help,
00190          const char* format);
00191 
00192 
00193 int uves_qclog_delete(cpl_table** table);
00194 
00195 int uves_pfits_put_qc(uves_propertylist * plist, const cpl_table * qclog);
00196 
00197 void uves_qclog_add_sci(cpl_table *qclog,
00198             const uves_propertylist *raw_header,
00199             const cpl_image *raw_image,
00200             double slit,
00201             const cpl_table *info_tbl);
00202 
00203 void 
00204 uves_qclog_add_common_wave(const uves_propertylist *raw_header,
00205                enum uves_chip chip,
00206                cpl_table *qclog);
00207 
00208 const char *
00209 uves_qclog_get_qc_name(const char *name,
00210                bool flames, int trace_number);
00211 
00212 int
00213 uves_qclog_dump_common(const uves_propertylist *plist,
00214                enum uves_chip chip, 
00215                        cpl_table* qclog);
00216 
00217 int
00218 uves_qclog_dump_common_wave(const uves_propertylist *plist,
00219                     enum uves_chip chip, 
00220                             cpl_table* qclog);
00221 
00222 
00223 #endif

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