casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSFreqOffColumns.h
Go to the documentation of this file.
1 //# MSFreqOffsetColumns.h: provides easy access to FREQ_OFFSET columns
2 //# Copyright (C) 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_MSFREQOFFCOLUMNS_H
29 #define MS_MSFREQOFFCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
37 
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39 
40 class MSFreqOffset;
41 
42 // <summary>
43 // A class to provide easy read-only access to MSFreqOffset columns
44 // </summary>
45 
46 // <use visibility=export>
47 
48 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
49 // </reviewed>
50 
51 // <prerequisite>
52 // <li> MSFreqOffset
53 // <li> ArrayColumn
54 // <li> ScalarColumn
55 // </prerequisite>
56 //
57 // <etymology>
58 // ROMSFreqOffsetColumns stands for Read-Only MeasurementSet FreqOffset
59 // Table columns.
60 // </etymology>
61 //
62 // <synopsis>
63 // This class provides read-only access to the columns in the MSFreqOffset
64 // Table. It does the declaration of all the Scalar and ArrayColumns with the
65 // correct types, so the application programmer doesn't have to worry about
66 // getting those right. There is an access function for every predefined
67 // column. Access to non-predefined columns will still have to be done with
68 // explicit declarations. See <linkto class=ROMSColumns>
69 // ROMSColumns</linkto> for an example.
70 
71 // </synopsis>
72 //
73 // <motivation>
74 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
75 // </motivation>
76 
78 {
79 public:
80  // Create a columns object that accesses the data in the specified Table
81  ROMSFreqOffsetColumns(const MSFreqOffset& msFreqOffset);
82 
83  // The destructor does nothing special
85 
86  // Is this object defined? (MSFreqOffset table is optional)
87  Bool isNull() const {return isNull_p;}
88 
89  // Access to columns
90  // <group>
91  const ROScalarColumn<Int>& antenna1() const {return antenna1_p;}
92  const ROScalarColumn<Int>& antenna2() const {return antenna2_p;}
93  const ROScalarColumn<Int>& feedId() const {return feedId_p;}
94  const ROScalarColumn<Double>& interval() const {return interval_p;}
95  const ROScalarQuantColumn<Double>& intervalQuant() const {
96  return intervalQuant_p;}
97  const ROScalarColumn<Double>& offset() const {return offset_p;}
98  const ROScalarQuantColumn<Double>& offsetQuant() const {
99  return offsetQuant_p;}
100  const ROScalarColumn<Int>& spectralWindowId() const {
101  return spectralWindowId_p;}
102  const ROScalarColumn<Double>& time() const {return time_p;}
103  const ROScalarQuantColumn<Double>& timeQuant() const {return timeQuant_p;}
104  const ROScalarMeasColumn<MEpoch>& timeMeas() const {return timeMeas_p;}
105  // </group>
106 
107  // Convenience function that returns the number of rows in any of the
108  // columns. Returns zero if the object is null.
109  uInt nrow() const {return isNull() ? 0 : antenna1_p.nrow();}
110 
111 protected:
112  //# default constructor creates a object that is not usable. Use the attach
113  //# function correct this.
115 
116  //# attach this object to the supplied table.
117  void attach(const MSFreqOffset& msFreqOffset);
118 
119 private:
120  //# Make the assignment operator and the copy constructor private to prevent
121  //# any compiler generated one from being used.
124 
125  //# Is the object not attached to a Table.
127 
128  //# required columns
129  ROScalarColumn<Int> antenna1_p;
130  ROScalarColumn<Int> antenna2_p;
131  ROScalarColumn<Int> feedId_p;
132  ROScalarColumn<Double> interval_p;
133  ROScalarColumn<Double> offset_p;
134  ROScalarColumn<Int> spectralWindowId_p;
135  ROScalarColumn<Double> time_p;
136 
137  //# Access to Measure columns
138  ROScalarMeasColumn<MEpoch> timeMeas_p;
139 
140  //# Access to Quantum columns
141  ROScalarQuantColumn<Double> intervalQuant_p;
142  ROScalarQuantColumn<Double> offsetQuant_p;
143  ROScalarQuantColumn<Double> timeQuant_p;
144 };
145 
146 // <summary>
147 // A class to provide easy read-write access to MSFreqOffset columns
148 // </summary>
149 
150 // <use visibility=export>
151 
152 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
153 // </reviewed>
154 
155 // <prerequisite>
156 // <li> MSFreqOffset
157 // <li> ScalarColumn
158 // </prerequisite>
159 //
160 // <etymology>
161 // MSFreqOffsetColumns stands for MeasurementSet FreqOffset Table
162 // columns.
163 // </etymology>
164 //
165 // <synopsis>
166 // This class provides access to the columns in the MSFreqOffset Table,
167 // it does the declaration of all the Scalar and ArrayColumns with the
168 // correct types, so the application programmer doesn't have to
169 // worry about getting those right. There is an access function
170 // for every predefined column. Access to non-predefined columns will still
171 // have to be done with explicit declarations.
172 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
173 // </synopsis>
174 //
175 // <motivation>
176 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
177 // </motivation>
178 
180 {
181 public:
182  // Create a columns object that accesses the data in the specified Table
183  MSFreqOffsetColumns(MSFreqOffset& msFreqOffset);
184 
185  // The destructor does nothing special
187 
188  // Read-write access to required columns
189  // <group>
201  // </group>
202 
203  // Read-only access to required columns
204  // <group>
205  const ROScalarColumn<Int>& antenna1() const {
207  const ROScalarColumn<Int>& antenna2() const {
209  const ROScalarColumn<Int>& feedId() const {
211  const ROScalarColumn<Double>& interval() const {
213  const ROScalarQuantColumn<Double>& intervalQuant() const {
215  const ROScalarColumn<Double>& offset() const {
217  const ROScalarQuantColumn<Double>& offsetQuant() const {
219  const ROScalarColumn<Int>& spectralWindowId() const {
221  const ROScalarColumn<Double>& time() const {
222  return ROMSFreqOffsetColumns::time();}
223  const ROScalarQuantColumn<Double>& timeQuant() const {
225  const ROScalarMeasColumn<MEpoch>& timeMeas() const {
227  // </group>
228 
229  // set the epoch type for the TIME column.
230  // <note role=tip>
231  // In principle this function can only be used if the table is empty,
232  // otherwise already written values may thereafter have an incorrect
233  // reference, offset, or unit. However, it is possible that part of the
234  // table gets written before these values are known. In that case the
235  // reference, offset, or units can be set by using a False
236  // <src>tableMustBeEmpty</src> argument.
237  // </note>
238  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
239 
240 protected:
241  //# default constructor creates a object that is not usable. Use the attach
242  //# function correct this.
244 
245  //# attach this object to the supplied table.
246  void attach(MSFreqOffset& msFreqOffset);
247 
248 private:
249  //# Make the assignment operator and the copy constructor private to prevent
250  //# any compiler generated one from being used.
253 
254  //# required columns
262 
263  //# Access to Measure columns
265 
266  //# Access to Quantum columns
270 };
271 
272 
273 } //# NAMESPACE CASACORE - END
274 
275 #endif
const ROScalarMeasColumn< MEpoch > & timeMeas() const
const ROScalarQuantColumn< Double > & offsetQuant() const
ScalarQuantColumn< Double > timeQuant_p
ROScalarMeasColumn< MEpoch > timeMeas_p
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
MSFreqOffsetColumns & operator=(const MSFreqOffsetColumns &)
const ROScalarQuantColumn< Double > & timeQuant() const
ROMSFreqOffsetColumns & operator=(const ROMSFreqOffsetColumns &)
const ROScalarColumn< Int > & antenna2() const
ROScalarColumn< Double > interval_p
ROScalarColumn< Double > time_p
ScalarColumn< Int > antenna1_p
const ROScalarColumn< Int > & antenna1() const
Read-only access to required columns.
const ROScalarColumn< Double > & time() const
~MSFreqOffsetColumns()
The destructor does nothing special.
ScalarColumn< Double > & offset()
ScalarQuantColumn< Double > offsetQuant_p
const ROScalarColumn< Int > & feedId() const
ScalarColumn< Double > & time()
A class to provide easy read-only access to MSFreqOffset columns.
const ROScalarColumn< Int > & antenna1() const
Access to columns.
ScalarColumn< Int > spectralWindowId_p
ScalarColumn< Int > & antenna1()
Read-write access to required columns.
const ROScalarMeasColumn< MEpoch > & timeMeas() const
ScalarColumn< Int > & antenna2()
const ROScalarColumn< Int > & antenna2() const
const ROScalarColumn< Double > & time() const
const ROScalarColumn< Int > & spectralWindowId() const
ROScalarColumn< Int > antenna2_p
void attach(MSFreqOffset &msFreqOffset)
ScalarColumn< Double > interval_p
~ROMSFreqOffsetColumns()
The destructor does nothing special.
ROScalarColumn< Double > offset_p
ScalarQuantColumn< Double > & offsetQuant()
ScalarQuantColumn< Double > & timeQuant()
const ROScalarColumn< Int > & spectralWindowId() const
ROScalarColumn< Int > antenna1_p
ScalarColumn< Double > offset_p
Bool isNull() const
Is this object defined? (MSFreqOffset table is optional)
const ROScalarQuantColumn< Double > & intervalQuant() const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ScalarQuantColumn< Double > intervalQuant_p
const ROScalarQuantColumn< Double > & timeQuant() const
ROScalarColumn< Int > feedId_p
const ROScalarColumn< Double > & offset() const
ScalarColumn< Double > time_p
ScalarColumn< Int > antenna2_p
ROScalarQuantColumn< Double > offsetQuant_p
const ROScalarColumn< Double > & offset() const
const ROScalarColumn< Double > & interval() const
ScalarColumn< Int > & feedId()
ScalarColumn< Double > & interval()
const ROScalarColumn< Int > & feedId() const
ScalarQuantColumn< Double > & intervalQuant()
ScalarColumn< Int > & spectralWindowId()
ScalarMeasColumn< MEpoch > & timeMeas()
void attach(const MSFreqOffset &msFreqOffset)
ROScalarQuantColumn< Double > intervalQuant_p
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ROScalarQuantColumn< Double > timeQuant_p
ROScalarColumn< Int > spectralWindowId_p
const ROScalarColumn< Double > & interval() const
const ROScalarQuantColumn< Double > & offsetQuant() const
const ROScalarQuantColumn< Double > & intervalQuant() const
ScalarMeasColumn< MEpoch > timeMeas_p
const Bool True
Definition: aipstype.h:43
A class to provide easy read-write access to MSFreqOffset columns.
A Table intended to hold a MeasurementSet FREQ_OFFSET table.
Definition: MSFreqOffset.h:78
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42