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: amodigli $ 00022 * $Date: 2010/09/24 09:32:07 $ 00023 * $Revision: 1.13 $ 00024 * $Name: uves-5_0_0 $ 00025 * $Log: uves_physmod_plotmod.c,v $ 00026 * Revision 1.13 2010/09/24 09:32:07 amodigli 00027 * put back QFITS dependency to fix problem spot by NRI on FIBER mode (with MIDAS calibs) data 00028 * 00029 * Revision 1.11 2008/09/29 06:56:23 amodigli 00030 * add #include <string.h> 00031 * 00032 * Revision 1.10 2007/10/15 11:10:55 amodigli 00033 * fixed bug on reported chip ID in physmod plots 00034 * 00035 * Revision 1.9 2007/06/06 08:17:33 amodigli 00036 * replace tab with 4 spaces 00037 * 00038 * Revision 1.8 2007/04/26 06:54:43 amodigli 00039 * small changes on title 00040 * 00041 * Revision 1.7 2007/04/25 08:38:03 amodigli 00042 * changed interface and plotting more info 00043 * 00044 * Revision 1.6 2007/01/15 08:43:15 jmlarsen 00045 * Fixed missing plots 00046 * 00047 * Revision 1.5 2007/01/13 09:52:22 amodigli 00048 * fixed some problems on flames QC log 00049 * 00050 * Revision 1.4 2006/11/06 15:19:41 jmlarsen 00051 * Removed unused include directives 00052 * 00053 * Revision 1.3 2006/07/28 14:51:26 amodigli 00054 * fixed some bugs on improper table selection 00055 * 00056 * Revision 1.2 2006/06/20 10:56:56 amodigli 00057 * cleaned output, added units 00058 * 00059 * Revision 1.1 2006/02/03 07:46:30 jmlarsen 00060 * Moved recipe implementations to ./uves directory 00061 * 00062 * Revision 1.5 2006/01/19 08:47:24 jmlarsen 00063 * Inserted missing doxygen end tag 00064 * 00065 * Revision 1.4 2006/01/09 14:05:42 amodigli 00066 * Fixed doxigen warnings 00067 * 00068 * Revision 1.3 2005/12/20 08:11:44 jmlarsen 00069 * Added CVS entry 00070 * 00071 */ 00072 00073 /*----------------------------------------------------------------------------*/ 00077 /*----------------------------------------------------------------------------*/ 00079 #ifdef HAVE_CONFIG_H 00080 # include <config.h> 00081 #endif 00082 00083 00084 /*----------------------------------------------------------------------------- 00085 Includes 00086 -----------------------------------------------------------------------------*/ 00087 #include <uves_physmod_plotmod.h> 00088 00089 #include <uves_plot.h> 00090 #include <uves_msg.h> 00091 #include <uves_error.h> 00092 #include <string.h> 00093 /*----------------------------------------------------------------------------- 00094 Defines 00095 -----------------------------------------------------------------------------*/ 00096 /*----------------------------------------------------------------------------- 00097 Functions prototypes 00098 ----------------------------------------------------------------------------*/ 00099 /*----------------------------------------------------------------------------- 00100 Static variables 00101 -----------------------------------------------------------------------------*/ 00102 00103 /*----------------------------------------------------------------------------- 00104 Functions code 00105 -----------------------------------------------------------------------------*/ 00106 00107 /*----------------------------------------------------------------------------*/ 00119 /*----------------------------------------------------------------------------*/ 00120 00121 int 00122 uves_physmod_plotmod(const cpl_table* tbl, 00123 const uves_propertylist* head, 00124 const char* rec_id, 00125 const cpl_parameterlist* params, 00126 enum uves_chip chip) 00127 { 00128 00129 char title[300]; 00130 double ech_ang_off=0; 00131 double cd_ang_off=0; 00132 double ccd_ang_off=0; 00133 double wcent=0; 00134 double temp_cam=0; 00135 double slit_width=0; 00136 double slit_length=0; 00137 const char* origfile=NULL; 00138 const char* tpl_start=NULL; 00139 char chip_id[5]; 00140 00141 strcpy(chip_id,uves_chip_tostring_lower(chip)); 00142 00143 check( uves_get_parameter(params, NULL,rec_id,"ech_angle_off", 00144 CPL_TYPE_DOUBLE, &ech_ang_off ) , "Could not read parameter"); 00145 00146 check( uves_get_parameter(params, NULL, rec_id, "cd_angle_off", 00147 CPL_TYPE_DOUBLE, &cd_ang_off ) , "Could not read parameter"); 00148 00149 check( uves_get_parameter(params, NULL, rec_id, "ccd_rot_angle_off", 00150 CPL_TYPE_DOUBLE, &ccd_ang_off ) , "Could not read parameter"); 00151 00152 check (wcent = uves_pfits_get_gratwlen(head, chip), 00153 "Could not read central wavelength setting from input header"); 00154 00155 check (temp_cam = uves_pfits_get_tempcam(head,chip), 00156 "Could not read camera's temperature from input header"); 00157 00158 check (slit_width = uves_pfits_get_slitwidth(head, chip), 00159 "Could not read slit width input header"); 00160 00161 check (slit_length = uves_pfits_get_slitlength(head, chip), 00162 "Could not read slit length input header"); 00163 00164 check(tpl_start=uves_pfits_get_tpl_start(head),"Error getting TPL START"); 00165 00166 check(origfile=uves_pfits_get_origfile(head),"Error getting ORIGFILE"); 00167 00168 sprintf(title,"%s %4.1f %s %2.1f %s %s %3.1f %s ", 00169 "Central wavelength: ",wcent, 00170 " nm, slit: ",slit_length, 00171 " arcsec, CCD:",chip_id,temp_cam," C"); 00172 00173 00174 /* 1st plot */ 00175 check(uves_plot_table(tbl, "XMOD", "XDIF", title), 00176 "Plotting failed"); 00177 00178 /* 2nd plot */ 00179 check(uves_plot_table(tbl, "XMOD", "YDIF", title), 00180 "Plotting failed"); 00181 00182 00183 /* 3rd plot */ 00184 check(uves_plot_table(tbl, "YMOD", "XDIF", title), 00185 "Plotting failed"); 00186 00187 00188 /* 4th plot */ 00189 check(uves_plot_table(tbl, "YMOD", "YDIF", title), 00190 "Plotting failed"); 00191 00192 00193 /* 5th plot */ 00194 check(uves_plot_table(tbl, "XDIF", "YDIF", title), 00195 "Plotting failed"); 00196 00197 00198 /* 6th plot */ 00199 check(uves_plot_table(tbl, "XMOD", "YMOD", title), 00200 "Plotting failed"); 00201 00202 cleanup: 00203 return 0; 00204 }