casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CTEnums.h
Go to the documentation of this file.
1 //# CTEnums.h: Field name dictionary for NewCalTable
2 //# Copyright (C) 2011
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be adressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 
29 #ifndef CALIBRATION_NEWCALTABLENUMS_H
30 #define CALIBRATION_NEWCALTABLENUMS_H
31 
32 #include <map>
33 #include <casa/aips.h>
34 #include <casa/Containers/Block.h>
35 #include <casa/Arrays/Vector.h>
36 #include <casa/BasicSL/String.h>
38 
39 namespace casa { //# NAMESPACE CASA - BEGIN
40 
41 // <summary>
42 // CTEnums: Field name dictionary for NewCalTable
43 // </summary>
44 
45 // <use visibility=export>
46 
47 // <reviewed reviewer="" date="" tests="" demos="">
48 
49 // <prerequisite>
50 // <li> <linkto class="NewCalTable">NewCalTable</linkto> module
51 // </prerequisite>
52 //
53 // <etymology>
54 // From calibration enumerations.
55 // </etymology>
56 //
57 // <synopsis>
58 // CTEnums defines a global dictionary of field names and properties
59 // used by the NewCalTable. Field names
60 // and properties are accessed through enumerated constants, thus
61 // ensuring a consistent and uniform interface. Both column names and
62 // keywords are included here. All data are stored in static maps.
63 // </synopsis>
64 //
65 // <example>
66 // <srcblock>
67 // // Determine the column name for the SPECTRAL_WINDOW_ID column
68 // casacore::String name = MSC::fieldName (MSC::SPECTRAL_WINDOW_ID));
69 //
70 // </srcblock>
71 // </example>
72 //
73 // <motivation>
74 // </motivation>
75 //
76 // <todo asof="11/07/13">
77 //
78 // </todo>
79 
80 
81 class CTEnums;
82 typedef CTEnums NCT;
83 
84 class CTEnums
85 {
86  public:
87  // Enumerate all relevant data fields (columns and keywords)
88  enum colDef {
89  // new cal table columns
90  TIME = 0,
91  // Extra time precision
93  // Field identifier
94  FIELD_ID = 2,
95  // Spectral window identifier
97  // Antenna number
98  ANTENNA1 = 4,
99  ANTENNA2 = 5,
100  // Interval
101  INTERVAL = 6,
102  // scan number
104  // Observation identifier
106  // casacore::Array identifier
107  ARRAY_ID = 9,
108 
109  // Solution parameters and weights
110  // cal solution params.
111  CPARAM = 100,
112  FPARAM = 101,
113  // cal solution param errors
114  PARAMERR = 102,
115  // flag
116  FLAG = 103,
117  // Solution SNR
118  SNR = 104,
119  // solution weight
120  WEIGHT = 105,
121 
122  };
123 
124  // Access functions for column/keyword description data
125  static casacore::String fieldName (casacore::Int enumField);
127  static casacore::DataType basicType (casacore::Int enumField);
128 
129  private:
130  // Initialize the static maps
131  static void initMaps();
132 
133  // Static ordered maps containing field descriptions
134  // Enum => Field Name
135  static std::map <casacore::Int, casacore::String> theirFieldMap;
136  // Enum => Basic data type
137  static std::map <casacore::Int, casacore::DataType> theirTypeMap;
138 };
139 
140 
141 } //# NAMESPACE CASA - END
142 
143 #endif
int Int
Definition: aipstype.h:50
Observation identifier.
Definition: CTEnums.h:105
static void initMaps()
Initialize the static maps.
static std::map< casacore::Int, casacore::String > theirFieldMap
Static ordered maps containing field descriptions Enum =&gt; Field Name.
Definition: CTEnums.h:135
CTEnums NCT
Definition: CTEnums.h:81
cal solution param errors
Definition: CTEnums.h:114
static std::map< casacore::Int, casacore::DataType > theirTypeMap
Enum =&gt; Basic data type.
Definition: CTEnums.h:137
casacore::Array identifier
Definition: CTEnums.h:107
static casacore::Block< casacore::String > fieldNames(const casacore::Vector< casacore::Int > &enumFields)
Field identifier.
Definition: CTEnums.h:94
Extra time precision.
Definition: CTEnums.h:92
new cal table columns
Definition: CTEnums.h:90
Solution parameters and weights cal solution params.
Definition: CTEnums.h:111
static casacore::DataType basicType(casacore::Int enumField)
Spectral window identifier.
Definition: CTEnums.h:96
solution weight
Definition: CTEnums.h:120
Solution SNR.
Definition: CTEnums.h:118
String: the storage and methods of handling collections of characters.
Definition: String.h:223
static casacore::String fieldName(casacore::Int enumField)
Access functions for column/keyword description data.
Antenna number.
Definition: CTEnums.h:98
colDef
Enumerate all relevant data fields (columns and keywords)
Definition: CTEnums.h:88