casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSObsColumns.h
Go to the documentation of this file.
1 //# MSObservationColumns.h: provides easy access to MSObservation 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_MSOBSCOLUMNS_H
29 #define MS_MSOBSCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
41 
42 namespace casacore { //# NAMESPACE CASACORE - BEGIN
43 
44 class MSObservation;
45 
46 // <summary>
47 // A class to provide easy read-only access to MSObservation columns
48 // </summary>
49 
50 // <use visibility=export>
51 
52 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
53 // </reviewed>
54 
55 // <prerequisite>
56 // <li> MSObservation
57 // <li> ArrayColumn
58 // <li> ScalarColumn
59 // </prerequisite>
60 //
61 // <etymology>
62 // ROMSObservationColumns stands for Read-Only MeasurementSet Observation
63 // Table columns.
64 // </etymology>
65 //
66 // <synopsis>
67 // This class provides read-only access to the columns in the MSObservation
68 // Table. It does the declaration of all the Scalar and ArrayColumns with the
69 // correct types, so the application programmer doesn't have to worry about
70 // getting those right. There is an access function for every predefined
71 // column. Access to non-predefined columns will still have to be done with
72 // explicit declarations. See <linkto class=ROMSColumns>
73 // ROMSColumns</linkto> for an example.
74 // </synopsis>
75 //
76 // <motivation>
77 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
78 // </motivation>
79 
81 {
82 public:
83  // Create a columns object that accesses the data in the specified Table
84  ROMSObservationColumns(const MSObservation& msObservation);
85 
86  // The destructor does nothing special
88 
89  // Access to required columns
90  // <group>
91  const ROScalarColumn<Bool>& flagRow() const {return flagRow_p;}
92  const ROArrayColumn<String>& log() const {return log_p;}
93  const ROScalarColumn<String>& observer() const {return observer_p;}
94  const ROScalarColumn<String>& project() const {return project_p;}
95  const ROScalarColumn<Double>& releaseDate() const {return releaseDate_p;}
96  const ROScalarQuantColumn<Double>& releaseDateQuant() const {
97  return releaseDateQuant_p;}
98  const ROScalarMeasColumn<MEpoch>& releaseDateMeas() const {
99  return releaseDateMeas_p;}
100  const ROArrayColumn<String>& schedule() const {return schedule_p;}
101  const ROScalarColumn<String>& scheduleType() const {return scheduleType_p;}
102  const ROScalarColumn<String>& telescopeName() const {return telescopeName_p;}
103  const ROArrayColumn<Double>& timeRange() const {return timeRange_p;}
104  const ROArrayQuantColumn<Double>& timeRangeQuant() const {
105  return timeRangeQuant_p;}
106  const ROArrayMeasColumn<MEpoch>& timeRangeMeas() const {
107  return timeRangeMeas_p;}
108  // </group>
109 
110  // Convenience function that returns the number of rows in any of the columns
111  uInt nrow() const {return flagRow_p.nrow();}
112 
113 protected:
114  //# default constructor creates a object that is not usable. Use the attach
115  //# function correct this.
117 
118  //# attach this object to the supplied table.
119  void attach(const MSObservation& msObservation);
120 
121 private:
122  //# Make the assignment operator and the copy constructor private to prevent
123  //# any compiler generated one from being used.
126 
127  //# required columns
128  ROScalarColumn<Bool> flagRow_p;
129  ROArrayColumn<String> log_p;
130  ROScalarColumn<String> observer_p;
131  ROScalarColumn<String> project_p;
132  ROScalarColumn<Double> releaseDate_p;
133  ROArrayColumn<String> schedule_p;
134  ROScalarColumn<String> scheduleType_p;
135  ROScalarColumn<String> telescopeName_p;
136  ROArrayColumn<Double> timeRange_p;
137 
138  //# Access to Measure columns
139  ROScalarMeasColumn<MEpoch> releaseDateMeas_p;
140  ROArrayMeasColumn<MEpoch> timeRangeMeas_p;
141 
142  //# Access to Quantum columns
143  ROScalarQuantColumn<Double> releaseDateQuant_p;
144  ROArrayQuantColumn<Double> timeRangeQuant_p;
145 };
146 
147 // <summary>
148 // A class to provide easy read-write access to MSObservation columns
149 // </summary>
150 
151 // <use visibility=export>
152 
153 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
154 // </reviewed>
155 
156 // <prerequisite>
157 // <li> MSObservation
158 // <li> ArrayColumn
159 // <li> ScalarColumn
160 // </prerequisite>
161 //
162 // <etymology>
163 // MSObservationColumns stands for MeasurementSet Observation Table
164 // columns.
165 // </etymology>
166 //
167 // <synopsis>
168 // This class provides access to the columns in the MSObservation Table,
169 // it does the declaration of all the Scalar and ArrayColumns with the
170 // correct types, so the application programmer doesn't have to
171 // worry about getting those right. There is an access function
172 // for every predefined column. Access to non-predefined columns will still
173 // have to be done with explicit declarations.
174 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
175 // </synopsis>
176 //
177 // <motivation>
178 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
179 // </motivation>
180 
182 {
183 public:
184  // Create a columns object that accesses the data in the specified Table
185  MSObservationColumns(MSObservation& msObservation);
186 
187  // The desctructor does nothing special
189 
190  // Read-write access to required columns
191  // <group>
205  // </group>
206 
207  // Read-only access to required columns
208  // <group>
209  const ROScalarColumn<Bool>& flagRow() const {
211  const ROArrayColumn<String>& log() const {
212  return ROMSObservationColumns::log();}
213  const ROScalarColumn<String>& observer() const {
215  const ROScalarColumn<String>& project() const {
217  const ROScalarColumn<Double>& releaseDate() const {
219  const ROScalarQuantColumn<Double>& releaseDateQuant() const {
221  const ROScalarMeasColumn<MEpoch>& releaseDateMeas() const {
223  const ROArrayColumn<String>& schedule() const {
225  const ROScalarColumn<String>& scheduleType() const {
227  const ROScalarColumn<String>& telescopeName() const {
229  const ROArrayColumn<Double>& timeRange() const {
231  const ROArrayQuantColumn<Double>& timeRangeQuant() const {
233  const ROArrayMeasColumn<MEpoch>& timeRangeMeas() const {
235  // </group>
236 
237  // set the epoch type for the TIME_RANGE & RELEASE_DATE columns.
238  // <note role=tip>
239  // In principle this function can only be used if the table is empty,
240  // otherwise already written values may thereafter have an incorrect
241  // reference, offset, or unit. However, it is possible that part of the
242  // table gets written before these values are known. In that case the
243  // reference, offset, or units can be set by using a False
244  // <src>tableMustBeEmpty</src> argument.
245  // </note>
246  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
247 
248 protected:
249  //# default constructor creates a object that is not usable. Use the attach
250  //# function correct this.
252 
253  //# attach this object to the supplied table.
254  void attach(MSObservation& msObservation);
255 
256 private:
257  //# Make the assignment operator and the copy constructor private to prevent
258  //# any compiler generated one from being used.
261 
262  //# required columns
272 
273  //# Access to Measure columns
276 
277  //# Access to Quantum columns
280 };
281 
282 } //# NAMESPACE CASACORE - END
283 
284 #endif
ROScalarColumn< String > telescopeName_p
Definition: MSObsColumns.h:135
ArrayMeasColumn< MEpoch > timeRangeMeas_p
Definition: MSObsColumns.h:275
const ROScalarColumn< String > & project() const
Definition: MSObsColumns.h:94
~ROMSObservationColumns()
The destructor does nothing special.
const ROArrayColumn< String > & schedule() const
Definition: MSObsColumns.h:223
const ROScalarColumn< String > & scheduleType() const
Definition: MSObsColumns.h:101
const ROScalarColumn< String > & observer() const
Definition: MSObsColumns.h:93
A Table intended to hold a MeasurementSet OBSERVATION table.
Definition: MSObservation.h:78
const ROScalarMeasColumn< MEpoch > & releaseDateMeas() const
Definition: MSObsColumns.h:221
A class to provide easy read-write access to MSObservation columns.
Definition: MSObsColumns.h:181
ScalarColumn< Double > & releaseDate()
Definition: MSObsColumns.h:196
ROArrayColumn< Double > timeRange_p
Definition: MSObsColumns.h:136
ArrayColumn< String > schedule_p
Definition: MSObsColumns.h:268
void attach(MSObservation &msObservation)
const ROScalarColumn< Bool > & flagRow() const
Read-only access to required columns.
Definition: MSObsColumns.h:209
const ROArrayColumn< String > & schedule() const
Definition: MSObsColumns.h:100
ArrayColumn< String > log_p
Definition: MSObsColumns.h:264
ROScalarMeasColumn< MEpoch > releaseDateMeas_p
Definition: MSObsColumns.h:139
ROMSObservationColumns & operator=(const ROMSObservationColumns &)
ScalarMeasColumn< MEpoch > & releaseDateMeas()
Definition: MSObsColumns.h:198
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
Definition: MSObsColumns.h:111
ScalarQuantColumn< Double > & releaseDateQuant()
Definition: MSObsColumns.h:197
ROScalarColumn< String > project_p
Definition: MSObsColumns.h:131
ScalarQuantColumn< Double > releaseDateQuant_p
Definition: MSObsColumns.h:278
ArrayColumn< String > & schedule()
Definition: MSObsColumns.h:199
ROArrayQuantColumn< Double > timeRangeQuant_p
Definition: MSObsColumns.h:144
const ROArrayMeasColumn< MEpoch > & timeRangeMeas() const
Definition: MSObsColumns.h:233
ArrayColumn< String > & log()
Definition: MSObsColumns.h:193
ROScalarColumn< Double > releaseDate_p
Definition: MSObsColumns.h:132
ROScalarQuantColumn< Double > releaseDateQuant_p
Definition: MSObsColumns.h:143
const ROArrayQuantColumn< Double > & timeRangeQuant() const
Definition: MSObsColumns.h:104
~MSObservationColumns()
The desctructor does nothing special.
ScalarColumn< String > telescopeName_p
Definition: MSObsColumns.h:270
const ROScalarMeasColumn< MEpoch > & releaseDateMeas() const
Definition: MSObsColumns.h:98
ROArrayMeasColumn< MEpoch > timeRangeMeas_p
Definition: MSObsColumns.h:140
const ROScalarQuantColumn< Double > & releaseDateQuant() const
Definition: MSObsColumns.h:96
ScalarColumn< String > scheduleType_p
Definition: MSObsColumns.h:269
ScalarColumn< Double > releaseDate_p
Definition: MSObsColumns.h:267
const ROScalarColumn< Double > & releaseDate() const
Definition: MSObsColumns.h:95
ArrayQuantColumn< Double > & timeRangeQuant()
Definition: MSObsColumns.h:203
ArrayColumn< Double > & timeRange()
Definition: MSObsColumns.h:202
ScalarColumn< String > & scheduleType()
Definition: MSObsColumns.h:200
const ROScalarQuantColumn< Double > & releaseDateQuant() const
Definition: MSObsColumns.h:219
ROArrayColumn< String > log_p
Definition: MSObsColumns.h:129
const ROScalarColumn< String > & scheduleType() const
Definition: MSObsColumns.h:225
ArrayQuantColumn< Double > timeRangeQuant_p
Definition: MSObsColumns.h:279
const ROArrayQuantColumn< Double > & timeRangeQuant() const
Definition: MSObsColumns.h:231
const ROScalarColumn< String > & telescopeName() const
Definition: MSObsColumns.h:227
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
Read and write access to an array table column with arbitrary data type.
Definition: Reweighter.h:48
ScalarColumn< Bool > flagRow_p
Definition: MSObsColumns.h:263
const ROScalarColumn< Bool > & flagRow() const
Access to required columns.
Definition: MSObsColumns.h:91
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME_RANGE &amp; RELEASE_DATE columns.
const ROScalarColumn< String > & project() const
Definition: MSObsColumns.h:215
ScalarColumn< String > & observer()
Definition: MSObsColumns.h:194
ROScalarColumn< String > observer_p
Definition: MSObsColumns.h:130
ArrayColumn< Double > timeRange_p
Definition: MSObsColumns.h:271
ArrayMeasColumn< MEpoch > & timeRangeMeas()
Definition: MSObsColumns.h:204
ScalarColumn< String > & project()
Definition: MSObsColumns.h:195
MSObservationColumns & operator=(const MSObservationColumns &)
void attach(const MSObservation &msObservation)
ROArrayColumn< String > schedule_p
Definition: MSObsColumns.h:133
const ROArrayMeasColumn< MEpoch > & timeRangeMeas() const
Definition: MSObsColumns.h:106
A class to provide easy read-only access to MSObservation columns.
Definition: MSObsColumns.h:80
ROScalarColumn< Bool > flagRow_p
Definition: MSObsColumns.h:128
ScalarColumn< String > observer_p
Definition: MSObsColumns.h:265
const ROArrayColumn< String > & log() const
Definition: MSObsColumns.h:211
const ROScalarColumn< String > & telescopeName() const
Definition: MSObsColumns.h:102
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
const ROArrayColumn< Double > & timeRange() const
Definition: MSObsColumns.h:229
ScalarColumn< Bool > & flagRow()
Read-write access to required columns.
Definition: MSObsColumns.h:192
ROScalarColumn< String > scheduleType_p
Definition: MSObsColumns.h:134
const Bool True
Definition: aipstype.h:43
const ROScalarColumn< String > & observer() const
Definition: MSObsColumns.h:213
const ROArrayColumn< Double > & timeRange() const
Definition: MSObsColumns.h:103
ScalarColumn< String > & telescopeName()
Definition: MSObsColumns.h:201
ScalarMeasColumn< MEpoch > releaseDateMeas_p
Definition: MSObsColumns.h:274
const ROArrayColumn< String > & log() const
Definition: MSObsColumns.h:92
unsigned int uInt
Definition: aipstype.h:51
const ROScalarColumn< Double > & releaseDate() const
Definition: MSObsColumns.h:217
ScalarColumn< String > project_p
Definition: MSObsColumns.h:266
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42