casacore
MSSelectionKeywords.h
Go to the documentation of this file.
1 //# MSSelectionKeywords.h: selection keywords for the MS
2 //# Copyright (C) 1997,1998,1999,2000,2001
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 addressed 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 MS_MSSELECTIONKEYWORDS_H
30 #define MS_MSSELECTIONKEYWORDS_H
31 
32 #include <casacore/casa/aips.h>
33 #include <map>
34 
35 namespace casacore { //# NAMESPACE CASACORE - BEGIN
36 
37 template <class T> class Block;
38 
39 // forward declare the class so we can typedef it
40 class MSSelectionKeywords;
41 class String;
42 
43 // Define a shorthand notation for this class, so enums can be specified
44 // easily.
46 
47 // <summary>
48 // MSSelectionKeywords specifies selection keywords for the MeasurementSet
49 // </summary>
50 
51 // <use visibility=export>
52 
53 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
54 // </reviewed>
55 
56 // <prerequisite>
57 // <li> MeasurementSet
58 // <li> MSSelector
59 // </prerequisite>
60 //
61 // <etymology>
62 // MSSelectionKeywords is a class that defines selection keywords
63 // </etymology>
64 //
65 // <synopsis>
66 // This class is used to specify selections on a MeasurementSet.
67 // It is a purely static class that just defines a mapping from
68 // Strings to Enums, and provides these for use by classes like
69 // MSSelector and MSRange
70 //
71 // <example> <srcblock>
72 // </srcblock></example>
73 // </synopsis>
74 //
75 // <motivation>
76 // Selection keywords are needed for several classes, this class provides
77 // them to all, avoiding duplication in each class.
78 // </motivation>
79 //
80 // <thrown>
81 // <li>
82 // <li>
83 // </thrown>
84 //
85 // <todo asof="yyyy/mm/dd">
86 // <li> add this feature
87 // </todo>
88 
90 {
91 public:
92  // The fields in the MS for which selection and range operations are
93  // defined. Some of these directly correspond to columns in the table,
94  // others are derived quantities or columns in subtables.
95  enum Field {
96  // undefined field
98  // the range of visibility amplitude
100  // the range of corrected vis amplitude
102  // the range of model vis amplitude
104  // the amplitude of the ratio corrected data/model data
106  // the residual vis amplitude (corrected-model)
108  // the observed residual vis amplitude (observed-model)
110  // the list of antenna1 id values
112  // the list of antenna2 id values
114  // the list of antenna names
116  // the list of array id values
118  // description of the data axes
120  // the channel frequencies, a vector for each selected spectral window
122  // the list of polarizations present, this gives the String values
124  // the list of polarizations present, this gives the Stokes enum values
126  // the complex data
128  // the complex corrected data
130  //the complex model data
132  // the ratio corrected data/model data
134  // the residual data (corrected - model)
136  // the observed residual data (observed - model)
138  // the list of dataDescription id values
140  // the list of feed1 id values
142  // the list of feed2 id values
144  // the list of field_id values
146  // the list of field names
148  // the flags
150  // the row flags
152  // a summary of flags (flag count summed over rows)
154  // the float data (optional single dish column)
156  // Hour angle
157  HA,
158  // the list of interferometers (= 1000*ant1+ant2) present
160  // the (range of the) imaginary part of the visibilities
162  // the (range of the) imaginary part of the corrected visibilities
164  // the (range of the) imaginary part of the model visibilities
166  // the imaginary part of the ratio corrected data/model data
168  // the (range of the) imaginary part of the residual visibilities
170  // the (range of the) imaginary part of the observed residual visibilities
172  // Local Apparent Sidereal Time
174  // the number of correlation products (polarizations) for selected spectral window
176  // the number of spectral channels for selected spectral window
178  // the (range of the) phase of the visibilities
180  // the (range of the) phase of the corrected visibilities
182  // the (range of the) phase of the model visibilities
184  // the phase of the ratio corrected data/model data
186  // the (range of the) phase of the residual visibilities
188  // the (range of the) phase of the observed residual visibilities
190  // the phase center direction for each field (matrix + epoch)
192  // the (range of the) real part of the visibilities
194  // the (range of the) real part of the corrected visibilities
196  // the (range of the) real part of the model visibilities
198  // the real part of the ratio corrected data/model data
200  // the real part of the residual visibilities (corrected-model)
202  // the real part of the observed residuals (observed-model)
204  // the reference frequency for selected spectral window (or vector with all)
206  // the list of row numbers in the original MS
208  // the list of scan_number values
210  //# the list of spectral window id values
211  //# SPECTRAL_WINDOW_ID,
212  // the per spectrum sigmas
214  // the range of times
216  // the list of time values
218  // UT time (seconds of current day)
219  UT,
220  // the uvw coordinates
222  // the (range of the) U coordinate (m)
223 //# Note:order of U, V and W is important, no intervening items allowed
224 //# without changing select() code.
225  U,
226  // the (range of the) V coordinate (m)
227  V,
228  // the (range of the) W coordinate (m)
229  W,
230  // the (range of the) UV-distance (m)
232  // the weights
234  // Number of keywords
236 };
237 
238 
239  // convert a keyword string to the corresponding enum
240  static Field field(const String& keyword);
241 
242  // convert an enum value to the corresponding keyword string
243  static const String& keyword(Field field);
244 
245 private:
246  // This class is purely static, no instances are allowed.
250 
251  // Get the static map.
252  static std::map<String,Int>& getMap();
253 
254  // Get the static reverse map.
256 
257  // Create an initialized map.
258  static std::map<String,Int> initMap();
259 
260  // Create an initialized reverse map.
262 };
263 
264 
265 } //# NAMESPACE CASACORE - END
266 
267 #endif
simple 1-D array
Definition: Block.h:200
static const String & keyword(Field field)
convert an enum value to the corresponding keyword string
MSSelectionKeywords & operator=(const MSSelectionKeywords &other)
static std::map< String, Int > & getMap()
Get the static map.
MSSelectionKeywords(const MSSelectionKeywords &other)
MSSelectionKeywords()
This class is purely static, no instances are allowed.
static std::map< String, Int > initMap()
Create an initialized map.
Field
The fields in the MS for which selection and range operations are defined.
@ RESIDUAL_REAL
the real part of the residual visibilities (corrected-model)
@ AXIS_INFO
description of the data axes
@ CORRECTED_AMPLITUDE
the range of corrected vis amplitude
@ OBS_RESIDUAL_AMPLITUDE
the observed residual vis amplitude (observed-model)
@ MODEL_DATA
the complex model data
@ MODEL_IMAGINARY
the (range of the) imaginary part of the model visibilities
@ FLAG_SUM
a summary of flags (flag count summed over rows)
@ ANTENNA1
the list of antenna1 id values
@ W
the (range of the) W coordinate (m)
@ RATIO_AMPLITUDE
the amplitude of the ratio corrected data/model data
@ AMPLITUDE
the range of visibility amplitude
@ CORRECTED_REAL
the (range of the) real part of the corrected visibilities
@ CORRECTED_IMAGINARY
the (range of the) imaginary part of the corrected visibilities
@ CHAN_FREQ
the channel frequencies, a vector for each selected spectral window
@ RESIDUAL_AMPLITUDE
the residual vis amplitude (corrected-model)
@ FIELD_ID
the list of field_id values
@ UT
UT time (seconds of current day)
@ OBS_RESIDUAL_DATA
the observed residual data (observed - model)
@ OBS_RESIDUAL_REAL
the real part of the observed residuals (observed-model)
@ NUM_CHAN
the number of spectral channels for selected spectral window
@ RATIO_PHASE
the phase of the ratio corrected data/model data
@ MODEL_AMPLITUDE
the range of model vis amplitude
@ RATIO_REAL
the real part of the ratio corrected data/model data
@ MODEL_PHASE
the (range of the) phase of the model visibilities
@ CORRECTED_PHASE
the (range of the) phase of the corrected visibilities
@ ROWS
the list of row numbers in the original MS
@ SIGMA
the per spectrum sigmas
@ IMAGINARY
the (range of the) imaginary part of the visibilities
@ V
the (range of the) V coordinate (m)
@ RESIDUAL_DATA
the residual data (corrected - model)
@ MODEL_REAL
the (range of the) real part of the model visibilities
@ OBS_RESIDUAL_IMAGINARY
the (range of the) imaginary part of the observed residual visibilities
@ NUM_CORR
the number of correlation products (polarizations) for selected spectral window
@ PHASE_DIR
the phase center direction for each field (matrix + epoch)
@ FLOAT_DATA
the float data (optional single dish column)
@ CORRECTED_DATA
the complex corrected data
@ RATIO_DATA
the ratio corrected data/model data
@ IFR_NUMBER
the list of interferometers (= 1000*ant1+ant2) present
@ DATA_DESC_ID
the list of dataDescription id values
@ LAST
Local Apparent Sidereal Time.
@ REAL
the (range of the) real part of the visibilities
@ CORR_TYPES
the list of polarizations present, this gives the Stokes enum values
@ RESIDUAL_IMAGINARY
the (range of the) imaginary part of the residual visibilities
@ FEED1
the list of feed1 id values
@ RATIO_IMAGINARY
the imaginary part of the ratio corrected data/model data
@ FIELDS
the list of field names
@ UVDIST
the (range of the) UV-distance (m)
@ PHASE
the (range of the) phase of the visibilities
@ REF_FREQUENCY
the reference frequency for selected spectral window (or vector with all)
@ OBS_RESIDUAL_PHASE
the (range of the) phase of the observed residual visibilities
@ ANTENNA2
the list of antenna2 id values
@ RESIDUAL_PHASE
the (range of the) phase of the residual visibilities
@ ANTENNAS
the list of antenna names
@ ARRAY_ID
the list of array id values
@ SCAN_NUMBER
the list of scan_number values
@ CORR_NAMES
the list of polarizations present, this gives the String values
@ U
the (range of the) U coordinate (m)
@ TIMES
the list of time values
@ NUMBER_KEYWORDS
Number of keywords.
@ FEED2
the list of feed2 id values
static Block< String > initReverseMap()
Create an initialized reverse map.
static Block< String > & getReverseMap()
Get the static reverse map.
static Field field(const String &keyword)
convert a keyword string to the corresponding enum
String: the storage and methods of handling collections of characters.
Definition: String.h:225
this file contains all the compiler specific defines
Definition: mainpage.dox:28
MSSelectionKeywords MSS
Define a shorthand notation for this class, so enums can be specified easily.