casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSColumns.h
Go to the documentation of this file.
1 //# MSColumns.h: provides easy access to MeasurementSet columns
2 //# Copyright (C) 1996,1999,2000
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 //# $Id$
27 
28 #ifndef MS_MSCOLUMNS_H
29 #define MS_MSCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
57 
58 namespace casacore { //# NAMESPACE CASACORE - BEGIN
59 
60 class MeasurementSet;
61 
62 // <summary>
63 // A class to provide easy read-only access to MeasurementSet columns
64 // </summary>
65 
66 // <use visibility=export>
67 
68 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
69 // </reviewed>
70 
71 // <prerequisite>
72 // <li> MeasurementSet
73 // <li> ArrayColumn
74 // <li> ScalarColumn
75 // </prerequisite>
76 //
77 // <etymology>
78 // ROMSColumns stands for Read-Only MeasurementSet Table columns.
79 // </etymology>
80 //
81 // <synopsis>
82 // This class provides read-only access to the columns in the MeasurementSet.
83 // It does the declaration of all the Scalar and ArrayColumns with the
84 // correct types, so the application programmer doesn't have to
85 // worry about getting those right. There is an access function
86 // for every predefined column. Access to non-predefined columns will still
87 // have to be done with explicit declarations.
88 // </synopsis>
89 //
90 // <example>
91 // <srcblock>
92 // // use as follows
93 // MeasurementSet ms("myMS");
94 // ROMSColumns msc(ms);
95 // // show data from row 5
96 // cout << msc.data()(5);
97 // // show name of antenna on row 3 in antenna table
98 // cout << msc.antenna().name();
99 // </srcblock>
100 // </example>
101 //
102 // <motivation>
103 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
104 // </motivation>
105 //
106 // <todo asof="1997/02/01">
107 // <li> We might decide to merge all the MSColumn classes with the
108 // corresponding MeasurementSet classes.
109 // </todo>
110 
112 {
113 public:
114  // Create a columns object that accesses the data in the specified MS
115  ROMSColumns(const MeasurementSet& ms);
116 
117  // The destructor does nothing special
118  ~ROMSColumns();
119 
120  // Access to required subtables
121  // <group>
122  const ROMSAntennaColumns& antenna() const {return antenna_p;}
124  const ROMSFeedColumns& feed() const {return feed_p;}
125  const ROMSFieldColumns& field() const {return field_p;}
126  const ROMSFlagCmdColumns& flagCmd() const {return flagCmd_p;}
127  const ROMSHistoryColumns& history() const {return history_p;}
129  const ROMSPointingColumns& pointing() const {return pointing_p;}
131  return polarization_p;}
132  const ROMSProcessorColumns& processor() const {return processor_p;}
134  return spectralWindow_p;}
135  const ROMSStateColumns& state() const {return state_p;}
136  // </group>
137 
138  // Access to optional subtables
139  // <group>
140  const ROMSDopplerColumns& doppler() const {return doppler_p;}
142  const ROMSSourceColumns& source() const {return source_p;}
143  const ROMSSysCalColumns& sysCal() const {return sysCal_p;}
144  const ROMSWeatherColumns& weather() const {return weather_p;}
145  // </group>
146 
147 private:
148  // Access to subtables
166 };
167 
168 // <summary>
169 // A class to provide easy read-write access to MeasurementSet columns
170 // </summary>
171 
172 // <use visibility=export>
173 
174 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
175 // </reviewed>
176 
177 // <prerequisite>
178 // <li> MeasurementSet
179 // <li> ArrayColumn
180 // <li> ScalarColumn
181 // </prerequisite>
182 //
183 // <etymology>
184 // MSColumns stands for MeasurementSet Table columns.
185 // </etymology>
186 //
187 // <synopsis>
188 // This class provides access to all the subtables and direct access to all the
189 // columns in the MeasurementSet. It does the declaration of all the Scalar
190 // and ArrayColumns with the correct types, so the application programmer
191 // doesn't have to worry about getting those right. There is an access function
192 // for every predefined column. Access to non-predefined columns will still
193 // have to be done with explicit declarations.
194 // </synopsis>
195 //
196 // <example>
197 // <srcblock>
198 // // use as follows
199 // MeasurementSet ms("myMS",Table::Update);
200 // MSColumns msc(ms);
201 // // show data from row 5
202 // cout << msc.data()(5);
203 // // change name of antenna on row 3 in antenna table
204 // msc.antenna().name().put(3,"NewAnt-3");
205 // </srcblock>
206 // </example>
207 //
208 // <motivation>
209 // Having to type long lists of Scalar and Array column declarations gets
210 // very tedious. This class attempts to relieve some of that tedium, while
211 // at the same time concentrating all the declarations in one place,
212 // making Type errors in the column declaration (only caught at run-time) less
213 // probable. Type errors in the use of the columns is caught at compile
214 // time.
215 // </motivation>
216 //
217 // <todo asof="1997/02/01">
218 // <li> We might decide to merge this class with the MeasurementSet
219 // </todo>
220 
222 {
223 public:
224  // Create a columns object that accesses the data in the specified MS
226 
227  // The destructor does nothing special
228  ~MSColumns();
229 
230  // Read-write access to required subtables
231  // <group>
234  MSFeedColumns& feed() {return feed_p;}
244  // </group>
245 
246  // Read-write access to optional subtables
247  // <group>
253  // </group>
254 
255  // Read-only access to required subtables
256  // <group>
257  const ROMSAntennaColumns& antenna() const {return antenna_p;}
259  const ROMSFeedColumns& feed() const {return feed_p;}
260  const ROMSFieldColumns& field() const {return field_p;}
261  const ROMSFlagCmdColumns& flagCmd() const {return flagCmd_p;}
262  const ROMSHistoryColumns& history() const {return history_p;}
264  const ROMSPointingColumns& pointing() const {return pointing_p;}
266  return polarization_p;}
267  const ROMSProcessorColumns& processor() const {return processor_p;}
268  const ROMSSourceColumns& source() const {return source_p;}
270  return spectralWindow_p;}
271  const ROMSStateColumns& state() const {return state_p;}
272  // </group>
273 
274  // Read-only access to optional subtables
275  // <group>
276  const ROMSDopplerColumns& doppler() const {return doppler_p;}
278  const ROMSSysCalColumns& sysCal() const {return sysCal_p;}
279  const ROMSWeatherColumns& weather() const {return weather_p;}
280  // </group>
281 
282  // set the EPOCH reference type in all EPOCH columns in the MS. Note that
283  // only a single EPOCH reference is allowed in the MS. This
284  // <note role=tip>
285  // In principle this function can only be used if the table is empty,
286  // otherwise already written values may thereafter have an incorrect
287  // reference, offset, or unit. However, it is possible that part of the
288  // table gets written before these values are known. In that case the
289  // reference, offset, or units can be set by using a False
290  // <src>tableMustBeEmpty</src> argument.
291  // </note>
292  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
293 
294  // set the DIRECTION reference type for FIELD, POINTING and SOURCE tables
295  // (except for antenna frame directions).
297 
298 private:
299  // Access to subtables
317 };
318 
319 //# Declare extern templates for often used types.
320  extern template class ArrayMeasColumn<MDirection>;
321  extern template class ScalarMeasColumn<MPosition>;
322  extern template class ScalarMeasColumn<MEpoch>;
323  extern template class ArrayQuantColumn<Double>;
324  extern template class ScalarQuantColumn<Double>;
325 
326 } //# NAMESPACE CASACORE - END
327 
328 #endif
329 
330 
const ROMSDopplerColumns & doppler() const
Access to optional subtables.
Definition: MSColumns.h:140
ROMSSpWindowColumns spectralWindow_p
Definition: MSColumns.h:162
const ROMSHistoryColumns & history() const
Definition: MSColumns.h:262
ROMSColumns(const MeasurementSet &ms)
Create a columns object that accesses the data in the specified MS.
const ROMSFlagCmdColumns & flagCmd() const
Definition: MSColumns.h:126
const ROMSFieldColumns & field() const
Definition: MSColumns.h:260
ROMSHistoryColumns history_p
Definition: MSColumns.h:156
MSFlagCmdColumns flagCmd_p
Definition: MSColumns.h:305
MSFieldColumns & field()
Definition: MSColumns.h:235
MSFeedColumns & feed()
Definition: MSColumns.h:234
ROMSStateColumns state_p
Definition: MSColumns.h:163
A class to provide easy read-write access to MSObservation columns.
Definition: MSObsColumns.h:181
MSFreqOffsetColumns & freqOffset()
Definition: MSColumns.h:249
A class to provide easy access to MSField columns.
const ROMSSpWindowColumns & spectralWindow() const
Definition: MSColumns.h:269
MSWeatherColumns & weather()
Definition: MSColumns.h:252
MSHistoryColumns history_p
Definition: MSColumns.h:307
MSSpWindowColumns spectralWindow_p
Definition: MSColumns.h:313
const ROMSDataDescColumns & dataDescription() const
Definition: MSColumns.h:258
const ROMSAntennaColumns & antenna() const
Read-only access to required subtables.
Definition: MSColumns.h:257
MSSourceColumns & source()
Definition: MSColumns.h:250
A class to provide easy read-only access to MSSource columns.
const ROMSSourceColumns & source() const
Definition: MSColumns.h:142
const ROMSFieldColumns & field() const
Definition: MSColumns.h:125
MSAntennaColumns & antenna()
Read-write access to required subtables.
Definition: MSColumns.h:232
~MSColumns()
The destructor does nothing special.
A class to provide easy read-write access to MSPointing columns.
ROMSFieldColumns field_p
Definition: MSColumns.h:153
~ROMSColumns()
The destructor does nothing special.
MSWeatherColumns weather_p
Definition: MSColumns.h:316
A class to provide easy read-write access to MSHistory columns.
const ROMSSourceColumns & source() const
Definition: MSColumns.h:268
MSHistoryColumns & history()
Definition: MSColumns.h:237
const ROMSSysCalColumns & sysCal() const
Definition: MSColumns.h:143
MSSourceColumns source_p
Definition: MSColumns.h:312
const ROMSPointingColumns & pointing() const
Definition: MSColumns.h:129
MSSpWindowColumns & spectralWindow()
Definition: MSColumns.h:242
A class to provide easy read-only access to MSProcessor columns.
A class to provide easy read-only access to MSWeather columns.
const ROMSHistoryColumns & history() const
Definition: MSColumns.h:127
A class to provide easy read-only access to MSASpectralWindow columns.
ROMSWeatherColumns weather_p
Definition: MSColumns.h:165
A class to provide easy read-only access to MSFreqOffset columns.
A class to provide easy read-only access to MSState columns.
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the EPOCH reference type in all EPOCH columns in the MS.
const ROMSObservationColumns & observation() const
Definition: MSColumns.h:128
ROMSSourceColumns source_p
Definition: MSColumns.h:161
MSDataDescColumns dataDesc_p
Definition: MSColumns.h:301
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
A class to provide easy read-write access to MSField columns.
const ROMSProcessorColumns & processor() const
Definition: MSColumns.h:267
A class to provide easy read-write access to MSSource columns.
ROMSSysCalColumns sysCal_p
Definition: MSColumns.h:164
const ROMSProcessorColumns & processor() const
Definition: MSColumns.h:132
MSSysCalColumns sysCal_p
Definition: MSColumns.h:315
MSFlagCmdColumns & flagCmd()
Definition: MSColumns.h:236
const ROMSAntennaColumns & antenna() const
Access to required subtables.
Definition: MSColumns.h:122
const ROMSFreqOffsetColumns & freqOffset() const
Definition: MSColumns.h:277
ROMSFreqOffsetColumns freqOffset_p
Definition: MSColumns.h:155
A class to provide easy read-only access to MSPointing columns.
MSProcessorColumns processor_p
Definition: MSColumns.h:311
A class to provide easy read-only access to MSDoppler columns.
const ROMSDopplerColumns & doppler() const
Read-only access to optional subtables.
Definition: MSColumns.h:276
MSStateColumns & state()
Definition: MSColumns.h:243
const ROMSSpWindowColumns & spectralWindow() const
Definition: MSColumns.h:133
A class to provide easy read-only access to MeasurementSet columns.
Definition: MSColumns.h:111
A class to provide easy read-only access to MSHistory columns.
const ROMSDataDescColumns & dataDescription() const
Definition: MSColumns.h:123
const ROMSStateColumns & state() const
Definition: MSColumns.h:271
ROMSDataDescColumns dataDesc_p
Definition: MSColumns.h:150
ROMSObservationColumns observation_p
Definition: MSColumns.h:157
MSPointingColumns & pointing()
Definition: MSColumns.h:239
const ROMSFreqOffsetColumns & freqOffset() const
Definition: MSColumns.h:141
A class to provide easy read-write access to MSSpectralWindow columns.
A class to provide easy read-write access to MSSysCal columns.
ROMSFeedColumns feed_p
Definition: MSColumns.h:152
A class to provide easy read-write access to MSProcessor columns.
const ROMSSysCalColumns & sysCal() const
Definition: MSColumns.h:278
MSDopplerColumns & doppler()
Read-write access to optional subtables.
Definition: MSColumns.h:248
MSAntennaColumns antenna_p
Access to subtables.
Definition: MSColumns.h:300
A class to provide easy read-only access to MSDataDesc columns.
const ROMSFeedColumns & feed() const
Definition: MSColumns.h:124
A class to provide easy read-write access to MSAntenna columns.
ROMSPolarizationColumns polarization_p
Definition: MSColumns.h:159
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const ROMSWeatherColumns & weather() const
Definition: MSColumns.h:144
const ROMSPolarizationColumns & polarization() const
Definition: MSColumns.h:265
A class to provide easy read-write access to MSDoppler columns.
const ROMSObservationColumns & observation() const
Definition: MSColumns.h:263
MSFieldColumns field_p
Definition: MSColumns.h:304
const ROMSPolarizationColumns & polarization() const
Definition: MSColumns.h:130
MSFreqOffsetColumns freqOffset_p
Definition: MSColumns.h:306
const ROMSPointingColumns & pointing() const
Definition: MSColumns.h:264
MSObservationColumns & observation()
Definition: MSColumns.h:238
MSDataDescColumns & dataDescription()
Definition: MSColumns.h:233
ROMSPointingColumns pointing_p
Definition: MSColumns.h:158
A class to provide easy read-write access to MSFeed columns.
A Table intended to hold astronomical data (a set of Measurements).
A class to provide easy read-write access to MSPolarization columns.
Definition: MSPolColumns.h:163
MSColumns(MeasurementSet &ms)
Create a columns object that accesses the data in the specified MS.
MSPointingColumns pointing_p
Definition: MSColumns.h:309
MSProcessorColumns & processor()
Definition: MSColumns.h:241
A class to provide easy read-only access to MSObservation columns.
Definition: MSObsColumns.h:80
A class to provide easy read-only access to MSPolarization columns.
Definition: MSPolColumns.h:75
const ROMSFeedColumns & feed() const
Definition: MSColumns.h:259
A class to provide easy read-only access to MSFeed columns.
Definition: MSFeedColumns.h:84
A class for easy read-write access to MeasurementSet main table columns.
MSStateColumns state_p
Definition: MSColumns.h:314
ROMSProcessorColumns processor_p
Definition: MSColumns.h:160
A class to provide easy read-write access to MeasurementSet columns.
Definition: MSColumns.h:221
const ROMSStateColumns & state() const
Definition: MSColumns.h:135
ROMSFlagCmdColumns flagCmd_p
Definition: MSColumns.h:154
const ROMSFlagCmdColumns & flagCmd() const
Definition: MSColumns.h:261
A class to provide easy read-only access to MSAntenna columns.
MSFeedColumns feed_p
Definition: MSColumns.h:303
A class to provide easy read-write access to MSState columns.
ROMSDopplerColumns doppler_p
Definition: MSColumns.h:151
MSSysCalColumns & sysCal()
Definition: MSColumns.h:251
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
const ROMSWeatherColumns & weather() const
Definition: MSColumns.h:279
MSPolarizationColumns & polarization()
Definition: MSColumns.h:240
A class to provide easy read-only access to MSFlagCmd columns.
const Bool True
Definition: aipstype.h:43
ROMSAntennaColumns antenna_p
Access to subtables.
Definition: MSColumns.h:149
A class to provide easy read-only access to MSSysCal columns.
A class to provide easy read-write access to MSFlagCmd columns.
A class to provide easy read-write access to MSFreqOffset columns.
void setDirectionRef(MDirection::Types ref)
set the DIRECTION reference type for FIELD, POINTING and SOURCE tables (except for antenna frame dire...
MSPolarizationColumns polarization_p
Definition: MSColumns.h:310
A class for easy read-only access to MeasurementSet main table columns.
MSDopplerColumns doppler_p
Definition: MSColumns.h:302
A class to provide easy read-write access to MSDataDescription columns.
MSObservationColumns observation_p
Definition: MSColumns.h:308
A class to provide easy read-write access to MSWeather columns.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42