casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSSysCalColumns.h
Go to the documentation of this file.
1 //# MSSysCalColumns.h: provides easy access to MSSysCal columns
2 //# Copyright (C) 1996,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_MSSYSCALCOLUMNS_H
29 #define MS_MSSYSCALCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
39 
40 namespace casacore { //# NAMESPACE CASACORE - BEGIN
41 
42 class MSSysCal;
43 
44 // <summary>
45 // A class to provide easy access to MSSysCal columns
46 // </summary>
47 
48 // <use visibility=export>
49 
50 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
51 // </reviewed>
52 
53 // <prerequisite>
54 // <li> MSSysCal
55 // <li> ArrayColumn
56 // <li> ScalarColumn
57 // </prerequisite>
58 //
59 // <etymology>
60 // MSSysCalColumns stands for MeasurementSet SysCal Table columns.
61 // </etymology>
62 //
63 // <synopsis>
64 // This class provides access to the columns in the MSSysCal Table,
65 // it does the declaration of all the Scalar and ArrayColumns with the
66 // correct types, so the application programmer doesn't have to
67 // worry about getting those right. There is an access function
68 // for every predefined column. Access to non-predefined columns will still
69 // have to be done with explicit declarations.
70 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
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  MSSysCalColumns(const MSSysCal& msSysCal);
82 
83  // The destructor does nothing special
85 
86  // Is this object defined? (MSSysCal table is optional)
87  Bool isNull() const {return isNull_p;}
88 
89  // Access to required columns
90  // <group>
99  // </group>
100 
101  // Access to optional columns
102  // <group>
134  // </group>
135 
136  // Const access to columns
137  // <group>
138  const ScalarColumn<Int>& antennaId() const {return antennaId_p;}
139  const ScalarColumn<Int>& feedId() const {return feedId_p;}
140  const ScalarColumn<Double>& interval() const {return interval_p;}
142  return intervalQuant_p;}
144  return spectralWindowId_p;}
145  const ScalarColumn<Double>& time() const {return time_p;}
148  // </group>
149 
150  // Const access to optional columns
151  // <group>
152  const ScalarColumn<Float>& phaseDiff() const {return phaseDiff_p;}
154  return phaseDiffQuant_p;}
156  const ArrayColumn<Float>& tant() const {return tant_p;}
158  const ScalarColumn<Bool>& tantFlag() const {return tantFlag_p;}
161  return tantSpectrumQuant_p;}
162  const ArrayColumn<Float>& tantTsys() const {return tantTsys_p;}
165  return tantTsysSpectrum_p;}
166  const ArrayColumn<Float>& tcal() const {return tcal_p;}
168  const ScalarColumn<Bool>& tcalFlag() const {return tcalFlag_p;}
171  return tcalSpectrumQuant_p;}
172  const ArrayColumn<Float>& trx() const {return trx_p;}
173  const ArrayQuantColumn<Float>& trxQuant() const {return trxQuant_p;}
174  const ScalarColumn<Bool>& trxFlag() const {return trxFlag_p;}
177  return trxSpectrumQuant_p;}
178  const ArrayColumn<Float>& tsky() const {return tsky_p;}
180  const ScalarColumn<Bool>& tskyFlag() const {return tskyFlag_p;}
183  return tskySpectrumQuant_p;}
184  const ArrayColumn<Float>& tsys() const {return tsys_p;}
186  const ScalarColumn<Bool>& tsysFlag() const {return tsysFlag_p;}
189  return tsysSpectrumQuant_p;}
190  // </group>
191 
192  // Convenience function that returns the number of rows in any of the
193  // columns. Returns zero if the object is null.
194  rownr_t nrow() const {return isNull() ? 0 : antennaId_p.nrow();}
195 
196  // set the epoch type for the TIME column.
197  // <note role=tip>
198  // In principle this function can only be used if the table is empty,
199  // otherwise already written values may thereafter have an incorrect
200  // reference, offset, or unit. However, it is possible that part of the
201  // table gets written before these values are known. In that case the
202  // reference, offset, or units can be set by using a False
203  // <src>tableMustBeEmpty</src> argument.
204  // </note>
205  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
206 
207 protected:
208  //# default constructor creates a object that is not usable. Use the attach
209  //# function correct this.
210  MSSysCalColumns();
211 
212  //# attach this object to the supplied table.
213  void attach(const MSSysCal& msSysCal);
214 
215 private:
216  //# Make the assignment operator and the copy constructor private to prevent
217  //# any compiler generated one from being used.
220 
221  //# Check if any optional columns exist and if so attach them.
222  void attachOptionalCols(const MSSysCal& msSysCal);
223 
224  //# Is the object not attached to a Table.
226 
227  //# required columns
233  //# optional columns
254 
255  //# Access to Measure columns
257 
258  //# Access to Quantum columns
261  //# optional Quantum columns
273 };
274 
275 //# Define the RO version for backward compatibility.
277 
278 } //# NAMESPACE CASACORE - END
279 
280 #endif
ArrayColumn< Float > & tsky()
ArrayColumn< Float > & tcal()
const ArrayColumn< Float > & tantTsys() const
ScalarColumn< Int > & antennaId()
Access to required columns.
ArrayQuantColumn< Float > tcalSpectrumQuant_p
const ArrayQuantColumn< Float > & tsysQuant() const
const ArrayColumn< Float > & tsysSpectrum() const
const ScalarColumn< Bool > & tskyFlag() const
ScalarColumn< Float > phaseDiff_p
const ArrayColumn< Float > & trxSpectrum() const
ArrayQuantColumn< Float > & tantQuant()
ArrayQuantColumn< Float > & tskyQuant()
const ScalarColumn< Int > & spectralWindowId() const
ScalarMeasColumn< MEpoch > timeMeas_p
const ScalarColumn< Bool > & trxFlag() const
ScalarColumn< Int > & spectralWindowId()
ArrayColumn< Float > tcalSpectrum_p
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
ArrayQuantColumn< Float > & tskySpectrumQuant()
const ScalarColumn< Bool > & tantFlag() const
const ArrayQuantColumn< Float > & trxSpectrumQuant() const
ScalarColumn< Bool > tantTsysFlag_p
MSSysCalColumns & operator=(const MSSysCalColumns &)
ArrayQuantColumn< Float > tsysQuant_p
ArrayColumn< Float > & tcalSpectrum()
ArrayColumn< Float > tantTsys_p
ScalarColumn< Double > time_p
ScalarColumn< Bool > & tskyFlag()
const ArrayQuantColumn< Float > & tcalQuant() const
ArrayColumn< Float > & tantTsysSpectrum()
ScalarColumn< Int > & feedId()
const ArrayColumn< Float > & tcal() const
ScalarColumn< Bool > & tantFlag()
void attachOptionalCols(const MSSysCal &msSysCal)
const ScalarColumn< Bool > & tsysFlag() const
const ArrayColumn< Float > & tantSpectrum() const
ArrayColumn< Float > tsky_p
const ScalarColumn< Bool > & phaseDiffFlag() const
ScalarQuantColumn< Float > & phaseDiffQuant()
ScalarColumn< Bool > & tcalFlag()
Bool isNull() const
Is this object defined? (MSSysCal table is optional)
ScalarQuantColumn< Float > phaseDiffQuant_p
ArrayColumn< Float > & trxSpectrum()
ArrayColumn< Float > trxSpectrum_p
const ArrayColumn< Float > & trx() const
A Table intended to hold a MeasurementSet SYSCAL table.
Definition: MSSysCal.h:78
const ArrayQuantColumn< Float > & tantSpectrumQuant() const
const ArrayQuantColumn< Float > & tcalSpectrumQuant() const
ArrayQuantColumn< Float > & tcalQuant()
const ScalarQuantColumn< Double > & intervalQuant() const
ScalarColumn< Bool > phaseDiffFlag_p
const ScalarColumn< Bool > & tcalFlag() const
const ScalarColumn< Double > & interval() const
ScalarMeasColumn< MEpoch > & timeMeas()
ArrayQuantColumn< Float > & tcalSpectrumQuant()
rownr_t nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
ArrayColumn< Float > & tantSpectrum()
ArrayQuantColumn< Float > tantSpectrumQuant_p
const ScalarColumn< Double > & time() const
ArrayColumn< Float > & tskySpectrum()
ScalarQuantColumn< Double > & intervalQuant()
ArrayQuantColumn< Float > & trxQuant()
ScalarColumn< Int > feedId_p
ArrayColumn< Float > tantSpectrum_p
ScalarColumn< Int > spectralWindowId_p
~MSSysCalColumns()
The destructor does nothing special.
ScalarColumn< Bool > & phaseDiffFlag()
ScalarColumn< Double > interval_p
ArrayColumn< Float > & tsys()
ArrayQuantColumn< Float > trxQuant_p
const ScalarColumn< Bool > & tantTsysFlag() const
ScalarColumn< Double > & time()
const ArrayQuantColumn< Float > & tskySpectrumQuant() const
ArrayColumn< Float > tsys_p
ArrayQuantColumn< Float > & trxSpectrumQuant()
ScalarColumn< Bool > trxFlag_p
ArrayQuantColumn< Float > tcalQuant_p
ScalarColumn< Int > antennaId_p
A class to provide easy access to MSSysCal columns.
ScalarColumn< Bool > tsysFlag_p
ArrayQuantColumn< Float > tsysSpectrumQuant_p
ScalarColumn< Bool > & trxFlag()
ArrayColumn< Float > & tsysSpectrum()
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ScalarColumn< Float > & phaseDiff()
Access to optional columns.
ScalarColumn< Bool > tcalFlag_p
ArrayColumn< Float > tcal_p
const ArrayQuantColumn< Float > & trxQuant() const
ArrayColumn< Float > & tant()
ArrayQuantColumn< Float > & tantSpectrumQuant()
const ScalarColumn< Int > & antennaId() const
Const access to columns.
ArrayQuantColumn< Float > tantQuant_p
MSSysCalColumns ROMSSysCalColumns
ScalarColumn< Bool > tantFlag_p
const ScalarColumn< Int > & feedId() const
const ArrayColumn< Float > & tantTsysSpectrum() const
ScalarQuantColumn< Double > intervalQuant_p
const ScalarQuantColumn< Double > & timeQuant() const
ArrayColumn< Float > tant_p
ArrayColumn< Float > & trx()
const ArrayColumn< Float > & tskySpectrum() const
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
ArrayQuantColumn< Float > tskySpectrumQuant_p
ArrayColumn< Float > tskySpectrum_p
ScalarQuantColumn< Double > & timeQuant()
ScalarQuantColumn< Double > timeQuant_p
ScalarColumn< Bool > tskyFlag_p
ArrayQuantColumn< Float > tskyQuant_p
ScalarColumn< Bool > & tsysFlag()
ArrayColumn< Float > tsysSpectrum_p
ScalarColumn< Bool > & tantTsysFlag()
const ScalarQuantColumn< Float > & phaseDiffQuant() const
ArrayColumn< Float > tantTsysSpectrum_p
const ArrayColumn< Float > & tsky() const
const ArrayColumn< Float > & tcalSpectrum() const
const ArrayQuantColumn< Float > & tskyQuant() const
void attach(const MSSysCal &msSysCal)
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ArrayQuantColumn< Float > & tsysQuant()
const ArrayQuantColumn< Float > & tantQuant() const
ArrayColumn< Float > & tantTsys()
const ScalarMeasColumn< MEpoch > & timeMeas() const
const Bool True
Definition: aipstype.h:43
const ArrayColumn< Float > & tant() const
const ArrayColumn< Float > & tsys() const
const ScalarColumn< Float > & phaseDiff() const
Const access to optional columns.
ScalarColumn< Double > & interval()
ArrayQuantColumn< Float > trxSpectrumQuant_p
ArrayColumn< Float > trx_p
const ArrayQuantColumn< Float > & tsysSpectrumQuant() const
ArrayQuantColumn< Float > & tsysSpectrumQuant()