casacore
Loading...
Searching...
No Matches
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: casa-feedback@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#ifndef MS_MSFREQOFFCOLUMNS_H
27#define MS_MSFREQOFFCOLUMNS_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/measures/Measures/MEpoch.h>
31#include <casacore/measures/Measures/MCEpoch.h>
32#include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
33#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
34#include <casacore/tables/Tables/ScalarColumn.h>
35
36namespace casacore { // # NAMESPACE CASACORE - BEGIN
37
38class MSFreqOffset;
39
40// <summary>
41// A class to provide easy access to MSFreqOffset columns
42// </summary>
43
44// <use visibility=export>
45
46// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
47// </reviewed>
48
49// <prerequisite>
50// <li> MSFreqOffset
51// <li> ScalarColumn
52// </prerequisite>
53//
54// <etymology>
55// MSFreqOffsetColumns stands for MeasurementSet FreqOffset Table
56// columns.
57// </etymology>
58//
59// <synopsis>
60// This class provides access to the columns in the MSFreqOffset Table,
61// it does the declaration of all the Scalar and ArrayColumns with the
62// correct types, so the application programmer doesn't have to
63// worry about getting those right. There is an access function
64// for every predefined column. Access to non-predefined columns will still
65// have to be done with explicit declarations.
66// See <linkto class=MSColumns> MSColumns</linkto> for an example.
67// </synopsis>
68//
69// <motivation>
70// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
71// </motivation>
72
74 public:
75 // Create a columns object that accesses the data in the specified Table
76 MSFreqOffsetColumns(const MSFreqOffset& msFreqOffset);
77
78 // The destructor does nothing special
80
81 // Is this object defined? (MSFreqOffset table is optional)
82 Bool isNull() const { return isNull_p; }
83
84 // Access to required columns
85 // <group>
97 // </group>
98
99 // Const access to required columns
100 // <group>
101 const ScalarColumn<Int>& antenna1() const { return antenna1_p; }
102 const ScalarColumn<Int>& antenna2() const { return antenna2_p; }
103 const ScalarColumn<Int>& feedId() const { return feedId_p; }
104 const ScalarColumn<Double>& interval() const { return interval_p; }
106 const ScalarColumn<Double>& offset() const { return offset_p; }
109 const ScalarColumn<Double>& time() const { return time_p; }
112 // </group>
113
114 // Convenience function that returns the number of rows in any of the
115 // columns. Returns zero if the object is null.
116 rownr_t nrow() const { return isNull() ? 0 : antenna1_p.nrow(); }
117
118 // set the epoch type for the TIME column.
119 // <note role=tip>
120 // In principle this function can only be used if the table is empty,
121 // otherwise already written values may thereafter have an incorrect
122 // reference, offset, or unit. However, it is possible that part of the
123 // table gets written before these values are known. In that case the
124 // reference, offset, or units can be set by using a False
125 // <src>tableMustBeEmpty</src> argument.
126 // </note>
127 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty = True);
128
129 protected:
130 // # default constructor creates a object that is not usable. Use the attach
131 // # function correct this.
133
134 // # attach this object to the supplied table.
135 void attach(const MSFreqOffset& msFreqOffset);
136
137 private:
138 // # Make the assignment operator and the copy constructor private to prevent
139 // # any compiler generated one from being used.
142
143 // # Is the object not attached to a Table.
145
146 // # required columns
154
155 // # Access to Measure columns
157
158 // # Access to Quantum columns
162};
163
164// # Define the RO version for backward compatibility.
166
167} // namespace casacore
168
169#endif
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:116
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
const ScalarColumn< Int > & feedId() const
ScalarColumn< Double > & time()
const ScalarQuantColumn< Double > & timeQuant() const
ScalarColumn< Double > offset_p
const ScalarColumn< Double > & interval() const
ScalarColumn< Int > & antenna1()
Access to required columns.
ScalarQuantColumn< Double > & intervalQuant()
ScalarColumn< Double > & interval()
const ScalarMeasColumn< MEpoch > & timeMeas() const
ScalarQuantColumn< Double > & timeQuant()
ScalarQuantColumn< Double > timeQuant_p
const ScalarColumn< Double > & offset() const
ScalarColumn< Int > & feedId()
ScalarColumn< Int > spectralWindowId_p
ScalarQuantColumn< Double > & offsetQuant()
MSFreqOffsetColumns(const MSFreqOffset &msFreqOffset)
Create a columns object that accesses the data in the specified Table.
ScalarColumn< Double > & offset()
ScalarMeasColumn< MEpoch > timeMeas_p
const ScalarQuantColumn< Double > & intervalQuant() const
MSFreqOffsetColumns(const MSFreqOffsetColumns &)
ScalarColumn< Int > & antenna2()
const ScalarColumn< Double > & time() const
ScalarColumn< Int > & spectralWindowId()
ScalarColumn< Double > interval_p
const ScalarQuantColumn< Double > & offsetQuant() const
const ScalarColumn< Int > & antenna1() const
Const access to required columns.
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
const ScalarColumn< Int > & antenna2() const
ScalarQuantColumn< Double > offsetQuant_p
Bool isNull() const
Is this object defined?
ScalarQuantColumn< Double > intervalQuant_p
~MSFreqOffsetColumns()
The destructor does nothing special.
void attach(const MSFreqOffset &msFreqOffset)
const ScalarColumn< Int > & spectralWindowId() const
MSFreqOffsetColumns & operator=(const MSFreqOffsetColumns &)
ScalarColumn< Double > time_p
ScalarMeasColumn< MEpoch > & timeMeas()
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const RecordRep & ref() const
Return a const reference to the underlying RecordRep.
MSFreqOffsetColumns ROMSFreqOffsetColumns
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44