Loading...
Searching...
No Matches
MSDopplerColumns.h
Go to the documentation of this file.
//# MSDopplerColumns.h: provides easy access to MSDoppler columns
//# Copyright (C) 1999,2000
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef MS_MSDOPPLERCOLUMNS_H
#define MS_MSDOPPLERCOLUMNS_H
#include <casacore/casa/aips.h>
#include <casacore/measures/Measures/MDoppler.h>
#include <casacore/measures/Measures/MCDoppler.h>
#include <casacore/tables/Tables/ScalarColumn.h>
#include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
class MSDoppler;
// <summary>
// A class to provide easy access to MSDoppler columns
// </summary>
// <use visibility=export>
// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
// </reviewed>
// <prerequisite>
// <li> MSDoppler
// <li> ScalarColumn
// </prerequisite>
//
// <etymology>
// MSDopplerColumns stands for MeasurementSet Doppler Table columns.
// </etymology>
//
// <synopsis>
// This class provides access to the columns in the MSDoppler Table,
// it does the declaration of all the Scalar and ArrayColumns with the
// correct types, so the application programmer doesn't have to
// worry about getting those right. There is an access function
// for every predefined column. Access to non-predefined columns will still
// have to be done with explicit declarations.
// See <linkto class=MSColumns> MSColumns</linkto> for an example.
// </synopsis>
//
// <motivation>
// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
// </motivation>
class MSDopplerColumns
{
public:
// Create a columns object that accesses the data in the specified Table
MSDopplerColumns(const MSDoppler& msDoppler);
// The destructor does nothing special
~MSDopplerColumns();
// Is this object defined? (MSDoppler table is optional)
Bool isNull() const {return isNull_p;}
// Access to required columns
// <group>
ScalarColumn<Int>& dopplerId() {return dopplerId_p;}
ScalarColumn<Int>& sourceId() {return sourceId_p;}
ScalarColumn<Int>& transitionId() {return transitionId_p;}
ScalarColumn<Double>& velDef() {return velDef_p;}
ScalarQuantColumn<Double>& velDefQuant(){return velDefQuant_p;}
ScalarMeasColumn<MDoppler>& velDefMeas() {return velDefMeas_p;}
// </group>
// Const access to required columns
// <group>
const ScalarColumn<Int>& dopplerId() const {return dopplerId_p;}
const ScalarColumn<Int>& sourceId() const {return sourceId_p;}
const ScalarColumn<Int>& transitionId() const {return transitionId_p;}
const ScalarColumn<Double>& velDef() const {return velDef_p;}
const ScalarQuantColumn<Double>& velDefQuant() const{return velDefQuant_p;}
const ScalarMeasColumn<MDoppler>& velDefMeas() const {return velDefMeas_p;}
// </group>
// Convenience function that returns the number of rows in any of the
// columns. Returns zero if the object is null.
rownr_t nrow() const {return isNull() ? 0 : dopplerId_p.nrow();}
// set the DOPPLER type for the VELDEF column.
void setVelDefRef(MDoppler::Types ref);
protected:
//# default constructor creates a object that is not usable. Use the attach
//# function correct this.
MSDopplerColumns();
//# attach this object to the supplied table.
void attach(const MSDoppler& msDoppler);
private:
//# Make the assignment operator and the copy constructor private to prevent
//# any compiler generated one from being used.
MSDopplerColumns(const MSDopplerColumns&);
MSDopplerColumns& operator=(const MSDopplerColumns&);
//# Is the object not attached to a Table.
Bool isNull_p;
//# required columns
ScalarColumn<Int> dopplerId_p;
ScalarColumn<Int> sourceId_p;
ScalarColumn<Int> transitionId_p;
ScalarColumn<Double> velDef_p;
//# Access to Measure columns
ScalarMeasColumn<MDoppler> velDefMeas_p;
//# Access to Quantum columns
ScalarQuantColumn<Double> velDefQuant_p;
};
//# Define the RO version for backward compatibility.
typedef MSDopplerColumns ROMSDopplerColumns;
} //# NAMESPACE CASACORE - END
#endif
casacore::MDoppler::Types
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition MDoppler.h:146
casacore::MSDopplerColumns
Definition MSDopplerColumns.h:73
casacore::MSDopplerColumns::attach
void attach(const MSDoppler &msDoppler)
casacore::MSDopplerColumns::transitionId_p
ScalarColumn< Int > transitionId_p
Definition MSDopplerColumns.h:131
casacore::MSDopplerColumns::sourceId
const ScalarColumn< Int > & sourceId() const
Definition MSDopplerColumns.h:97
casacore::MSDopplerColumns::MSDopplerColumns
MSDopplerColumns(const MSDopplerColumns &)
casacore::MSDopplerColumns::sourceId_p
ScalarColumn< Int > sourceId_p
Definition MSDopplerColumns.h:130
casacore::MSDopplerColumns::setVelDefRef
void setVelDefRef(MDoppler::Types ref)
set the DOPPLER type for the VELDEF column.
casacore::MSDopplerColumns::MSDopplerColumns
MSDopplerColumns()
casacore::MSDopplerColumns::velDef
const ScalarColumn< Double > & velDef() const
Definition MSDopplerColumns.h:99
casacore::MSDopplerColumns::velDefQuant
const ScalarQuantColumn< Double > & velDefQuant() const
Definition MSDopplerColumns.h:100
casacore::MSDopplerColumns::MSDopplerColumns
MSDopplerColumns(const MSDoppler &msDoppler)
Create a columns object that accesses the data in the specified Table.
casacore::MSDopplerColumns::transitionId
ScalarColumn< Int > & transitionId()
Definition MSDopplerColumns.h:88
casacore::MSDopplerColumns::~MSDopplerColumns
~MSDopplerColumns()
The destructor does nothing special.
casacore::MSDopplerColumns::isNull_p
Bool isNull_p
Definition MSDopplerColumns.h:126
casacore::MSDopplerColumns::velDefQuant
ScalarQuantColumn< Double > & velDefQuant()
Definition MSDopplerColumns.h:90
casacore::MSDopplerColumns::dopplerId
ScalarColumn< Int > & dopplerId()
Access to required columns.
Definition MSDopplerColumns.h:86
casacore::MSDopplerColumns::operator=
MSDopplerColumns & operator=(const MSDopplerColumns &)
casacore::MSDopplerColumns::velDefMeas
ScalarMeasColumn< MDoppler > & velDefMeas()
Definition MSDopplerColumns.h:91
casacore::MSDopplerColumns::dopplerId_p
ScalarColumn< Int > dopplerId_p
Definition MSDopplerColumns.h:129
casacore::MSDopplerColumns::velDefQuant_p
ScalarQuantColumn< Double > velDefQuant_p
Definition MSDopplerColumns.h:138
casacore::MSDopplerColumns::isNull
Bool isNull() const
Is this object defined?
Definition MSDopplerColumns.h:82
casacore::MSDopplerColumns::transitionId
const ScalarColumn< Int > & transitionId() const
Definition MSDopplerColumns.h:98
casacore::MSDopplerColumns::velDef_p
ScalarColumn< Double > velDef_p
Definition MSDopplerColumns.h:132
casacore::MSDopplerColumns::dopplerId
const ScalarColumn< Int > & dopplerId() const
Const access to required columns.
Definition MSDopplerColumns.h:96
casacore::MSDopplerColumns::sourceId
ScalarColumn< Int > & sourceId()
Definition MSDopplerColumns.h:87
casacore::MSDopplerColumns::velDefMeas
const ScalarMeasColumn< MDoppler > & velDefMeas() const
Definition MSDopplerColumns.h:101
casacore::MSDopplerColumns::velDefMeas_p
ScalarMeasColumn< MDoppler > velDefMeas_p
Definition MSDopplerColumns.h:135
casacore::MSDopplerColumns::velDef
ScalarColumn< Double > & velDef()
Definition MSDopplerColumns.h:89
casacore::MSDopplerColumns::nrow
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
Definition MSDopplerColumns.h:106
casacore::MSDoppler
Definition MSDoppler.h:78
casacore::ScalarColumn
Definition ScalarColumn.h:83
casacore::ScalarMeasColumn
Definition ScalarMeasColumn.h:141
casacore::ScalarQuantColumn
Definition ScalarQuantColumn.h:118
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::ref
const RecordRep & ref() const
Return a const reference to the underlying RecordRep.
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::ROMSDopplerColumns
MSDopplerColumns ROMSDopplerColumns
Definition MSDopplerColumns.h:142
casacore::rownr_t
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44