casa
$Rev:20696$
|
00001 //# CTEnums.h: Field name dictionary for NewCalTable 00002 //# Copyright (C) 2011 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be adressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# 00027 //# $Id: CTEnums.h 18637 2012-03-09 17:13:25Z george.moellenbrock $ 00028 00029 #ifndef CALIBRATION_NEWCALTABLENUMS_H 00030 #define CALIBRATION_NEWCALTABLENUMS_H 00031 00032 #include <casa/aips.h> 00033 #include <casa/Containers/SimOrdMap.h> 00034 #include <casa/Containers/Block.h> 00035 #include <casa/Arrays/Vector.h> 00036 #include <casa/BasicSL/String.h> 00037 #include <casa/Utilities/DataType.h> 00038 00039 namespace casa { //# NAMESPACE CASA - BEGIN 00040 00041 // <summary> 00042 // CTEnums: Field name dictionary for NewCalTable 00043 // </summary> 00044 00045 // <use visibility=export> 00046 00047 // <reviewed reviewer="" date="" tests="" demos=""> 00048 00049 // <prerequisite> 00050 // <li> <linkto class="NewCalTable">NewCalTable</linkto> module 00051 // </prerequisite> 00052 // 00053 // <etymology> 00054 // From calibration enumerations. 00055 // </etymology> 00056 // 00057 // <synopsis> 00058 // CTEnums defines a global dictionary of field names and properties 00059 // used by the NewCalTable. Field names 00060 // and properties are accessed through enumerated constants, thus 00061 // ensuring a consistent and uniform interface. Both column names and 00062 // keywords are included here. All data are stored in static maps. 00063 // </synopsis> 00064 // 00065 // <example> 00066 // <srcblock> 00067 // // Determine the column name for the SPECTRAL_WINDOW_ID column 00068 // String name = MSC::fieldName (MSC::SPECTRAL_WINDOW_ID)); 00069 // 00070 // </srcblock> 00071 // </example> 00072 // 00073 // <motivation> 00074 // </motivation> 00075 // 00076 // <todo asof="11/07/13"> 00077 // 00078 // </todo> 00079 00080 00081 class CTEnums; 00082 typedef CTEnums NCT; 00083 00084 class CTEnums 00085 { 00086 public: 00087 // Enumerate all relevant data fields (columns and keywords) 00088 enum colDef { 00089 // new cal table columns 00090 TIME = 0, 00091 // Extra time precision 00092 TIME_EXTRA_PREC = 1, 00093 // Field identifier 00094 FIELD_ID = 2, 00095 // Spectral window identifier 00096 SPECTRAL_WINDOW_ID = 3, 00097 // Antenna number 00098 ANTENNA1 = 4, 00099 ANTENNA2 = 5, 00100 // Interval 00101 INTERVAL = 6, 00102 // scan number 00103 SCAN_NUMBER = 7, 00104 // Observation identifier 00105 OBSERVATION_ID = 8, 00106 // Array identifier 00107 ARRAY_ID = 9, 00108 00109 // Solution parameters and weights 00110 // cal solution params. 00111 CPARAM = 100, 00112 FPARAM = 101, 00113 // cal solution param errors 00114 PARAMERR = 102, 00115 // flag 00116 FLAG = 103, 00117 // Solution SNR 00118 SNR = 104, 00119 // solution weight 00120 WEIGHT = 105, 00121 00122 }; 00123 00124 // Access functions for column/keyword description data 00125 static String fieldName (Int enumField); 00126 static Block<String> fieldNames (const Vector<Int>& enumFields); 00127 static DataType basicType (Int enumField); 00128 00129 private: 00130 // Initialize the static maps 00131 static void initMaps(); 00132 00133 // Static ordered maps containing field descriptions 00134 // Enum => Field Name 00135 static SimpleOrderedMap <Int, String> theirFieldMap; 00136 // Enum => Basic data type 00137 static SimpleOrderedMap <Int, DataType> theirTypeMap; 00138 }; 00139 00140 00141 } //# NAMESPACE CASA - END 00142 00143 #endif