Loading...
Searching...
No Matches
MSPolColumns.h
Go to the documentation of this file.
//# MSPolColumns.h: provides easy access to MSPolarization 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_MSPOLCOLUMNS_H
#define MS_MSPOLCOLUMNS_H
#include <casacore/casa/aips.h>
#include <casacore/casa/Arrays/ArrayFwd.h>
#include <casacore/tables/Tables/ArrayColumn.h>
#include <casacore/tables/Tables/ScalarColumn.h>
#include <casacore/measures/Measures/Stokes.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
class MSPolarization;
// <summary>
// A class to provide easy access to MSPolarization columns
// </summary>
// <use visibility=export>
// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
// </reviewed>
// <prerequisite>
// <li> MSPolarization
// <li> ArrayColumn
// <li> ScalarColumn
// </prerequisite>
//
// <etymology>
// MSPolarizationColumns stands for MeasurementSet Polarization Table columns.
// </etymology>
//
// <synopsis>
// This class provides access to the columns in the MSPolarization 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 MSPolarizationColumns
{
public:
// Create a columns object that accesses the data in the specified Table
MSPolarizationColumns(const MSPolarization& msPolarization);
// The destructor does nothing special
~MSPolarizationColumns();
// Access to required columns
// <group>
ArrayColumn<Int>& corrProduct() {return corrProduct_p;}
ArrayColumn<Int>& corrType() {return corrType_p;}
ScalarColumn<Bool>& flagRow() {return flagRow_p;}
ScalarColumn<Int>& numCorr() {return numCorr_p;}
// </group>
// Const access to required columns
// <group>
const ArrayColumn<Int>& corrProduct() const {return corrProduct_p;}
const ArrayColumn<Int>& corrType() const {return corrType_p;}
const ScalarColumn<Bool>& flagRow() const {return flagRow_p;}
const ScalarColumn<Int>& numCorr() const {return numCorr_p;}
// </group>
// Convenience function that returns the number of rows in any of the columns
rownr_t nrow() const {return corrProduct_p.nrow();}
// returns the last row that contains the an entry in the CORR_TYPE column
// that matches, in length and value, the supplied corrType Vector. Returns
// -1 if no match could be found. Flagged rows can never match. If tryRow is
// non-negative, then that row is tested to see if it matches before any
// others are tested. Setting tryRow to a positive value greater than the
// table length will throw an exception (AipsError), when compiled in debug
// mode.
Int64 match(const Vector<Stokes::StokesTypes>& polType, Int64 tryRow=-1);
protected:
//# default constructor creates a object that is not usable. Use the attach
//# function correct this.
MSPolarizationColumns();
//# attach this object to the supplied table.
void attach(const MSPolarization& msPolarization);
private:
//# Make the assignment operator and the copy constructor private to prevent
//# any compiler generated one from being used.
MSPolarizationColumns(const MSPolarizationColumns&);
MSPolarizationColumns& operator=(const MSPolarizationColumns&);
//# Functions which check the supplied values against the relevant column and
//# the specified row.
Bool matchCorrType(rownr_t row, const Vector<Int>& polType) const;
Bool matchCorrProduct(rownr_t row, const Matrix<Int>& polProduct) const;
//# required columns
ArrayColumn<Int> corrProduct_p;
ArrayColumn<Int> corrType_p;
ScalarColumn<Bool> flagRow_p;
ScalarColumn<Int> numCorr_p;
};
//# Define the RO version for backward compatibility.
typedef MSPolarizationColumns ROMSPolarizationColumns;
} //# NAMESPACE CASACORE - END
#endif
casacore::ArrayColumn
Definition ArrayColumn.h:98
casacore::MSPolarizationColumns
Definition MSPolColumns.h:73
casacore::MSPolarizationColumns::flagRow
ScalarColumn< Bool > & flagRow()
Definition MSPolColumns.h:85
casacore::MSPolarizationColumns::operator=
MSPolarizationColumns & operator=(const MSPolarizationColumns &)
casacore::MSPolarizationColumns::corrType_p
ArrayColumn< Int > corrType_p
Definition MSPolColumns.h:130
casacore::MSPolarizationColumns::flagRow_p
ScalarColumn< Bool > flagRow_p
Definition MSPolColumns.h:131
casacore::MSPolarizationColumns::corrProduct
const ArrayColumn< Int > & corrProduct() const
Const access to required columns.
Definition MSPolColumns.h:91
casacore::MSPolarizationColumns::corrType
ArrayColumn< Int > & corrType()
Definition MSPolColumns.h:84
casacore::MSPolarizationColumns::numCorr_p
ScalarColumn< Int > numCorr_p
Definition MSPolColumns.h:132
casacore::MSPolarizationColumns::matchCorrType
Bool matchCorrType(rownr_t row, const Vector< Int > &polType) const
casacore::MSPolarizationColumns::corrType
const ArrayColumn< Int > & corrType() const
Definition MSPolColumns.h:92
casacore::MSPolarizationColumns::nrow
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
Definition MSPolColumns.h:98
casacore::MSPolarizationColumns::numCorr
const ScalarColumn< Int > & numCorr() const
Definition MSPolColumns.h:94
casacore::MSPolarizationColumns::corrProduct
ArrayColumn< Int > & corrProduct()
Access to required columns.
Definition MSPolColumns.h:83
casacore::MSPolarizationColumns::corrProduct_p
ArrayColumn< Int > corrProduct_p
Definition MSPolColumns.h:129
casacore::MSPolarizationColumns::~MSPolarizationColumns
~MSPolarizationColumns()
The destructor does nothing special.
casacore::MSPolarizationColumns::MSPolarizationColumns
MSPolarizationColumns(const MSPolarization &msPolarization)
Create a columns object that accesses the data in the specified Table.
casacore::MSPolarizationColumns::match
Int64 match(const Vector< Stokes::StokesTypes > &polType, Int64 tryRow=-1)
returns the last row that contains the an entry in the CORR_TYPE column that matches,...
casacore::MSPolarizationColumns::MSPolarizationColumns
MSPolarizationColumns()
casacore::MSPolarizationColumns::MSPolarizationColumns
MSPolarizationColumns(const MSPolarizationColumns &)
casacore::MSPolarizationColumns::flagRow
const ScalarColumn< Bool > & flagRow() const
Definition MSPolColumns.h:93
casacore::MSPolarizationColumns::attach
void attach(const MSPolarization &msPolarization)
casacore::MSPolarizationColumns::matchCorrProduct
Bool matchCorrProduct(rownr_t row, const Matrix< Int > &polProduct) const
casacore::MSPolarizationColumns::numCorr
ScalarColumn< Int > & numCorr()
Definition MSPolColumns.h:86
casacore::MSPolarization
Definition MSPolarization.h:77
casacore::Matrix
Definition Matrix.h:87
casacore::ScalarColumn
Definition ScalarColumn.h:83
casacore::Vector
Definition Vector.h:82
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::ROMSPolarizationColumns
MSPolarizationColumns ROMSPolarizationColumns
Definition MSPolColumns.h:136
casacore::Int64
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
Definition aipsxtype.h:36
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::rownr_t
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44