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