casacore
Loading...
Searching...
No Matches
MSStateColumns.h
Go to the documentation of this file.
1//# MSStateColumns.h: provides easy access to MSState 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_MSSTATECOLUMNS_H
27#define MS_MSSTATECOLUMNS_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/tables/Tables/ScalarColumn.h>
31#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
32#include <casacore/casa/BasicSL/String.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36class MSState;
37
38// <summary>
39// A class to provide easy access to MSState columns
40// </summary>
41
42// <use visibility=export>
43
44// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
45// </reviewed>
46
47// <prerequisite>
48// <li> MSState
49// <li> ScalarColumn
50// </prerequisite>
51//
52// <etymology>
53// MSStateColumns stands for MeasurementSet State Table columns.
54// </etymology>
55//
56// <synopsis>
57// This class provides access to the columns in the MSState Table,
58// it does the declaration of all the Scalar and ArrayColumns with the
59// correct types, so the application programmer doesn't have to
60// worry about getting those right. There is an access function
61// for every predefined column. Access to non-predefined columns will still
62// have to be done with explicit declarations.
63// See <linkto class=MSColumns> MSColumns</linkto> for an example.
64// </synopsis>
65//
66// <motivation>
67// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
68// </motivation>
69
71{
72public:
73 // Create a columns object that accesses the data in the specified Table
74 MSStateColumns(const MSState& msState);
75
76 // The destructor does nothing special
78
79 // Access to required columns
80 // <group>
90 // </group>
91
92 // Const access to required columns
93 // <group>
94 const ScalarColumn<Double>& cal() const {return cal_p;}
96 const ScalarColumn<Bool>& flagRow() const {return flagRow_p;}
97 const ScalarColumn<Double>& load() const {return load_p;}
99 const ScalarColumn<String>& obsMode() const {return obsMode_p;}
100 const ScalarColumn<Bool>& ref() const {return ref_p;}
101 const ScalarColumn<Bool>& sig() const {return sig_p;}
102 const ScalarColumn<Int>& subScan() const {return subScan_p;}
103 // </group>
104
105 // Convenience function that returns the number of rows in any of the columns
106 rownr_t nrow() const {return cal_p.nrow();}
107
108 // Returns the last row that contains a state with the specified values.
109 // For Cal and Load, the tolerance is applied in the match.
110 // Returns -1 if no match could be found. Flagged rows can never match.
111 // If tryRow is non-negative, then that row is tested
112 // to see if it matches before any others are tested. Setting tryRow to a
113 // positive value greater than the table length will throw an exception
114 // (AipsError), when compiled in debug mode.
116 const Quantum<Double>& stateLoadQ,
117 const String& stateObsMode,
118 const Bool& stateRef,
119 const Bool& stateSig,
120 const Int& stateSubScan,
121 const Quantum<Double>& tolerance,
122 Int64 tryRow=-1);
123
124protected:
125 //# default constructor creates a object that is not usable. Use the attach
126 //# function correct this.
128
129 //# attach this object to the supplied table.
130 void attach(const MSState& msState);
131
132private:
133 //# Make the assignment operator and the copy constructor private to prevent
134 //# any compiler generated one from being used.
137
138 //# required columns
146
147 // Access to Quantum columns
150};
151
152//# Define the RO version for backward compatibility.
154
155} //# NAMESPACE CASACORE - END
156
157#endif
MSStateColumns & operator=(const MSStateColumns &)
ScalarQuantColumn< Double > & loadQuant()
MSStateColumns(const MSStateColumns &)
ScalarColumn< Bool > flagRow_p
const ScalarColumn< Bool > & sig() const
ScalarColumn< Double > & load()
ScalarColumn< Bool > & flagRow()
ScalarColumn< Double > load_p
ScalarQuantColumn< Double > & calQuant()
ScalarColumn< String > obsMode_p
ScalarColumn< Int > subScan_p
ScalarQuantColumn< Double > loadQuant_p
~MSStateColumns()
The destructor does nothing special.
const ScalarColumn< String > & obsMode() const
ScalarColumn< Bool > ref_p
const ScalarColumn< Double > & load() const
ScalarColumn< Double > cal_p
ScalarQuantColumn< Double > calQuant_p
Access to Quantum columns.
ScalarColumn< Double > & cal()
Access to required columns.
ScalarColumn< Bool > & sig()
ScalarColumn< Int > & subScan()
const ScalarQuantColumn< Double > & calQuant() const
ScalarColumn< String > & obsMode()
const ScalarColumn< Bool > & ref() const
MSStateColumns(const MSState &msState)
Create a columns object that accesses the data in the specified Table.
const ScalarColumn< Int > & subScan() const
const ScalarQuantColumn< Double > & loadQuant() const
ScalarColumn< Bool > & ref()
Int64 matchState(const Quantum< Double > &stateCalQ, const Quantum< Double > &stateLoadQ, const String &stateObsMode, const Bool &stateRef, const Bool &stateSig, const Int &stateSubScan, const Quantum< Double > &tolerance, Int64 tryRow=-1)
Returns the last row that contains a state with the specified values.
const ScalarColumn< Bool > & flagRow() const
const ScalarColumn< Double > & cal() const
Const access to required columns.
ScalarColumn< Bool > sig_p
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
void attach(const MSState &msState)
String: the storage and methods of handling collections of characters.
Definition String.h:223
rownr_t nrow() const
Get the number of rows in the column.
this file contains all the compiler specific defines
Definition mainpage.dox:28
MSStateColumns ROMSStateColumns
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition aipsxtype.h:36
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44