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  uInt nrow() const {return isNull() ? 0 : dopplerId_p.nrow();}
109 
110  // set the DOPPLER type for the VELDEF column.
111  void setVelDefRef(MDoppler::Types ref);
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
casacore::MSDopplerColumns::velDefQuant
ScalarQuantColumn< Double > & velDefQuant()
Definition: MSDopplerColumns.h:92
casacore::ROMSDopplerColumns
MSDopplerColumns ROMSDopplerColumns
Definition: MSDopplerColumns.h:144
casacore::MSDopplerColumns::transitionId_p
ScalarColumn< Int > transitionId_p
Definition: MSDopplerColumns.h:133
casacore::MSDoppler
A Table intended to hold a MeasurementSet DOPPLER table.
Definition: MSDoppler.h:79
casacore::MSDopplerColumns::velDef_p
ScalarColumn< Double > velDef_p
Definition: MSDopplerColumns.h:134
casacore::MSDopplerColumns::attach
void attach(const MSDoppler &msDoppler)
casacore::MSDopplerColumns::velDef
ScalarColumn< Double > & velDef()
Definition: MSDopplerColumns.h:91
casacore::MSDopplerColumns::nrow
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
Definition: MSDopplerColumns.h:108
casacore::ScalarColumn< Int >
casacore::MSDopplerColumns::sourceId_p
ScalarColumn< Int > sourceId_p
Definition: MSDopplerColumns.h:132
casacore::MSDopplerColumns::transitionId
ScalarColumn< Int > & transitionId()
Definition: MSDopplerColumns.h:90
casacore::MSDopplerColumns::sourceId
ScalarColumn< Int > & sourceId()
Definition: MSDopplerColumns.h:89
casacore::MSDopplerColumns::operator=
MSDopplerColumns & operator=(const MSDopplerColumns &)
casacore::MSDopplerColumns::velDefMeas
ScalarMeasColumn< MDoppler > & velDefMeas()
Definition: MSDopplerColumns.h:93
casacore::MDoppler::Types
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition: MDoppler.h:149
casacore::MSDopplerColumns::isNull_p
Bool isNull_p
Definition: MSDopplerColumns.h:128
casacore::MSDopplerColumns::velDefQuant
const ScalarQuantColumn< Double > & velDefQuant() const
Definition: MSDopplerColumns.h:102
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MSDopplerColumns::isNull
Bool isNull() const
Is this object defined? (MSDoppler table is optional)
Definition: MSDopplerColumns.h:84
casacore::MSDopplerColumns::dopplerId
const ScalarColumn< Int > & dopplerId() const
Const access to required columns.
Definition: MSDopplerColumns.h:98
casacore::MSDopplerColumns::dopplerId_p
ScalarColumn< Int > dopplerId_p
Definition: MSDopplerColumns.h:131
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MSDopplerColumns::~MSDopplerColumns
~MSDopplerColumns()
The destructor does nothing special.
casacore::MSDopplerColumns::setVelDefRef
void setVelDefRef(MDoppler::Types ref)
set the DOPPLER type for the VELDEF column.
casacore::TableColumn::nrow
uInt nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
casacore::MSDopplerColumns
A class to provide easy access to MSDoppler columns.
Definition: MSDopplerColumns.h:74
casacore::MSDopplerColumns::velDefMeas
const ScalarMeasColumn< MDoppler > & velDefMeas() const
Definition: MSDopplerColumns.h:103
casacore::MSDopplerColumns::velDef
const ScalarColumn< Double > & velDef() const
Definition: MSDopplerColumns.h:101
casacore::ScalarQuantColumn< Double >
casacore::MSDopplerColumns::sourceId
const ScalarColumn< Int > & sourceId() const
Definition: MSDopplerColumns.h:99
casacore::MSDopplerColumns::transitionId
const ScalarColumn< Int > & transitionId() const
Definition: MSDopplerColumns.h:100
casacore::MSDopplerColumns::velDefMeas_p
ScalarMeasColumn< MDoppler > velDefMeas_p
Definition: MSDopplerColumns.h:137
casacore::MSDopplerColumns::MSDopplerColumns
MSDopplerColumns()
casacore::ScalarMeasColumn< MDoppler >
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::MSDopplerColumns::dopplerId
ScalarColumn< Int > & dopplerId()
Access to required columns.
Definition: MSDopplerColumns.h:88
casacore::MSDopplerColumns::velDefQuant_p
ScalarQuantColumn< Double > velDefQuant_p
Definition: MSDopplerColumns.h:140