casacore
 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 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> ScalarColumn
54 // </prerequisite>
55 //
56 // <etymology>
57 // MSFreqOffsetColumns stands for MeasurementSet FreqOffset Table
58 // columns.
59 // </etymology>
60 //
61 // <synopsis>
62 // This class provides access to the columns in the MSFreqOffset Table,
63 // it does the declaration of all the Scalar and ArrayColumns with the
64 // correct types, so the application programmer doesn't have to
65 // worry about getting those right. There is an access function
66 // for every predefined column. Access to non-predefined columns will still
67 // have to be done with explicit declarations.
68 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
69 // </synopsis>
70 //
71 // <motivation>
72 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
73 // </motivation>
74 
76 {
77 public:
78  // Create a columns object that accesses the data in the specified Table
79  MSFreqOffsetColumns(const MSFreqOffset& msFreqOffset);
80 
81  // The destructor does nothing special
83 
84  // Is this object defined? (MSFreqOffset table is optional)
85  Bool isNull() const {return isNull_p;}
86 
87  // Access to required columns
88  // <group>
100  // </group>
101 
102  // Const access to required columns
103  // <group>
104  const ScalarColumn<Int>& antenna1() const {return antenna1_p;}
105  const ScalarColumn<Int>& antenna2() const {return antenna2_p;}
106  const ScalarColumn<Int>& feedId() const {return feedId_p;}
107  const ScalarColumn<Double>& interval() const {return interval_p;}
109  const ScalarColumn<Double>& offset() const {return offset_p;}
112  const ScalarColumn<Double>& time() const {return time_p;}
115  // </group>
116 
117  // Convenience function that returns the number of rows in any of the
118  // columns. Returns zero if the object is null.
119  rownr_t nrow() const {return isNull() ? 0 : antenna1_p.nrow();}
120 
121  // set the epoch type for the TIME column.
122  // <note role=tip>
123  // In principle this function can only be used if the table is empty,
124  // otherwise already written values may thereafter have an incorrect
125  // reference, offset, or unit. However, it is possible that part of the
126  // table gets written before these values are known. In that case the
127  // reference, offset, or units can be set by using a False
128  // <src>tableMustBeEmpty</src> argument.
129  // </note>
130  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
131 
132 protected:
133  //# default constructor creates a object that is not usable. Use the attach
134  //# function correct this.
136 
137  //# attach this object to the supplied table.
138  void attach(const MSFreqOffset& msFreqOffset);
139 
140 private:
141  //# Make the assignment operator and the copy constructor private to prevent
142  //# any compiler generated one from being used.
145 
146  //# Is the object not attached to a Table.
148 
149  //# required columns
157 
158  //# Access to Measure columns
160 
161  //# Access to Quantum columns
165 };
166 
167 //# Define the RO version for backward compatibility.
169 
170 } //# NAMESPACE CASACORE - END
171 
172 #endif
ScalarQuantColumn< Double > timeQuant_p
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
MSFreqOffsetColumns & operator=(const MSFreqOffsetColumns &)
const ScalarColumn< Int > & antenna1() const
Const access to required columns.
ScalarColumn< Int > antenna1_p
~MSFreqOffsetColumns()
The destructor does nothing special.
ScalarColumn< Double > & offset()
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
ScalarQuantColumn< Double > offsetQuant_p
ScalarColumn< Double > & time()
const ScalarColumn< Int > & feedId() const
ScalarColumn< Int > spectralWindowId_p
ScalarColumn< Int > & antenna1()
Access to required columns.
const ScalarQuantColumn< Double > & offsetQuant() const
ScalarColumn< Int > & antenna2()
const ScalarMeasColumn< MEpoch > & timeMeas() const
rownr_t nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
const ScalarQuantColumn< Double > & timeQuant() const
const ScalarColumn< Int > & antenna2() const
ScalarColumn< Double > interval_p
MSFreqOffsetColumns ROMSFreqOffsetColumns
Bool isNull() const
Is this object defined? (MSFreqOffset table is optional)
ScalarQuantColumn< Double > & offsetQuant()
ScalarQuantColumn< Double > & timeQuant()
ScalarColumn< Double > offset_p
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ScalarQuantColumn< Double > intervalQuant_p
const ScalarColumn< Double > & offset() const
const ScalarColumn< Double > & interval() const
ScalarColumn< Double > time_p
ScalarColumn< Int > antenna2_p
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
void attach(const MSFreqOffset &msFreqOffset)
ScalarColumn< Int > & feedId()
ScalarColumn< Double > & interval()
const ScalarColumn< Double > & time() const
ScalarQuantColumn< Double > & intervalQuant()
ScalarColumn< Int > & spectralWindowId()
const ScalarQuantColumn< Double > & intervalQuant() const
ScalarMeasColumn< MEpoch > & timeMeas()
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ScalarMeasColumn< MEpoch > timeMeas_p
const Bool True
Definition: aipstype.h:43
const ScalarColumn< Int > & spectralWindowId() const
A class to provide easy access to MSFreqOffset columns.
A Table intended to hold a MeasurementSet FREQ_OFFSET table.
Definition: MSFreqOffset.h:78