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{
74public:
75 // Create a columns object that accesses the data in the specified Table
76 MSDopplerColumns(const MSDoppler& msDoppler);
77
78 // The destructor does nothing special
80
81 // Is this object defined? (MSDoppler table is optional)
82 Bool isNull() const {return isNull_p;}
83
84 // Access to required columns
85 // <group>
92 // </group>
93
94 // Const access to required columns
95 // <group>
96 const ScalarColumn<Int>& dopplerId() const {return dopplerId_p;}
97 const ScalarColumn<Int>& sourceId() const {return sourceId_p;}
99 const ScalarColumn<Double>& velDef() const {return velDef_p;}
102 // </group>
103
104 // Convenience function that returns the number of rows in any of the
105 // columns. Returns zero if the object is null.
106 rownr_t nrow() const {return isNull() ? 0 : dopplerId_p.nrow();}
107
108 // set the DOPPLER type for the VELDEF column.
110
111protected:
112 //# default constructor creates a object that is not usable. Use the attach
113 //# function correct this.
115
116 //# attach this object to the supplied table.
117 void attach(const MSDoppler& msDoppler);
118
119private:
120 //# Make the assignment operator and the copy constructor private to prevent
121 //# any compiler generated one from being used.
124
125 //# Is the object not attached to a Table.
127
128 //# required columns
133
134 //# Access to Measure columns
136
137 //# Access to Quantum columns
139};
140
141//# Define the RO version for backward compatibility.
143
144} //# NAMESPACE CASACORE - END
145
146#endif
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition MDoppler.h:146
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? (MSDoppler table is optional)
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.
rownr_t nrow() const
Get the number of rows in the column.
this file contains all the compiler specific defines
Definition mainpage.dox:28
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