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

Generated on Thu Nov 15 14:32:29 2007 for UVES Pipeline Reference Manual by  doxygen 1.5.1