casacore
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>
32 #include <casacore/measures/Measures/MEpoch.h>
33 #include <casacore/measures/Measures/MCEpoch.h>
34 #include <casacore/measures/TableMeasures/ArrayQuantColumn.h>
35 #include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
36 #include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
37 #include <casacore/tables/Tables/ArrayColumn.h>
38 #include <casacore/tables/Tables/ScalarColumn.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.
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
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ArrayQuantColumn< Float > tskyQuant_p
ArrayColumn< Float > tantSpectrum_p
ScalarColumn< Bool > tsysFlag_p
const ScalarColumn< Float > & phaseDiff() const
Const access to optional columns.
ScalarQuantColumn< Double > & timeQuant()
ArrayColumn< Float > tcalSpectrum_p
ScalarColumn< Double > & interval()
ArrayQuantColumn< Float > tsysQuant_p
ScalarColumn< Bool > trxFlag_p
ScalarQuantColumn< Float > phaseDiffQuant_p
const ScalarColumn< Bool > & trxFlag() const
const ArrayQuantColumn< Float > & trxQuant() const
ScalarColumn< Int > & feedId()
ScalarColumn< Bool > tcalFlag_p
const ArrayColumn< Float > & tantTsysSpectrum() const
const ArrayColumn< Float > & tsysSpectrum() const
const ArrayColumn< Float > & tsys() const
ScalarColumn< Bool > & phaseDiffFlag()
ScalarColumn< Bool > & tantTsysFlag()
ArrayColumn< Float > tsys_p
ArrayColumn< Float > tsysSpectrum_p
ArrayColumn< Float > tskySpectrum_p
const ArrayQuantColumn< Float > & tsysQuant() const
const ArrayColumn< Float > & trx() const
ScalarColumn< Bool > & tantFlag()
ScalarColumn< Double > interval_p
MSSysCalColumns(const MSSysCal &msSysCal)
Create a columns object that accesses the data in the specified Table.
const ArrayColumn< Float > & tantTsys() const
const ArrayQuantColumn< Float > & tcalSpectrumQuant() const
ArrayColumn< Float > tcal_p
ArrayColumn< Float > trx_p
ArrayColumn< Float > & tantTsys()
ScalarColumn< Bool > & trxFlag()
ArrayColumn< Float > & tsysSpectrum()
void attachOptionalCols(const MSSysCal &msSysCal)
ScalarQuantColumn< Double > intervalQuant_p
MSSysCalColumns(const MSSysCalColumns &)
const ArrayColumn< Float > & tsky() const
ArrayColumn< Float > & tant()
ArrayQuantColumn< Float > & tantQuant()
ScalarColumn< Bool > & tcalFlag()
const ScalarColumn< Int > & feedId() const
ScalarMeasColumn< MEpoch > & timeMeas()
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
ScalarQuantColumn< Double > & intervalQuant()
ArrayColumn< Float > tant_p
ScalarColumn< Int > & antennaId()
Access to required columns.
ArrayQuantColumn< Float > tcalQuant_p
ArrayColumn< Float > tsky_p
const ScalarMeasColumn< MEpoch > & timeMeas() const
ArrayQuantColumn< Float > tskySpectrumQuant_p
ArrayColumn< Float > tantTsys_p
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
const ArrayColumn< Float > & tantSpectrum() const
ArrayColumn< Float > & tantTsysSpectrum()
ArrayColumn< Float > & tskySpectrum()
const ArrayColumn< Float > & tcal() const
const ArrayQuantColumn< Float > & tantQuant() const
const ScalarColumn< Bool > & tskyFlag() const
ScalarMeasColumn< MEpoch > timeMeas_p
ScalarColumn< Double > time_p
ScalarColumn< Double > & time()
ArrayQuantColumn< Float > & trxQuant()
ArrayQuantColumn< Float > tsysSpectrumQuant_p
ScalarColumn< Int > antennaId_p
const ArrayQuantColumn< Float > & trxSpectrumQuant() const
ArrayColumn< Float > & trxSpectrum()
ArrayColumn< Float > & trx()
const ScalarColumn< Double > & time() const
const ArrayColumn< Float > & trxSpectrum() const
void attach(const MSSysCal &msSysCal)
ArrayColumn< Float > & tcalSpectrum()
ArrayQuantColumn< Float > trxQuant_p
ArrayColumn< Float > & tsys()
~MSSysCalColumns()
The destructor does nothing special.
const ScalarColumn< Bool > & phaseDiffFlag() const
const ArrayQuantColumn< Float > & tskySpectrumQuant() const
const ScalarColumn< Bool > & tantTsysFlag() const
const ScalarColumn< Double > & interval() const
ScalarColumn< Bool > & tsysFlag()
ArrayQuantColumn< Float > & tskyQuant()
ArrayQuantColumn< Float > tantSpectrumQuant_p
ScalarQuantColumn< Float > & phaseDiffQuant()
ScalarColumn< Bool > & tskyFlag()
const ScalarColumn< Bool > & tcalFlag() const
ArrayQuantColumn< Float > & tskySpectrumQuant()
const ScalarColumn< Bool > & tsysFlag() const
ArrayQuantColumn< Float > & tsysSpectrumQuant()
ScalarColumn< Float > & phaseDiff()
Access to optional columns.
ScalarColumn< Bool > tskyFlag_p
const ArrayQuantColumn< Float > & tantSpectrumQuant() const
ArrayQuantColumn< Float > tantQuant_p
const ArrayQuantColumn< Float > & tcalQuant() const
const ScalarQuantColumn< Double > & timeQuant() const
ScalarColumn< Int > spectralWindowId_p
ArrayColumn< Float > trxSpectrum_p
ArrayQuantColumn< Float > trxSpectrumQuant_p
ScalarColumn< Int > feedId_p
const ArrayQuantColumn< Float > & tsysSpectrumQuant() const
ArrayQuantColumn< Float > & tantSpectrumQuant()
const ScalarColumn< Bool > & tantFlag() const
ScalarColumn< Float > phaseDiff_p
ScalarColumn< Int > & spectralWindowId()
const ScalarColumn< Int > & spectralWindowId() const
ArrayQuantColumn< Float > & tcalQuant()
ArrayQuantColumn< Float > tcalSpectrumQuant_p
MSSysCalColumns & operator=(const MSSysCalColumns &)
ScalarColumn< Bool > tantTsysFlag_p
ScalarColumn< Bool > phaseDiffFlag_p
ArrayQuantColumn< Float > & tcalSpectrumQuant()
const ArrayQuantColumn< Float > & tskyQuant() const
ArrayQuantColumn< Float > & trxSpectrumQuant()
const ScalarQuantColumn< Double > & intervalQuant() const
const ArrayColumn< Float > & tant() const
ArrayColumn< Float > & tcal()
const ScalarColumn< Int > & antennaId() const
Const access to columns.
ArrayQuantColumn< Float > & tsysQuant()
ArrayColumn< Float > & tsky()
ScalarQuantColumn< Double > timeQuant_p
ArrayColumn< Float > tantTsysSpectrum_p
const ArrayColumn< Float > & tcalSpectrum() const
const ArrayColumn< Float > & tskySpectrum() const
ArrayColumn< Float > & tantSpectrum()
ScalarColumn< Bool > tantFlag_p
Bool isNull() const
Is this object defined? (MSSysCal table is optional)
const ScalarQuantColumn< Float > & phaseDiffQuant() const
rownr_t nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
this file contains all the compiler specific defines
Definition: mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const Bool True
Definition: aipstype.h:43
MSSysCalColumns ROMSSysCalColumns
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46