casacore
MSDopplerColumns.h
Go to the documentation of this file.
1 //# MSDopplerColumns.h: provides easy access to MSDoppler 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: 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_MSDOPPLERCOLUMNS_H
29 #define MS_MSDOPPLERCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
32 #include <casacore/measures/Measures/MDoppler.h>
33 #include <casacore/measures/Measures/MCDoppler.h>
34 #include <casacore/tables/Tables/ScalarColumn.h>
35 #include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
36 #include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
37 
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39 
40 class MSDoppler;
41 
42 // <summary>
43 // A class to provide easy access to MSDoppler columns
44 // </summary>
45 
46 // <use visibility=export>
47 
48 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
49 // </reviewed>
50 
51 // <prerequisite>
52 // <li> MSDoppler
53 // <li> ScalarColumn
54 // </prerequisite>
55 //
56 // <etymology>
57 // MSDopplerColumns stands for MeasurementSet Doppler Table columns.
58 // </etymology>
59 //
60 // <synopsis>
61 // This class provides access to the columns in the MSDoppler Table,
62 // it does the declaration of all the Scalar and ArrayColumns with the
63 // correct types, so the application programmer doesn't have to
64 // worry about getting those right. There is an access function
65 // for every predefined column. Access to non-predefined columns will still
66 // have to be done with explicit declarations.
67 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
68 // </synopsis>
69 //
70 // <motivation>
71 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
72 // </motivation>
73 
75 {
76 public:
77  // Create a columns object that accesses the data in the specified Table
78  MSDopplerColumns(const MSDoppler& msDoppler);
79 
80  // The destructor does nothing special
82 
83  // Is this object defined? (MSDoppler table is optional)
84  Bool isNull() const {return isNull_p;}
85 
86  // Access to required columns
87  // <group>
94  // </group>
95 
96  // Const access to required columns
97  // <group>
98  const ScalarColumn<Int>& dopplerId() const {return dopplerId_p;}
99  const ScalarColumn<Int>& sourceId() const {return sourceId_p;}
101  const ScalarColumn<Double>& velDef() const {return velDef_p;}
104  // </group>
105 
106  // Convenience function that returns the number of rows in any of the
107  // columns. Returns zero if the object is null.
108  rownr_t nrow() const {return isNull() ? 0 : dopplerId_p.nrow();}
109 
110  // set the DOPPLER type for the VELDEF column.
112 
113 protected:
114  //# default constructor creates a object that is not usable. Use the attach
115  //# function correct this.
117 
118  //# attach this object to the supplied table.
119  void attach(const MSDoppler& msDoppler);
120 
121 private:
122  //# Make the assignment operator and the copy constructor private to prevent
123  //# any compiler generated one from being used.
126 
127  //# Is the object not attached to a Table.
129 
130  //# required columns
135 
136  //# Access to Measure columns
138 
139  //# Access to Quantum columns
141 };
142 
143 //# Define the RO version for backward compatibility.
145 
146 } //# NAMESPACE CASACORE - END
147 
148 #endif
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition: MDoppler.h:149
ScalarColumn< Int > & transitionId()
void attach(const MSDoppler &msDoppler)
ScalarColumn< Int > transitionId_p
ScalarColumn< Int > & dopplerId()
Access to required columns.
MSDopplerColumns(const MSDopplerColumns &)
ScalarColumn< Int > sourceId_p
ScalarColumn< Int > & sourceId()
void setVelDefRef(MDoppler::Types ref)
set the DOPPLER type for the VELDEF column.
const ScalarQuantColumn< Double > & velDefQuant() const
MSDopplerColumns(const MSDoppler &msDoppler)
Create a columns object that accesses the data in the specified Table.
ScalarMeasColumn< MDoppler > & velDefMeas()
~MSDopplerColumns()
The destructor does nothing special.
ScalarColumn< Double > & velDef()
const ScalarColumn< Int > & transitionId() const
MSDopplerColumns & operator=(const MSDopplerColumns &)
const ScalarColumn< Int > & sourceId() const
ScalarColumn< Int > dopplerId_p
ScalarQuantColumn< Double > velDefQuant_p
Bool isNull() const
Is this object defined? (MSDoppler table is optional)
ScalarColumn< Double > velDef_p
const ScalarMeasColumn< MDoppler > & velDefMeas() const
ScalarMeasColumn< MDoppler > velDefMeas_p
ScalarQuantColumn< Double > & velDefQuant()
const ScalarColumn< Int > & dopplerId() const
Const access to required columns.
const ScalarColumn< Double > & velDef() const
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
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
MSDopplerColumns ROMSDopplerColumns
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46