uves_physmod_utils.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  * $Id: uves_physmod_utils.c,v 1.15 2007/06/06 08:17:33 amodigli Exp $
00021  * $Name: uves-3_3_1 $
00022  * $Revision: 1.15 $
00023  * $Log: uves_physmod_utils.c,v $
00024  * Revision 1.15  2007/06/06 08:17:33  amodigli
00025  * replace tab with 4 spaces
00026  *
00027  * Revision 1.14  2006/11/06 15:19:41  jmlarsen
00028  * Removed unused include directives
00029  *
00030  * Revision 1.13  2006/08/23 15:41:06  amodigli
00031  * removed warning from checks on line length
00032  *
00033  * Revision 1.12  2006/08/23 09:33:03  jmlarsen
00034  * Renamed local variables shadowing POSIX reserved names
00035  *
00036  * Revision 1.11  2006/06/20 10:56:56  amodigli
00037  * cleaned output, added units
00038  *
00039  * Revision 1.10  2006/06/20 08:40:57  amodigli
00040  * fixed doxigen warnings
00041  *
00042  * Revision 1.9  2006/06/08 11:01:50  amodigli
00043  * fixed some warnings
00044  *
00045  * Revision 1.8  2006/06/07 12:50:44  jmlarsen
00046  * Removed doxygen tag addtogroup
00047  *
00048  * Revision 1.7  2006/06/07 12:45:19  jmlarsen
00049  * Added missing doxygen endmarker
00050  *
00051  * Revision 1.6  2006/06/05 08:51:55  amodigli
00052  * cleaned some warnings from static checks
00053  *
00054  * Revision 1.5  2006/06/01 14:43:17  jmlarsen
00055  * Added missing documentation
00056  *
00057  * Revision 1.4  2006/06/01 14:26:14  amodigli
00058  * fixed typo
00059  *
00060  * Revision 1.3  2006/06/01 14:22:07  amodigli
00061  * added Doxigen doc
00062  *
00063  * Revision 1.2  2006/04/24 09:22:16  jmlarsen
00064  * Added doxygen tag: addtogroup
00065  *
00066  * Revision 1.1  2006/02/03 07:46:30  jmlarsen
00067  * Moved recipe implementations to ./uves directory
00068  *
00069  * Revision 1.18  2006/01/05 14:29:59  jmlarsen
00070  * Removed newline characters from output strings
00071  *
00072  * Revision 1.17  2005/12/05 16:11:47  amodigli
00073  * Fixed some warning
00074  *
00075  * Revision 1.16  2005/12/02 12:56:09  amodigli
00076  * Fixed compilation problems on mac
00077  *
00078  * Revision 1.15  2005/11/28 15:36:34  amodigli
00079  * Renamed global variables and global function with prefix uves_physmod
00080  *
00081  * Revision 1.14  2005/11/28 08:37:27  amodigli
00082  * Fixed compilation warnings
00083  *
00084  * Revision 1.13  2005/11/25 08:05:15  amodigli
00085  *  Added plotting facility in physmod. Commented out some strange things in utils.
00086  *
00087  * Revision 1.12  2005/11/18 11:49:22  amodigli
00088  * More verbosity
00089  *
00090  * Revision 1.11  2005/11/17 08:25:49  amodigli
00091  * Removed uves_necregr.c
00092  *
00093  * Revision 1.10  2005/10/19 13:18:43  jmlarsen
00094  * General update
00095  *
00096  * Revision 1.9  2005/10/18 10:08:01  amodigli
00097  * Removed fctid
00098  *
00099  * Revision 1.8  2005/10/07 11:17:35  amodigli
00100  * Cleaned compilation warnings
00101  *
00102  * Revision 1.7  2005/10/03 07:32:44  amodigli
00103  * Fixed bugs to support RED CCD
00104  *
00105  * Revision 1.6  2005/09/28 12:28:14  jmlarsen
00106  * Replaced fctid -> __func__
00107  *
00108  * Revision 1.5  2005/09/18 14:24:10  amodigli
00109  * Updated
00110  *
00111  * Revision 1.4  2005/08/29 10:05:08  jmlarsen
00112  * Conversion to/from electrons when calculating photonic noise
00113  *
00114  * Revision 1.3  2005/08/29 08:27:58  amodigli
00115  * Put into repository updates on physical model
00116  *
00117  * Revision 1.2  2005/06/17 12:02:04  amodigli
00118  * Fixed compilation problem
00119  *
00120  * Revision 1.1  2005/06/17 11:34:34  amodigli
00121  * First release
00122  *
00123  *
00124  * ===========================================================================
00125  */
00126 /*----------------------------------------------------------------------------*/
00130 /*----------------------------------------------------------------------------*/
00131 
00132 #ifdef HAVE_CONFIG_H
00133 #  include <config.h>
00134 #endif
00135 
00136 /*+++ uves_physmod_utils.c +++++++++++++++++++++++++++++++++++++++++++++++++++
00137  
00138  .COPYRIGHT    (C) 1998  European Southern Observatory
00139  
00140  .IDENT        
00141  
00142  .KEYWORDS    uves physical model, spectroscopy, echelle,
00143  
00144  .USAGE        .
00145  
00146  .INPUT        .
00147         
00148  .OUTPUT    .
00149  
00150  .RETURN    Q1:  0: successful return
00151              -1: a successful return failed
00152  
00153  .PURPOSE    Library of UVES Physical Model Functions. 
00154  
00155  .ALGORITHM    UVES Physical Model.
00156 
00157  .ENVIRON    MIDAS, UVES context
00158     
00159  .LANGUAGE    C
00160  
00161  .AUTHOR    Pascal Ballester, Olivier BOITQUIN, ESO-DMD
00162  
00163  .VERSION    1.0 1999/07/01      Creation
00164                     1999/09/30-SW Binning implemented.
00165             1999/10/27-OB Bugs with n index fixed.
00166 
00167  .COMMENT       
00168 ----------------------------------------------------------------------------*/
00169 
00170 
00171 /*-----------------------------------------------------------------------------
00172                             Includes
00173  -----------------------------------------------------------------------------*/
00174 #include <uves_physmod_utils.h>
00175 
00176 #include <uves_utils.h>
00177 #include <uves_utils_wrappers.h>
00178 #include <uves_error.h>
00179 #include <uves_msg.h>
00180 
00181 #include <cpl.h>
00182 
00183 #include <stdio.h>
00184 #include <math.h>
00185 
00186 /*-----------------------------------------------------------------------------
00187                             Functions prototypes
00188  -----------------------------------------------------------------------------*/
00189 static void 
00190 beta2lamb(double uves_beta_ech, double uves_beta_cd, double* plambda, int m);
00191 
00192 static double 
00193 cameraFocal(double lm);
00194 
00195 static void 
00196 uves_physmod_find_alpha_beta(double lm, 
00197                              int m, 
00198                              double k, 
00199                              double theta, 
00200                              double *alpha, 
00201                              double *beta);
00202 
00203 static double 
00204 uves_physmod_find_lambda(double k, double alpha, double beta);
00205 
00206 static double 
00207 uves_physmod_find_order_lambda(double k, double alpha, double beta);
00208 /* not used:
00209 static void 
00210 uves_physmod_lambda_model(double* plambda, 
00211                           int m, 
00212                           double fc, 
00213                           double x, 
00214                           double y);
00215 */
00216 static void 
00217 uves_physmod_lambda_order_beta(double* plambda, 
00218                                int* pm, 
00219                                double x, 
00220                                double y, 
00221                                double* puves_beta_ech, 
00222                                double* puves_beta_cd);
00223 
00224 static void 
00225 uves_physmod_lambda_order_focus_model(double* plambda, 
00226                                       double* pdm, 
00227                                       double fc, 
00228                                       double x, 
00229                                       double y);
00230 
00231 static double uves_physmod_wave_bin(double l, int m);
00232 
00233 static void uves_physmod_xy2beta(double* puves_beta_ech, 
00234                                  double* puves_beta_cd, 
00235                                  double fc, 
00236                                  double x, 
00237                                  double y);
00238 
00239 static void uves_physmod_set_binning(float binx, float biny);
00240 
00241 static double dsqrarg;
00242 
00243 /*-----------------------------------------------------------------------------
00244                                 Defines
00245  -----------------------------------------------------------------------------*/
00246 
00247 #define DSQR(a) ((dsqrarg=(a)) == 0.0 ? 0.0 : dsqrarg*dsqrarg)
00248 
00249 #define     PROID "physmod.c" 
00250 
00251 
00252 
00253 
00254 enum uves_arm_ident {UVES_ARM_UNDEF,UVES_ARM_BLUE,UVES_ARM_RED};
00255 enum uves_arm_ident uves_arm_ident = UVES_ARM_UNDEF;
00256 
00257 
00258 /* for messout function: no "static" (clear) -
00259    no "extern" (otherwise redeclaration in all files neccessary) */
00260 
00261 /* globals declared as extern in physmod.h */
00262 
00263 float    uves_bin[2]      = {1, 1}; /* binning of exposure in x and y */
00264 static double   uves_physmod_pix_size[2]  = {15e-6, 15e-6}; /* meters */
00265 static double   delta[2]  = {75.04, 76.0};
00266 
00267 static double   cdgroov[4]  = {1000.0e-6, 660.0e-6, 600.0e-6, 312.5e-6};  /* grooves/nm */
00268 static double   uves_ech_groov[2] = {31.6e-6,  41.59e-6};  /* grooves/nm */
00269 /*double   uves_ech_blaze[2]  = {75.04, 75.9};  degrees */
00270 /*double   uves_ech_blaze[2]  = {74.74,  76.1};*/
00271 static double   uves_ech_blaze[2]  = {74.57, 75.9}; /* degrees */
00272 /*double   cdbeam[2]   = {45.336,  45.0};  degrees */
00273 /*double   cdbeam[2]   = {45.336,  45.9};*/
00274 /*double   cdbeam[2]   = {45.336,  45.0};  degrees */
00275 static double   cdbeam[2]   = {45.336,  46.0}; /* degrees */
00276 /*double   uves_ccd_rot[2]   = {0.7, -0.45};  degrees */
00277 /*double   uves_ccd_rot[2]   = {-1.0,  -1.50}; */
00278 /*double   uves_ccd_rot[2]   = {0.2, -0.45};   degrees */
00279 double   uves_ccd_rot[2]   = {0.3, -0.55};   /* degrees old */
00280 /* blue detector upgrade 2004-10-13 */
00281 /* double   uves_ccd_rot[2]   = {0.3, -0.10}; degrees  new */
00282 static int      imsize[2]   = {4096, 3000}; /* pixels */
00283 static int      uves_physmod_row_size[2]   = {2048, 2048}; /* pixels */
00284 
00285 /* Configurations 
00286    1:Blue CD1,     2:Blue CD2, 
00287    3:Red CD 3 EEV, 4:Red CD 4 EEV, 
00288    5:Red CD3 MIT,  6: Red CD4 MIT 
00289 */
00290 
00291 /* old */
00292 double uves_physmod_offsetx[6]={1391.0,1385.0,1852.0,1835.0,1852.0,1834.0};
00293 double uves_physmod_offsety[6]={1030.0,1025.0,2098.0,2104.0,-52.0,-49.0}; 
00294 
00295 /* blue detector upgrade 2004-10-13 */
00296 /* double uves_physmod_offsetx[6]={1355.0,1350.0,1852.0,1835.0,1852.0,1834.0}; new */
00297 /* double uves_physmod_offsety[6]={1030.0,1023.0,2098.0,2104.0,-52.0,-49.0}; new */
00298 
00299 static double   flipx       = 1.; 
00300 static double   flipy       = -1.;
00301 double   uves_airt        = 25;  /* Celsius */
00302 double   uves_airp        = 760; /* mmHg */
00303 double   uves_airw        = 3;   /* mmHg */
00304 
00305 int      uves_cfg_indx     = 0; 
00306 int      uves_x_disp_id     = 0;
00307 static int      uves_ech_id       = 0;
00308 double   uves_alpha0_cd, uves_beta0_cd;
00309 char     uves_arm_id       = 'x';
00310 
00311 static double   uves_deg2rad     = M_PI/180.;
00312 
00313 /* For history, please keep track HERE of the previous offset used: 
00314 Garching 1: 
00315 double uves_physmod_offsetx[6]={1470.0,1450.0,2130.0,2140.0,2130.0,2140.0}; 
00316 double uves_physmod_offsetx[6]={1515.0,1514.0,2010.0,2000.0,2010.0,2000.0};
00317  
00318 Comissioning 1: 
00319 double uves_physmod_offsetx[6]={1474.0,1471.0,1960.0,1948.0,1961.0,1949.0}; 
00320 
00321 Comissioning 2, Dec 2000:
00322 double uves_physmod_offsetx[6]={1390.0,1386.0,1849.0,1840.0,1854.0,1840.0};
00323  
00324 Paranal 2, Feb 2000: 
00325 double uves_physmod_offsetx[6]={1390.0,1384.0,1851.0,1840.0,1851.0,1839.0}; 
00326 
00327 Garching 1: 
00328 double uves_physmod_offsety[6]={1030.0,1030.0,2020.0,2020.0,-125.0,-115.0}; 
00329 double uves_physmod_offsety[6]={1029.0,1025.0,2072.0,2080.0,-74.0,-65.0}; 
00330 
00331 Comissioning 1: 
00332 double uves_physmod_offsety[6]={1027.0,1024.0,2069.0,2077.0,-74.0,-65.0};
00333 
00334 Comissioning 2, Dec 2000: 
00335 double uves_physmod_offsety[6]={1027.0,1025.0,2084.0,2094.0,-65.0,-54.0}; 
00336 
00337 Paranal 2, Feb 2000:
00338 double uves_physmod_offsety[6]={1030.0,1025.0,2088.0,2094.0,-57.0,-54.0}; 
00339 
00340 The gap between the EEV and MIT chips is estimated to 95 pixels */
00341 /*
00342 Mean pixel-scales for the 6 configurations: 
00343    pixscale : 0.252396, 0.246, 0.182, 0.175266, 0.182, 0.175266 */
00344  
00345 /*---------------------------------------------------------------------*/
00346 
00347 
00359 void 
00360 uves_physmod_set_incidence(double echred, 
00361                            double echblue, 
00362                            double xred, 
00363                            double xblue)
00364 {
00365      uves_ech_blaze[0] += echred;
00366      uves_ech_blaze[1] += echblue;
00367      cdbeam[0]  += xred;
00368      cdbeam[1]  += xblue;
00369      uves_msg_debug("uves_ech_blaze=%f,%f ccdbeam=%f,%f",
00370                    uves_ech_blaze[0],uves_ech_blaze[1],cdbeam[0],cdbeam[1]);
00371 }
00372 
00379 void 
00380 uves_set_ccd_rot(double* ccdrot, 
00381                  double uves_ccd_rot_off_red, 
00382                  double uves_ccd_rot_off_blue)
00383 {
00384   uves_ccd_rot[0] =ccdrot[0];
00385   uves_ccd_rot[1] =ccdrot[1];
00386 
00387   uves_ccd_rot[0] += uves_ccd_rot_off_red;
00388   uves_ccd_rot[1] += uves_ccd_rot_off_blue;
00389 
00390   uves_msg_debug("uves_ccd_rot[0,1]=%f,%f uves_ccd_rot_off: red,blue=%f,%f",
00391   uves_ccd_rot[0],uves_ccd_rot[1],uves_ccd_rot_off_red,uves_ccd_rot_off_blue);
00392 
00393 }
00394 
00404 void 
00405 uves_physmod_set_offset(double offset_x, 
00406                         double offset_y,
00407                         double uves_physmod_x_off, 
00408                         double yoff)
00409 {
00410   uves_physmod_offsetx[uves_cfg_indx-1]=offset_x;
00411   uves_physmod_offsety[uves_cfg_indx-1]=offset_y;
00412 /*
00413   uves_msg("offset_x=%f offset_y=%f",offset_x,offset_y);
00414      uves_msg("uves_physmod_offsetx=%f 
00415                uves_physmod_offsety=%f 
00416                uves_physmod_x_off=%f 
00417                yoff=%f",
00418            uves_physmod_offsetx[uves_cfg_indx-1],
00419                uves_physmod_offsety[uves_cfg_indx-1],
00420                uves_physmod_x_off,
00421                yoff);
00422 */
00423      uves_physmod_offsetx[uves_cfg_indx-1] += uves_physmod_x_off;
00424      uves_physmod_offsety[uves_cfg_indx-1] += yoff;
00425      /*
00426      uves_msg("uves_physmod_offsetx=%f 
00427                uves_physmod_offsety=%f 
00428                uves_physmod_x_off=%f 
00429                yoff=%f",
00430            uves_physmod_offsetx[uves_cfg_indx-1],
00431                uves_physmod_offsety[uves_cfg_indx-1],
00432                uves_physmod_x_off,
00433                yoff);
00434      */
00435 }
00436 
00437 
00444 void uves_physmod_set_binning(float binx, float biny)
00445 {
00446   uves_bin[0] = binx;
00447   uves_bin[1] = biny;
00448 }
00449 
00450 
00461 void uves_air_config(double p, double t, double w)
00462 {
00463     uves_airt = t;
00464     uves_airp = p;
00465     uves_airw = w;
00466     uves_msg_debug("uves_airt=%f uves_airp=%f uves_airw=%f",
00467                     uves_airt,uves_airp,uves_airw);
00468 }
00469 
00474 double uves_air_index(double lambda)
00475 {
00476    /* wavelength is expected in nanometers. */
00477    double t1, t2, t3, airdx;
00478  
00479    t1 = 1.0e-6/lambda/lambda;  /* 1e-6 for nm to um conversion, squared */
00480 
00481    t2 = (64.328+29498.1/(146.0-t1)+255.4/(41.0-t1))*uves_airp*
00482                (1.0+1.0e-6*(1.049-0.0157*uves_airt)*uves_airp)/
00483                (720.883*(1.0+0.003661*uves_airt));
00484 
00485    t3 = t2 - uves_airw*(0.0624 - 0.000680*t1)/(1+0.003661*uves_airt);
00486 
00487    airdx = 1.0+ t3*1.0e-6;
00488    /*   airdx = 1.0; */
00489    /*
00490    uves_msg_debug("uves_airt=%f uves_airp=%f uves_airw=%f",
00491                    uves_airt,uves_airp,uves_airw);
00492    uves_msg_debug("lambda=%f t1=%g t2=%g t3=%g airdx=%g",
00493                   lambda,t1,t2,t3,airdx);
00494    */
00495    return(airdx);
00496 }
00497 
00498 
00508 void 
00509 uves_physmod_find_alpha_beta(double lm, 
00510                              int m, 
00511                              double k, 
00512                              double theta, 
00513                              double *alpha, 
00514                              double *beta)
00515 {
00516 
00517  /* Solves sin(alpha) + sin(beta) = m*k*lm, given beta - alpha = theta */
00518  uves_msg_debug("lm, m, k, theta : %f %d %f %f",lm,m,k,theta);
00519 
00520  lm /= uves_air_index(lm);
00521 
00522  *alpha = 0.5* ( 2*asin( m*k*lm/2/cos(theta*uves_deg2rad/2) ) + 
00523                  theta*uves_deg2rad );
00524  *beta  = 0.5* ( 2*asin( m*k*lm/2/cos(theta*uves_deg2rad/2) ) - 
00525                  theta*uves_deg2rad );
00526  *alpha /= uves_deg2rad;
00527  *beta  /= uves_deg2rad;
00528 }
00529 
00545 int  
00546 uves_config(char uves_arm, 
00547             char uves_ccd_id, 
00548             int disp, 
00549             double waveCent, 
00550             float binx, 
00551             float biny)
00552 {
00553 
00554   int cfg = 0;
00555   uves_ech_id   = 2;
00556   uves_x_disp_id = disp;
00557   uves_arm_id   = uves_arm;
00558   
00559 /*  uves_msg("Configuring: 
00560               Arm %c 
00561               CCD %c  
00562               Xdisp %d 
00563               Wave %f",
00564               uves_arm,
00565               uves_ccd_id,
00566               disp,
00567               waveCent); 
00568 */
00569   uves_msg_debug("Cfg: Arm %c CCD %c  Xdisp %d Wave %f",
00570                   uves_arm,uves_ccd_id,disp,waveCent);
00571 
00572   if (uves_arm == 'b' && disp == 1)  cfg = 1;
00573   if (uves_arm == 'b' && disp == 2)  cfg = 2;
00574 
00575   if (uves_arm == 'r' && disp == 3) {
00576           uves_ech_id  = 1;
00577           if (uves_ccd_id == 'e') cfg = 3;
00578           if (uves_ccd_id == 'm') cfg = 5;
00579   }
00580   if (uves_arm == 'r' && disp == 4) {
00581           uves_ech_id  = 1;
00582           if (uves_ccd_id == 'e') cfg = 4;
00583           if (uves_ccd_id == 'm') cfg = 6;
00584   }
00585 
00586   if (cfg == 0) {
00587     cpl_msg_error(__func__,"Wrong configuration!");
00588     return -1;
00589   }
00590 
00591   uves_cfg_indx = cfg;
00592 
00593   (void) uves_physmod_set_binning(binx, biny);
00594   (void) uves_physmod_find_alpha_beta(waveCent, 1, cdgroov[uves_x_disp_id-1], 
00595                      cdbeam[uves_ech_id-1], &uves_alpha0_cd, &uves_beta0_cd); 
00596 
00597 
00598   uves_msg_debug("alpha, beta for Xdisp: %f %f\nin config %d and CCD-ID %c",
00599                  uves_alpha0_cd, uves_beta0_cd,cfg, uves_ccd_id);
00600   
00601   return(cfg);
00602 
00603 }
00613 int  
00614 uves_config_cpl_new(int uves_arm,
00615                     int upper, 
00616                     int disp, 
00617                     double waveCent, 
00618                     float binx, 
00619                     float biny)
00620 {
00621   int cfg = 0;
00622   uves_ech_id   = 2;
00623   uves_x_disp_id = disp;
00624   
00625 /*  uves_msg("Configuring: 
00626               Arm %c 
00627               CCD %c  
00628               Xdisp %d 
00629               Wave %f",
00630               uves_arm,
00631               uves_ccd_id,
00632               disp,
00633               waveCent); 
00634 */
00635   uves_msg_debug("New Cfg: Arm [b/r] %d CCD eev/mit %d  Xdisp %d Wave %f",
00636                   uves_arm,upper,disp,waveCent);
00637 
00638   if (uves_arm == ARM_BLUE && disp == 1)  cfg = 1;
00639   if (uves_arm == ARM_BLUE && disp == 2)  cfg = 2;
00640 
00641   if (uves_arm == ARM_RED && disp == 3) {
00642           uves_ech_id  = 1;
00643           if (upper == 0) cfg = 3;
00644           if (upper == 1) cfg = 5;
00645   }
00646   if (uves_arm == ARM_RED && disp == 4) {
00647           uves_ech_id  = 1;
00648           if (upper == 0) cfg = 4;
00649           if (upper == 1) cfg = 6;
00650   }
00651 
00652   if (cfg == 0) {
00653     cpl_msg_error(__func__,"Wrong configuration!");
00654     return -1;
00655   }
00656 
00657   uves_cfg_indx = cfg;
00658 
00659   (void) uves_physmod_set_binning(binx, biny);
00660   (void) uves_physmod_find_alpha_beta(waveCent, 1, cdgroov[uves_x_disp_id-1], 
00661                     cdbeam[uves_ech_id-1], &uves_alpha0_cd, &uves_beta0_cd); 
00662 
00663   /*
00664   uves_msg_debug("alpha, beta for Xdisp: %f %f\nin config %d and CCD-ID %c",
00665                  uves_alpha0_cd, uves_beta0_cd,cfg, uves_ccd_id);
00666   */
00667   return(cfg);
00668 
00669 }
00670 
00689 int  
00690 uves_config_cpl(int blue, 
00691                 int upper, 
00692                 int disp, 
00693                 double waveCent, 
00694                 float binx, 
00695                 float biny)
00696 {
00697 
00698 
00699   int cfg = 0;
00700   uves_ech_id   = 2;
00701   uves_x_disp_id = disp;
00702   
00703 /*  uves_msg("Configuring: 
00704               Arm %c 
00705               CCD %c  
00706               Xdisp %d 
00707               Wave %f",
00708               uves_arm,
00709               uves_ccd_id,
00710               disp,
00711               waveCent); 
00712 */
00713   uves_msg_debug("Cfg cpl: Arm [b/r] %d CCD eev/mit %d  Xdisp %d Wave %f",
00714                   blue,upper,disp,waveCent);
00715 
00716   if (blue == 1 && disp == 1)  cfg = 1;
00717   if (blue == 1 && disp == 2)  cfg = 2;
00718 
00719   if (blue == 0 && disp == 3) {
00720           uves_ech_id  = 1;
00721           if (upper == 0) cfg = 3;
00722           if (upper == 1) cfg = 5;
00723   }
00724   if (blue == 0 && disp == 4) {
00725           uves_ech_id  = 1;
00726           if (upper == 0) cfg = 4;
00727           if (upper == 1) cfg = 6;
00728   }
00729 
00730   if (cfg == 0) {
00731     uves_msg_error("Wrong configuration!");
00732     return -1;
00733   }
00734 
00735   uves_cfg_indx = cfg;
00736 
00737   (void) uves_physmod_set_binning(binx, biny);
00738   (void) uves_physmod_find_alpha_beta(waveCent, 1, cdgroov[uves_x_disp_id-1], 
00739                     cdbeam[uves_ech_id-1], &uves_alpha0_cd, &uves_beta0_cd); 
00740 
00741   /*
00742   uves_msg_debug("alpha, beta for Xdisp: %f %f\nin config %d and CCD-ID %c",
00743                   uves_alpha0_cd, uves_beta0_cd,cfg, uves_ccd_id);
00744   */
00745   return(cfg);
00746 
00747 }
00748 
00768 double cameraFocal(double lm)
00769 
00770 {
00771    double nfk=0.;
00772    /*uves_msg("lm = %f ", lm);*/
00773    /* uves_msg_debug("lm=%g uves_air_index(lm)=%g",lm,uves_air_index(lm)); */
00774 
00775    lm /= uves_air_index(lm);
00776    /* uves_msg_debug("uves_arm=%d",uves_arm_ident); */
00777    if (uves_arm_id == 'b' ) { 
00778      /* uves_msg_debug("uves_arm blue"); */
00779     nfk=5.3961886e-7*lm*lm*lm-0.00079597882*lm*lm+0.41122805*lm+287.89644;
00780    }
00781 
00782    if (uves_arm_id == 'r' ) { 
00783      /* uves_msg_debug("uves_arm red"); */
00784     nfk=6.0172051e-13*lm*lm*lm*lm*lm-2.5623231e-9*lm*lm*lm*lm+
00785         4.3585543e-6*lm*lm*lm -0.0037286381*lm*lm+
00786         1.6289971*lm + 210.06767;
00787 
00788    }
00789    /*  uves_msg_debug("lm=%g nfk=%g",lm,nfk); */
00790 
00791  /*uves_msg("Nfk = %f, lm = %f",nfk/1000.,lm); */
00792 return(nfk/1000.);
00793 
00794 }
00795 
00796 
00802 int uves_physmod_find_order(double lm)
00803 {
00804   int order;
00805   double k, alpha, beta;
00806 
00807   lm /= uves_air_index(lm);
00808 
00809   k     = uves_ech_groov[uves_ech_id-1];
00810   alpha = uves_ech_blaze[uves_ech_id-1];
00811   beta  = uves_ech_blaze[uves_ech_id-1];
00812   order = (int)((sin(alpha*uves_deg2rad) + sin(beta*uves_deg2rad))/k/lm + 0.5);
00813   /*
00814   uves_msg_debug("uves_ech_id=%d lm %g airindex %g k=%g alpha=%g beta=%g 
00815            order=%d",uves_ech_id,lm,uves_air_index(lm),k,alpha,beta,order);
00816   */
00817   return order;
00818 }
00819 
00827 double uves_physmod_find_order_lambda(double k, double alpha, double beta)
00828 {
00829   double ML;
00830   ML =  ( ( sin(alpha*uves_deg2rad) + sin(beta*uves_deg2rad) )/k);
00831   ML *= uves_air_index(ML);
00832   return(ML);
00833 }
00834 
00835 
00842 double uves_physmod_find_lambda(double k, double alpha, double beta)
00843 {
00844   double L;
00845   L = (sin(alpha*uves_deg2rad) + sin(beta*uves_deg2rad) )/k ;
00846   L *= uves_air_index(L);
00847   return(L);
00848 }
00849 
00857 double uves_physmod_find_beta(int m, double k, double l, double alpha)
00858 {
00859    /* uves_msg ("m, k, l, alpha: %d %f %f %f",m, k, l, alpha); */
00860  
00861   l /= uves_air_index(l);
00862   
00863   /*  I check that the argument of asin is <=0 otherwhise return
00864       a dummy angle (~89 deg) which will produce (x,y) pos out
00865       of detector so the line will be discarted
00866    */
00867   /*
00868   uves_msg_debug("l=%g m*k*l=%g alpha=%g",l,m*k*l,alpha);
00869   */
00870   if ( (m*k*l - sin(alpha*uves_deg2rad)) <=1.0 )
00871   {
00872      return( (asin(m*k*l - sin(alpha*uves_deg2rad)))/uves_deg2rad );
00873   }
00874   else
00875   {
00876      return( (asin(0.999))/uves_deg2rad );
00877   }
00878 }
00879 
00888 void 
00889 uves_physmod_lambda_order2beta(double lambda, 
00890                                int m, 
00891                                double* puves_beta_ech, 
00892                                double* puves_beta_cd, 
00893                                double* pfc)
00894 {
00895     /* uves_msg ("Disp: %d Ech: %d",uves_x_disp_id,uves_ech_id-1); */
00896 
00897 /*   lambda /= uves_air_index(lambda);  bog fixed ! */
00898    
00899    *pfc       = cameraFocal(lambda);
00900 
00901     /* uves_msg ("New Camera focal (m) : %f",fc); */
00902 
00903    *puves_beta_ech = uves_physmod_find_beta(m, uves_ech_groov[uves_ech_id-1], 
00904                      lambda, uves_ech_blaze[uves_ech_id-1]);
00905 
00906    *puves_beta_cd  = uves_physmod_find_beta(1, cdgroov[uves_x_disp_id-1], 
00907                      lambda, uves_alpha0_cd); 
00908    /* uves_msg_debug("fc=%g uves_beta_ech=%g uves_beta_cd=%g"
00909       ,*pfc,*puves_beta_ech,*puves_beta_cd); */
00910 
00911 }
00912 
00921 void 
00922 uves_beta2xy(double uves_beta_cd, 
00923              double uves_beta_ech, 
00924              double fc, 
00925              double* px, 
00926              double* py)
00927 {
00928    double  xd, yd, xr, yr, angle;   
00929     
00930    xd       = fc*tan( (uves_beta_ech - uves_ech_blaze[uves_ech_id-1])*
00931                        uves_deg2rad )/
00932                        uves_physmod_pix_size[0]/uves_bin[0];    
00933    yd       = fc*tan( (uves_alpha0_cd - uves_beta_cd - 
00934                        cdbeam[uves_ech_id-1])*uves_deg2rad )/
00935                        uves_physmod_pix_size[1]/uves_bin[1];
00936 
00937     /* uves_msg ("beta(CD), yorg: %f %f", uves_beta_cd, yd); */
00938 
00939    xd = xd*flipx;
00940    yd = yd*flipy;   
00941    /* uves_msg ("Positions after flip: %f %f",xd,yd); */
00942     
00943    angle    = uves_ccd_rot[uves_ech_id-1]*uves_deg2rad;
00944    xr       =  xd*cos(angle) + yd*sin(angle);
00945    yr       = -xd*sin(angle) + yd*cos(angle);
00946 
00947     /* uves_msg ("Rotated positions %f %f",xr,yr); */
00948 
00949    *px = uves_physmod_offsetx[uves_cfg_indx-1] / uves_bin[0] + xr;
00950    *py = uves_physmod_offsety[uves_cfg_indx-1] / uves_bin[1] + yr;
00951     
00952 
00953 }
00954 
00965 void 
00966 uves_physmod_photo_beta(double lambda, 
00967                         double uves_beta_ech, 
00968                         double uves_beta_cd, 
00969                         double* puves_physmod_rech, 
00970                         double* puves_physmod_rcd, 
00971                         double* pblz)
00972 {
00973    double gam;
00974    /*
00975    uves_msg("uves_ech_id = %d, uves_ech_blaze = %f",
00976              uves_ech_id,uves_ech_blaze[uves_ech_id-1]); 
00977    uves_msg("uves_deg2rad=%f uves_beta_ech=%f uves_alpha0_cd=%f",
00978              uves_deg2rad,uves_beta_ech,uves_alpha0_cd); 
00979    */
00980    *puves_physmod_rech = cos(uves_ech_blaze[uves_ech_id-1]*uves_deg2rad)/
00981                          cos(uves_beta_ech*uves_deg2rad);
00982    
00983    *puves_physmod_rcd = cos(uves_alpha0_cd*uves_deg2rad)/
00984                         cos(uves_beta_cd*uves_deg2rad);
00985    /*
00986    uves_msg("puves_physmod_rech=%f *puves_physmod_rcd=%f",
00987              *puves_physmod_rech,*puves_physmod_rcd);
00988    */
00989    /* Computes the blaze function */
00990    gam = M_PI / uves_ech_groov[uves_ech_id-1] * 
00991                 cos(delta[uves_ech_id-1]*uves_deg2rad) * 
00992          (sin((uves_beta_ech-delta[uves_ech_id-1])*uves_deg2rad)-
00993           sin((uves_ech_blaze[uves_ech_id-1]-delta[uves_ech_id-1])*
00994               uves_deg2rad))
00995      / lambda/ uves_air_index(lambda);
00996    *pblz = DSQR(sin(gam)/gam);
00997    /*
00998    uves_msg("gamma = %f, Blaze function = %g ",gam,blz); 
00999    */  
01000 }
01001 
01025 void uves_physmod_pixscl(
01026                          double wave, 
01027                          int order, 
01028                          double uves_physmod_rech, 
01029                          double uves_physmod_rcd, 
01030                          float binx, 
01031                          float biny, 
01032                          double fc, 
01033                          double slitwidth, 
01034                          double slitlength,
01035                          double* pbinsize, 
01036                          double* ppixscale, 
01037                          double* ppixscalCD, 
01038                      double* plinewidpx, 
01039                          double* plinelenpx, 
01040                          double* plinewidth, 
01041                          double* presol)
01042 {
01043    double binsize, pixscale, pixscalCD, linewidpx, linelenpx, linewidth, resol;
01044    static double scale;
01045 
01046    if (!(scale)) scale = (206265.0*15.0*0.015*200*1e-3*binx)/120000;
01047 
01048    /*
01049    uves_msg("scale=%f 
01050              wave=%f 
01051              order=%d 
01052              fc=%f 
01053              uves_physmod_rech=%f 
01054              binx=%f 
01055              biny=%f 
01056              uves_physmod_rcd=%f",
01057          scale,    
01058              wave,   
01059              order,   
01060              fc,   
01061              uves_physmod_rech,   
01062              binx,   
01063              biny,   
01064              uves_physmod_rcd);
01065    */
01066 /* Computes the width (in pixel and A) and resolution lines */
01067    binsize = uves_physmod_wave_bin(wave, order) * 1e4;  /* in mA */
01068    pixscale = scale/(fc*uves_physmod_rech); /* in arcsec/pixel */
01069    pixscalCD = pixscale *(biny/binx) *uves_physmod_rech/uves_physmod_rcd; /* in arcsec/pixel */ 
01070    linewidpx = slitwidth / pixscale;  /* pixel */
01071    linelenpx = slitlength /pixscalCD;  /* pixel */    
01072    linewidth = binsize * linewidpx * 1e-3; /* in A (* pixel) */
01073    resol = wave * 10.0 / linewidth;  /* without unit */
01074                               /* (10.0: conversion factor from nm to A)*/
01075 
01076    /*
01077    uves_msg("slitwidth=%f slitlength=%f binsize=%f pixscale=%f pixscaleCD=%f",
01078       slitwidth,   slitlength,   binsize,   pixscale,   pixscalCD);
01079 
01080    uves_msg("linewidpx=%f linewidth=%f resol=%f",
01081       linewidpx,    linewidth,   resol);
01082    */
01083    *pbinsize = binsize;
01084    *ppixscale = pixscale;
01085    *ppixscalCD = pixscalCD;
01086    *plinewidpx = linewidpx;
01087    *plinelenpx = linelenpx;
01088    *plinewidth = linewidth;
01089    *presol = resol;
01090 
01091 }
01092 
01100 void 
01101 uves_physmod_xy_model(double lambda, int m, double* px, double* py)
01102 {
01103    double fc, uves_beta_ech, uves_beta_cd;
01104 
01105    uves_physmod_lambda_order2beta(lambda, m, &uves_beta_ech, &uves_beta_cd, &fc);
01106    uves_beta2xy(uves_beta_cd, uves_beta_ech, fc, px, py);
01107    
01108 /* exemple : 
01109    uves_physmod_photo_beta(lambda, uves_beta_ech, uves_beta_cd, 
01110                            puves_physmod_rech, puves_physmod_rcd, pblz); 
01111 */
01112 
01113 }
01114 
01123 void 
01124 uves_physmod_xy2beta(double* puves_beta_ech, 
01125                      double* puves_beta_cd, 
01126                      double fc, 
01127                      double x, 
01128                      double y)
01129 {
01130    double xr, yr, xd, yd, angle;
01131 
01132    angle    = uves_ccd_rot[uves_ech_id-1]*uves_deg2rad;
01133 
01134    xr = (x - uves_physmod_offsetx[uves_cfg_indx-1]/uves_bin[0]);
01135    yr = (y - uves_physmod_offsety[uves_cfg_indx-1]/uves_bin[1]);
01136 
01137    xd = xr*cos(angle) - yr*sin(angle);
01138    yd = xr*sin(angle) + yr*cos(angle);
01139 
01140    xd  /= flipx;
01141    yd  /= flipy;
01142 
01143    *puves_beta_ech = atan(xd*uves_physmod_pix_size[0]*uves_bin[0]/fc)/
01144                          uves_deg2rad + uves_ech_blaze[uves_ech_id-1];
01145    *puves_beta_cd  =  uves_alpha0_cd - cdbeam[uves_ech_id-1] - 
01146                       atan(yd*uves_physmod_pix_size[1]*uves_bin[1]/fc)/
01147                       uves_deg2rad; 
01148 
01149 }
01150 
01159 static void 
01160 beta2lamb(double uves_beta_ech, 
01161           double uves_beta_cd, 
01162           double* plambda, 
01163           int m)
01164 {
01165   uves_beta_cd=uves_beta_cd;
01166    *plambda = uves_physmod_find_lambda(m*uves_ech_groov[uves_ech_id-1], 
01167               uves_ech_blaze[uves_ech_id-1], uves_beta_ech);
01168 
01169 }
01170 
01183 void 
01184 uves_physmod_lambda_order_focus_model(double* plambda, 
01185                                       double* pdm, 
01186                                       double fc, 
01187                                       double x, 
01188                                       double y)
01189 {
01190 
01191    double uves_beta_ech, uves_beta_cd;
01192    
01193    uves_physmod_xy2beta(&uves_beta_ech, &uves_beta_cd, fc, x, y);
01194    
01195    *plambda = uves_physmod_find_order_lambda(cdgroov[uves_x_disp_id-1], 
01196                uves_alpha0_cd, uves_beta_cd);
01197    *pdm      = uves_physmod_find_order_lambda(uves_ech_groov[uves_ech_id-1], 
01198                 uves_ech_blaze[uves_ech_id-1], uves_beta_ech)/(*plambda);
01199 /*
01200    uves_msg("  m= %f, lambda= %f, position (x,y)= (%f , %f)",
01201             *pdm,*plambda, x,y);
01202 */
01203 }
01204 
01205 /************************************************************************* 
01206  *  Finds the couple lambda,m corresponding to a given position (x,y),
01207  *  assuming the focal of the camera for this wavelength is fc. 
01208  *************************************************************************
01209  */
01210 /* Not used:
01211 void 
01212 uves_physmod_lambda_model(double* plambda, 
01213                           int m, 
01214                           double fc, 
01215                           double x, 
01216                           double y)
01217 {
01218 
01219    double uves_beta_ech, uves_beta_cd;
01220 
01221    uves_physmod_xy2beta(&uves_beta_ech, &uves_beta_cd, fc, x, y);
01222 
01223 
01224    beta2lamb(uves_beta_ech, uves_beta_cd, plambda, m);
01225 
01226 }
01227 */
01228 
01243 void 
01244 uves_physmod_lambda_order_beta(double* plambda, 
01245                                int* pm, 
01246                                double x, 
01247                                double y, 
01248                                double* puves_beta_ech, 
01249                                double* puves_beta_cd)
01250 {
01251 
01252 double fcguess=0., wave=0., mdbl=0., xe=0., ye=0., xd=0., yd=0.;
01253 int  i=0;
01254 
01255 if (uves_arm_id == 'b') fcguess = 0.360;/*0.35722;*/
01256 if (uves_arm_id == 'r') fcguess = 0.500;
01257 
01258 uves_physmod_lambda_order_focus_model(&wave,&mdbl,fcguess,x,y);
01259 /*
01260 if (x == 1500.) {
01261   uves_msg("m= %f, lambda= %f, position (x,y)= (%f , %f)",mdbl,wave, x,y);
01262     uves_msg("focal guess= %f",fcguess);
01263 }
01264 */
01265 do {
01266    
01267    fcguess = cameraFocal(wave);
01268    /*
01269      if (x == 1500.) { 
01270        uves_msg("i= %d, focal = %f, m= %f, lambda= %f", i,fcguess,mdbl,wave);
01271      }
01272    */
01273    if (*pm <= 0) *pm = (int)(mdbl+0.5);
01274 /*   uves_physmod_lambda_model(&wave,*pm,fcguess,x,y); */
01275    uves_physmod_xy2beta(puves_beta_ech, puves_beta_cd, fcguess, x, y);
01276    beta2lamb(*puves_beta_ech, *puves_beta_cd, &wave, *pm);
01277 
01278    /*
01279      if (x == 1500.) { 
01280        uves_msg("i= %d, focal = %f, m= %d, lambda= %f", i,fcguess,*pm,wave);
01281      }
01282    */
01283    
01284    uves_physmod_xy_model(wave,(int)(mdbl+0.5), &xe, &ye);
01285    /*
01286       if (x == 1500.) { 
01287         uves_msg("m= %f, lambda= %f, position (xe,ye)= (%f , %f)",
01288                   mdbl,wave, xe,ye);
01289         uves_msg("focal = %f",fcguess);
01290       }
01291    */
01292    i++;
01293    
01294    xd = fabs(x-xe);
01295    yd = fabs(y-ye);
01296    
01297    } while (!((xd < 1.) && (yd < 1.)) && (i <= 4));
01298 
01299 *plambda = wave;
01300 
01301 /*uves_msg("i= %d", i);*/
01302 /* uves_physmod_photo_beta(wave, *puves_beta_ech, *puves_beta_cd, 
01303                  puves_physmod_rech, puves_physmod_rcd, pblz); 
01304 uves_msg("uves_physmod_lambda_order_beta(%f, %d, %f, %f, %f, %f)",
01305           wave, *pm, x, y, *puves_beta_ech, *puves_beta_cd);
01306 */
01307 
01308 }
01309 
01323 void 
01324 uves_physmod_lambda_order_model(double* plambda, int* pm, double x, double y)
01325 {
01326 
01327   double uves_beta_ech, uves_beta_cd;
01328   
01329   uves_physmod_lambda_order_beta(plambda, pm, x, y, 
01330                                  &uves_beta_ech, &uves_beta_cd);
01331   
01332 /* exemple : 
01333   uves_physmod_photo_beta(*plambda, &uves_beta_ech, &uves_beta_cd, 
01334                    puves_physmod_rech, puves_physmod_rcd, pblz); 
01335 
01336 uves_msg("uves_physmod_lambda_order_beta(%f, %d, %f, %f, %f, %f)",
01337          *plambda, *pm, x, y, uves_beta_ech, uves_beta_cd);
01338 */
01339 }
01340 
01349 void 
01350 uves_physmod_find_FSR(int m, double* lambdaC, double* fsrStart, double* fsrEnd)
01351 {
01352 
01353   double tmp_delta;
01354 
01355   *lambdaC = 2*sin(uves_ech_blaze[uves_ech_id-1]*uves_deg2rad)/
01356                    m/uves_ech_groov[uves_ech_id-1];
01357 
01358   tmp_delta = *lambdaC/m;
01359 
01360   *fsrStart = *lambdaC - tmp_delta/2.;
01361   *fsrEnd   = *lambdaC + tmp_delta/2.;
01362 
01363 }
01364 
01370 double uves_physmod_wave_bin(double l, int m)
01371 {
01372 
01373   double dl, x0,y_0,x1,y_1;
01374 
01375   dl = 20e-4; /* Wavelength increment in nm (nearly one pixel)*/
01376 
01377   uves_physmod_xy_model( l,    m,&x0,&y_0);
01378   uves_physmod_xy_model((l+dl),m,&x1,&y_1);
01379 
01380   return( dl/(x1-x0) );
01381 }
01382 
01388 void uves_ccd_size(int* nx, int* ny)
01389 {
01390   /*
01391   uves_msg("imsize[uves_ech_id-1]=%d 
01392             uves_physmod_row_size[uves_ech_id-1]=%d 
01393             uves_bin[0]=%f uves_bin[1]=%f",
01394         imsize[uves_ech_id-1],   
01395             uves_physmod_row_size[uves_ech_id-1],   
01396             uves_bin[0],   
01397             uves_bin[1]);
01398   */
01399   *nx = imsize[uves_ech_id-1] / uves_bin[0];
01400   *ny = uves_physmod_row_size[uves_ech_id-1] / uves_bin[1];
01401 }
01402 
01413 void uves_physmod_xy_regres(double x,double y,double* px,double* py)
01414 {
01415   double xdiff=0;
01416   double ydiff=0;
01417   int    xnpix=0;
01418   int    ynpix=0;
01419   
01420   goto simplified;
01421   /*  We comment the following to remove a compilation warning
01422       Anyway the code would not be executed due to goto statement      
01423   xdiff = xcoef[uves_cfg_indx-1][8]*DSQR(x*y) + 
01424           xcoef[uves_cfg_indx-1][7]*x*DSQR(y) + 
01425           xcoef[uves_cfg_indx-1][6]*DSQR(y)   + 
01426           xcoef[uves_cfg_indx-1][5]*DSQR(x)*y + 
01427           xcoef[uves_cfg_indx-1][4]*x*y       + 
01428           xcoef[uves_cfg_indx-1][3]*y         + 
01429           xcoef[uves_cfg_indx-1][2]*DSQR(x)   + 
01430           xcoef[uves_cfg_indx-1][1]*x         + 
01431           xcoef[uves_cfg_indx-1][0];
01432 
01433   ydiff = ycoef[uves_cfg_indx-1][8]*DSQR(x*y) + 
01434           ycoef[uves_cfg_indx-1][7]*x*DSQR(y) + 
01435           ycoef[uves_cfg_indx-1][6]*DSQR(y)   + 
01436           ycoef[uves_cfg_indx-1][5]*DSQR(x)*y + 
01437           ycoef[uves_cfg_indx-1][4]*x*y       + 
01438           ycoef[uves_cfg_indx-1][3]*y         + 
01439           ycoef[uves_cfg_indx-1][2]*DSQR(x)   + 
01440           ycoef[uves_cfg_indx-1][1]*x         + 
01441           ycoef[uves_cfg_indx-1][0];
01442   */
01443   
01444   /* New, simplified correction */ 
01445   simplified: {
01446   uves_ccd_size(&xnpix, &ynpix);
01447   /* uves_msg("xnpix=%d ynpix=%d",xnpix,ynpix); */
01448   xdiff = (-7.)*(x-(double)xnpix/2.)/((double)xnpix/2.);
01449   /* ydiff = (5.)*pow((x-(double)xnpix/2.)/((double)xnpix/2.),2.); */
01450   ydiff = (5.)*DSQR((x-(double)xnpix/2.)/((double)xnpix/2.));
01451   /* uves_msg("xdiff=%f ydiff=%f",xdiff,ydiff); */
01452   *px = x + xdiff;
01453   *py = y + ydiff;
01454   }
01455 }
01456 

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