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{
75public:
76 // Create a columns object that accesses the data in the specified Table
77 MSFreqOffsetColumns(const MSFreqOffset& msFreqOffset);
78
79 // The destructor does nothing special
81
82 // Is this object defined? (MSFreqOffset table is optional)
83 Bool isNull() const {return isNull_p;}
84
85 // Access to required columns
86 // <group>
98 // </group>
99
100 // Const access to required columns
101 // <group>
102 const ScalarColumn<Int>& antenna1() const {return antenna1_p;}
103 const ScalarColumn<Int>& antenna2() const {return antenna2_p;}
104 const ScalarColumn<Int>& feedId() const {return feedId_p;}
105 const ScalarColumn<Double>& interval() const {return interval_p;}
107 const ScalarColumn<Double>& offset() const {return offset_p;}
110 const ScalarColumn<Double>& time() const {return time_p;}
113 // </group>
114
115 // Convenience function that returns the number of rows in any of the
116 // columns. Returns zero if the object is null.
117 rownr_t nrow() const {return isNull() ? 0 : antenna1_p.nrow();}
118
119 // set the epoch type for the TIME column.
120 // <note role=tip>
121 // In principle this function can only be used if the table is empty,
122 // otherwise already written values may thereafter have an incorrect
123 // reference, offset, or unit. However, it is possible that part of the
124 // table gets written before these values are known. In that case the
125 // reference, offset, or units can be set by using a False
126 // <src>tableMustBeEmpty</src> argument.
127 // </note>
128 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
129
130protected:
131 //# default constructor creates a object that is not usable. Use the attach
132 //# function correct this.
134
135 //# attach this object to the supplied table.
136 void attach(const MSFreqOffset& msFreqOffset);
137
138private:
139 //# Make the assignment operator and the copy constructor private to prevent
140 //# any compiler generated one from being used.
143
144 //# Is the object not attached to a Table.
146
147 //# required columns
155
156 //# Access to Measure columns
158
159 //# Access to Quantum columns
163};
164
165//# Define the RO version for backward compatibility.
167
168} //# NAMESPACE CASACORE - END
169
170#endif
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:114
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? (MSFreqOffset table is optional)
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()
rownr_t nrow() const
Get the number of rows in the column.
this file contains all the compiler specific defines
Definition mainpage.dox:28
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