casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSCalEnums.h
Go to the documentation of this file.
1 //# MSCalEnums.h: Field name dictionary for casacore::MS and CAL tables
2 //# Copyright (C) 1996,1997,1998,2000,2001,2002
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 MSVIS_MSCALENUMS_H
30 #define MSVIS_MSCALENUMS_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 // MSCalEnums: Field name dictionary for casacore::MeasurementSet and calibration tables
43 // </summary>
44 
45 // <use visibility=export>
46 
47 // <reviewed reviewer="" date="" tests="" demos="">
48 
49 // <prerequisite>
50 // <li> <linkto class="casacore::MeasurementSet">casacore::MeasurementSet</linkto> module
51 // </prerequisite>
52 //
53 // <etymology>
54 // From casacore::MeasurementSet and calibration enumerations.
55 // </etymology>
56 //
57 // <synopsis>
58 // MSCalEnums defines a global dictionary of field names and properties
59 // used by both the casacore::MeasurementSet and calibration tables. 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 // Provide unified, consistent access to data fields used in the synthesis
75 // system, in both the user interface and individual applications.
76 // </motivation>
77 //
78 // <todo asof="98/01/05">
79 // Expand the column description information stored by this class.
80 // </todo>
81 
82 // Re-define MSCalEnums to MSC for simplified access. Requires
83 // forward declaration of MSCalEnums
84 
85 class MSCalEnums;
86 typedef MSCalEnums MSC;
87 
89 {
90  public:
91  // Enumerate all relevant data fields (columns and keywords)
92  enum colDef {
93  // First include all casacore::MeasurementSet MAIN columns which may be used
94  // in calibration selection, interpolation or labelling.
95  //
96  // Antenna number
97  ANTENNA1 = 0,
98  ANTENNA2 = 1,
99  // Feed identifier
100  FEED1 = 2,
101  FEED2 = 3,
102  // Pulsar bin number
104  // Scan number
106  // Time
107  TIME = 6,
108  // Extra time precision
110  // Interval
111  INTERVAL = 8,
112  // casacore::Array identifier
113  ARRAY_ID = 9,
114  // Processor identifier
116  // Field identifier
117  FIELD_ID = 11,
118  // Observation identifier
120  // Pulsar gate
122  // Spectral window identifier
124  // Phase identifier
125  PHASE_ID = 15,
126  // State identifier
127  STATE_ID = 16,
128 
129  // Other secondary casacore::MeasurementSet columns
130  //
131  // Frequency group
132  FREQ_GROUP = 100,
133  // Frequency group name
135  // Field name
136  FIELD_NAME = 102,
137  // Field code
138  FIELD_CODE = 103,
139  // Source name
140  SOURCE_NAME = 104,
141  // Source code
142  SOURCE_CODE = 105,
143  // Source calibration group
145 
146  // Other calibration table columns
147  //
148  // Gain matrix values
149  GAIN = 200,
150  // Reference antenna
151  REF_ANT = 201,
152  // Reference feed
153  REF_FEED = 202,
154  // Reference receptor
156  // Reference frequency
158  // Reference frequency frame
160  // Reference direction
162  // Reference direction frame
164  // Antenna pointing offsets
166  // Pointing offset frame
168  //
169  // Calibration format descriptor
170  CAL_DESC_ID = 300,
171  // Calibration history identifier
173 
174  // Solution statistics and weights
175  //
176  // Solution validity flag
178  // RMS of fit
179  TOTAL_FIT = 401,
180  // Sum of fit weights
182  // Solution validity flag (per solution)
183  SOLUTION_OK = 403,
184  // RMS of fit (per solution)
185  FIT = 404,
186  // Sum of fit weights (per solution)
187  FIT_WEIGHT = 405,
188  // Solution FLAG (!SOLUTION_OK)
189  FLAG = 406,
190  // Solution SNR
191  SNR = 407,
192 
193  // Calibration description columns
194  //
195  // Number of spectral windows
196  NUM_SPW = 500,
197  // Number of frequency channels
198  NUM_CHAN = 501,
199  // Number of receptors
201  // Jones matrix dimension
202  N_JONES = 503,
203  // Midpoint of frequency channels
204  CHAN_FREQ = 504,
205  // Frequency channel width
206  CHAN_WIDTH = 505,
207  // Channel range
208  CHAN_RANGE = 506,
209  // Jones matrix type
210  JONES_TYPE = 507,
211  // Polarization enumerations
213  // casacore::MeasurementSet name
214  MS_NAME = 509,
215 
216  // Calibration history columns
217  //
218  // Application parameter values
219  CAL_PARMS = 600,
220  // Associated calibration tables
221  CAL_TABLES = 601,
222  // Calibration selection
223  CAL_SELECT = 602,
224  // Calibration notes
225  CAL_NOTES = 603,
226 
227  // Keywords
228  //
229  // Cal Desc sub-table
230  CAL_DESC = 700,
231  // Cal History sub-table
232  CAL_HISTORY = 701,
233  // Observation sub-table
234  OBSERVATION = 702,
235 
236  // FJones additions
237  ROT_MEASURE = 800,
239  IONOSPH_TEC = 802,
241 
242  // GJonesDelayRateSB additions
244  SB_DELAY = 901,
245  DELAY_RATE = 902,
246 
247  // General polynomial calibration additions
248  POLY_TYPE = 1000,
249  POLY_MODE = 1001,
250  SCALE_FACTOR = 1002,
251  VALID_DOMAIN = 1003,
252  N_POLY_AMP = 1004,
253  N_POLY_PHASE = 1005,
256  PHASE_UNITS = 1008,
257 
258  // BJonesPoly additions
259  SIDEBAND_REF = 1100,
260 
261  // Spline polynomial calibration additions
262  N_KNOTS_AMP = 1200,
266 
267  };
268 
269  // Access functions for column/keyword description data
270  static casacore::String fieldName (casacore::Int enumField);
272  static casacore::DataType basicType (casacore::Int enumField);
273 
274  private:
275  // Initialize the static maps
276  static void initMaps();
277 
278  // Static ordered maps containing field descriptions
279  // Enum => Field Name
280  static std::map <casacore::Int, casacore::String> theirFieldMap;
281  // Enum => Basic data type
282  static std::map <casacore::Int, casacore::DataType> theirTypeMap;
283 };
284 
285 
286 } //# NAMESPACE CASA - END
287 
288 #endif
289 
290 
291 
292 
293 
int Int
Definition: aipstype.h:50
Observation sub-table.
Definition: MSCalEnums.h:234
GJonesDelayRateSB additions.
Definition: MSCalEnums.h:243
Calibration selection.
Definition: MSCalEnums.h:223
Extra time precision.
Definition: MSCalEnums.h:109
Solution validity flag (per solution)
Definition: MSCalEnums.h:183
static casacore::DataType basicType(casacore::Int enumField)
static std::map< casacore::Int, casacore::DataType > theirTypeMap
Enum =&gt; Basic data type.
Definition: MSCalEnums.h:282
Spline polynomial calibration additions.
Definition: MSCalEnums.h:262
Frequency group name.
Definition: MSCalEnums.h:134
Frequency channel width.
Definition: MSCalEnums.h:206
Observation identifier.
Definition: MSCalEnums.h:119
Feed identifier.
Definition: MSCalEnums.h:100
Calibration description columns.
Definition: MSCalEnums.h:196
Sum of fit weights (per solution)
Definition: MSCalEnums.h:187
First include all casacore::MeasurementSet MAIN columns which may be used in calibration selection...
Definition: MSCalEnums.h:97
Spectral window identifier.
Definition: MSCalEnums.h:123
Polarization enumerations.
Definition: MSCalEnums.h:212
Calibration history identifier.
Definition: MSCalEnums.h:172
static void initMaps()
Initialize the static maps.
Reference frequency frame.
Definition: MSCalEnums.h:159
Solution statistics and weights.
Definition: MSCalEnums.h:177
FJones additions.
Definition: MSCalEnums.h:237
Reference receptor.
Definition: MSCalEnums.h:155
Number of frequency channels.
Definition: MSCalEnums.h:198
Midpoint of frequency channels.
Definition: MSCalEnums.h:204
Cal History sub-table.
Definition: MSCalEnums.h:232
Antenna pointing offsets.
Definition: MSCalEnums.h:165
Associated calibration tables.
Definition: MSCalEnums.h:221
Solution FLAG (!SOLUTION_OK)
Definition: MSCalEnums.h:189
Pulsar bin number.
Definition: MSCalEnums.h:103
casacore::MeasurementSet name
Definition: MSCalEnums.h:214
Other calibration table columns.
Definition: MSCalEnums.h:149
Other secondary casacore::MeasurementSet columns.
Definition: MSCalEnums.h:132
Jones matrix dimension.
Definition: MSCalEnums.h:202
MSCalEnums MSC
Definition: MSCalEnums.h:85
Reference antenna.
Definition: MSCalEnums.h:151
Calibration history columns.
Definition: MSCalEnums.h:219
RMS of fit (per solution)
Definition: MSCalEnums.h:185
Phase identifier.
Definition: MSCalEnums.h:125
Field identifier.
Definition: MSCalEnums.h:117
Jones matrix type.
Definition: MSCalEnums.h:210
BJonesPoly additions.
Definition: MSCalEnums.h:259
casacore::Array identifier
Definition: MSCalEnums.h:113
Solution SNR.
Definition: MSCalEnums.h:191
Source calibration group.
Definition: MSCalEnums.h:144
State identifier.
Definition: MSCalEnums.h:127
Pointing offset frame.
Definition: MSCalEnums.h:167
colDef
Enumerate all relevant data fields (columns and keywords)
Definition: MSCalEnums.h:92
static casacore::String fieldName(casacore::Int enumField)
Access functions for column/keyword description data.
static std::map< casacore::Int, casacore::String > theirFieldMap
Static ordered maps containing field descriptions Enum =&gt; Field Name.
Definition: MSCalEnums.h:280
Reference direction frame.
Definition: MSCalEnums.h:163
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Processor identifier.
Definition: MSCalEnums.h:115
Reference feed.
Definition: MSCalEnums.h:153
Reference frequency.
Definition: MSCalEnums.h:157
Reference direction.
Definition: MSCalEnums.h:161
static casacore::Block< casacore::String > fieldNames(const casacore::Vector< casacore::Int > &enumFields)
Number of receptors.
Definition: MSCalEnums.h:200
General polynomial calibration additions.
Definition: MSCalEnums.h:248
Calibration format descriptor.
Definition: MSCalEnums.h:170
Calibration notes.
Definition: MSCalEnums.h:225