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/06/06 08:17:33 $ 00023 * $Revision: 1.6 $ 00024 * $Name: uves-3_9_0 $ 00025 * $Log: uves_chip.c,v $ 00026 * Revision 1.6 2007/06/06 08:17:33 amodigli 00027 * replace tab with 4 spaces 00028 * 00029 * Revision 1.5 2007/01/10 12:35:33 jmlarsen 00030 * Added uves_chip_tochar 00031 * 00032 * Revision 1.4 2006/08/17 13:56:52 jmlarsen 00033 * Reduced max line length 00034 * 00035 * Revision 1.3 2005/12/19 16:17:56 jmlarsen 00036 * Replaced bool -> int 00037 * 00038 */ 00039 00040 #ifdef HAVE_CONFIG_H 00041 # include <config.h> 00042 #endif 00043 00044 /*----------------------------------------------------------------------------*/ 00050 /*----------------------------------------------------------------------------*/ 00054 /*----------------------------------------------------------------------------- 00055 Includes 00056 -----------------------------------------------------------------------------*/ 00057 00058 #include <uves_chip.h> 00059 #include <cpl.h> 00060 00061 /*----------------------------------------------------------------------------- 00062 Functions prototypes 00063 -----------------------------------------------------------------------------*/ 00064 00065 /*----------------------------------------------------------------------------- 00066 Implementation 00067 -----------------------------------------------------------------------------*/ 00068 00069 00070 00071 /*----------------------------------------------------------------------------*/ 00090 /*----------------------------------------------------------------------------*/ 00091 enum uves_chip 00092 uves_chip_get_first(bool blue) 00093 { 00094 return (blue) ? UVES_CHIP_BLUE : UVES_CHIP_REDL; 00095 } 00096 00097 /*----------------------------------------------------------------------------*/ 00105 /*----------------------------------------------------------------------------*/ 00106 00107 enum uves_chip 00108 uves_chip_get_next(enum uves_chip chip) 00109 { 00110 return 00111 (chip == UVES_CHIP_REDL) ? UVES_CHIP_REDU : 00112 (chip == UVES_CHIP_BLUE) ? UVES_CHIP_INVALID : 00113 (chip == UVES_CHIP_REDU) ? UVES_CHIP_INVALID : 00114 UVES_CHIP_INVALID; 00115 } 00116 00117 /*----------------------------------------------------------------------------*/ 00123 /*----------------------------------------------------------------------------*/ 00124 int uves_chip_get_index(enum uves_chip chip) 00125 { 00126 /* 0 = REDL/BLUE, 1 = REDU */ 00127 return (chip == UVES_CHIP_REDU) ? 1 : 0; 00128 } 00129 00130 /*----------------------------------------------------------------------------*/ 00136 /*----------------------------------------------------------------------------*/ 00137 00138 const char * 00139 uves_chip_tostring_lower(enum uves_chip chip) 00140 { 00141 return 00142 (chip == UVES_CHIP_BLUE) ? "blue" : 00143 (chip == UVES_CHIP_REDU) ? "redu" : 00144 (chip == UVES_CHIP_REDL) ? "redl" : "?chip?"; 00145 } 00146 00147 /*----------------------------------------------------------------------------*/ 00153 /*----------------------------------------------------------------------------*/ 00154 00155 const char * 00156 uves_chip_tostring_upper(enum uves_chip chip) 00157 { 00158 return 00159 (chip == UVES_CHIP_BLUE) ? "BLUE" : 00160 (chip == UVES_CHIP_REDU) ? "REDU" : 00161 (chip == UVES_CHIP_REDL) ? "REDL" : "?CHIP?"; 00162 } 00163 00164 00165 /*----------------------------------------------------------------------------*/ 00171 /*----------------------------------------------------------------------------*/ 00172 const char *uves_chip_get_det(enum uves_chip chip) 00173 { 00174 return 00175 (chip == UVES_CHIP_BLUE) ? "be" : 00176 (chip == UVES_CHIP_REDU) ? "rm" : 00177 (chip == UVES_CHIP_REDL) ? "re" : "??"; 00178 } 00179 00180 /*----------------------------------------------------------------------------*/ 00186 /*----------------------------------------------------------------------------*/ 00187 char uves_chip_tochar(enum uves_chip chip) 00188 { 00189 return 00190 (chip == UVES_CHIP_BLUE) ? 'b' : 00191 (chip == UVES_CHIP_REDU) ? 'u' : 00192 (chip == UVES_CHIP_REDL) ? 'l' : '?'; 00193 } 00194
1.5.1