uves_chip.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: 2010/09/24 09:32:02 $
00023  * $Revision: 1.8 $
00024  * $Name: uves-4_9_1 $
00025  * $Log: uves_chip.c,v $
00026  * Revision 1.8  2010/09/24 09:32:02  amodigli
00027  * put back QFITS dependency to fix problem spot by NRI on FIBER mode (with MIDAS calibs) data
00028  *
00029  * Revision 1.6  2007/06/06 08:17:33  amodigli
00030  * replace tab with 4 spaces
00031  *
00032  * Revision 1.5  2007/01/10 12:35:33  jmlarsen
00033  * Added uves_chip_tochar
00034  *
00035  * Revision 1.4  2006/08/17 13:56:52  jmlarsen
00036  * Reduced max line length
00037  *
00038  * Revision 1.3  2005/12/19 16:17:56  jmlarsen
00039  * Replaced bool -> int
00040  *
00041  */
00042 
00043 #ifdef HAVE_CONFIG_H
00044 #  include <config.h>
00045 #endif
00046 
00047 /*----------------------------------------------------------------------------*/
00053 /*----------------------------------------------------------------------------*/
00057 /*-----------------------------------------------------------------------------
00058                                 Includes
00059  -----------------------------------------------------------------------------*/
00060 
00061 #include <uves_chip.h>
00062 #include <cpl.h>
00063 
00064 /*-----------------------------------------------------------------------------
00065                             Functions prototypes
00066  -----------------------------------------------------------------------------*/
00067 
00068 /*-----------------------------------------------------------------------------
00069                             Implementation
00070  -----------------------------------------------------------------------------*/
00071 
00072 
00073 
00074 /*----------------------------------------------------------------------------*/
00093 /*----------------------------------------------------------------------------*/
00094 enum uves_chip
00095 uves_chip_get_first(bool blue)
00096 {
00097     return (blue) ? UVES_CHIP_BLUE : UVES_CHIP_REDL;
00098 }
00099 
00100 /*----------------------------------------------------------------------------*/
00108 /*----------------------------------------------------------------------------*/
00109 
00110 enum uves_chip
00111 uves_chip_get_next(enum uves_chip chip)
00112 {
00113     return
00114     (chip == UVES_CHIP_REDL) ? UVES_CHIP_REDU :
00115     (chip == UVES_CHIP_BLUE) ? UVES_CHIP_INVALID :
00116     (chip == UVES_CHIP_REDU) ? UVES_CHIP_INVALID :
00117     UVES_CHIP_INVALID;
00118 }
00119 
00120 /*----------------------------------------------------------------------------*/
00126 /*----------------------------------------------------------------------------*/
00127 int uves_chip_get_index(enum uves_chip chip)
00128 {
00129     /* 0 = REDL/BLUE, 1 = REDU */
00130     return (chip == UVES_CHIP_REDU) ? 1 : 0;
00131 }
00132 
00133 /*----------------------------------------------------------------------------*/
00139 /*----------------------------------------------------------------------------*/
00140 
00141 const char *
00142 uves_chip_tostring_lower(enum uves_chip chip)
00143 {
00144     return
00145     (chip == UVES_CHIP_BLUE) ? "blue" : 
00146     (chip == UVES_CHIP_REDU) ? "redu" : 
00147     (chip == UVES_CHIP_REDL) ? "redl" : "?chip?";
00148 }
00149 
00150 /*----------------------------------------------------------------------------*/
00156 /*----------------------------------------------------------------------------*/
00157 
00158 const char *
00159 uves_chip_tostring_upper(enum uves_chip chip)
00160 {
00161     return
00162     (chip == UVES_CHIP_BLUE) ? "BLUE" : 
00163     (chip == UVES_CHIP_REDU) ? "REDU" : 
00164     (chip == UVES_CHIP_REDL) ? "REDL" : "?CHIP?";
00165 }
00166 
00167 
00168 /*----------------------------------------------------------------------------*/
00174 /*----------------------------------------------------------------------------*/
00175 const char *uves_chip_get_det(enum uves_chip chip)
00176 {
00177     return
00178     (chip == UVES_CHIP_BLUE) ? "be" : 
00179     (chip == UVES_CHIP_REDU) ? "rm" : 
00180     (chip == UVES_CHIP_REDL) ? "re" : "??";
00181 }
00182 
00183 /*----------------------------------------------------------------------------*/
00189 /*----------------------------------------------------------------------------*/
00190 char uves_chip_tochar(enum uves_chip chip)
00191 {
00192     return
00193     (chip == UVES_CHIP_BLUE) ? 'b' : 
00194     (chip == UVES_CHIP_REDU) ? 'u' : 
00195     (chip == UVES_CHIP_REDL) ? 'l' : '?';
00196 }
00197 

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