Loading...
Searching...
No Matches
MSObsColumns.h
Go to the documentation of this file.
//# MSObservationColumns.h: provides easy access to MSObservation columns
//# Copyright (C) 1996,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_MSOBSCOLUMNS_H
#define MS_MSOBSCOLUMNS_H
#include <casacore/casa/aips.h>
#include <casacore/measures/Measures/MEpoch.h>
#include <casacore/measures/Measures/MCEpoch.h>
#include <casacore/measures/TableMeasures/ArrayMeasColumn.h>
#include <casacore/measures/TableMeasures/ArrayQuantColumn.h>
#include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
#include <casacore/tables/Tables/ArrayColumn.h>
#include <casacore/tables/Tables/ScalarColumn.h>
#include <casacore/casa/BasicSL/String.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
class MSObservation;
// <summary>
// A class to provide easy access to MSObservation columns
// </summary>
// <use visibility=export>
// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
// </reviewed>
// <prerequisite>
// <li> MSObservation
// <li> ArrayColumn
// <li> ScalarColumn
// </prerequisite>
//
// <etymology>
// MSObservationColumns stands for MeasurementSet Observation Table
// columns.
// </etymology>
//
// <synopsis>
// This class provides access to the columns in the MSObservation 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 MSObservationColumns
{
public:
// Create a columns object that accesses the data in the specified Table
MSObservationColumns(const MSObservation& msObservation);
// The desctructor does nothing special
~MSObservationColumns();
// Access to required columns
// <group>
ScalarColumn<Bool>& flagRow() {return flagRow_p;}
ArrayColumn<String>& log() {return log_p;}
ScalarColumn<String>& observer() {return observer_p;}
ScalarColumn<String>& project() {return project_p;}
ScalarColumn<Double>& releaseDate() {return releaseDate_p;}
ScalarQuantColumn<Double>& releaseDateQuant() {return releaseDateQuant_p;}
ScalarMeasColumn<MEpoch>& releaseDateMeas() {return releaseDateMeas_p;}
ArrayColumn<String>& schedule() {return schedule_p;}
ScalarColumn<String>& scheduleType() {return scheduleType_p;}
ScalarColumn<String>& telescopeName() {return telescopeName_p;}
ArrayColumn<Double>& timeRange() {return timeRange_p;}
ArrayQuantColumn<Double>& timeRangeQuant() {return timeRangeQuant_p;}
ArrayMeasColumn<MEpoch>& timeRangeMeas() {return timeRangeMeas_p;}
// </group>
// Const access to required columns
// <group>
const ScalarColumn<Bool>& flagRow() const {return flagRow_p;}
const ArrayColumn<String>& log() const {return log_p;}
const ScalarColumn<String>& observer() const {return observer_p;}
const ScalarColumn<String>& project() const {return project_p;}
const ScalarColumn<Double>& releaseDate() const {return releaseDate_p;}
const ScalarQuantColumn<Double>& releaseDateQuant() const {
return releaseDateQuant_p;}
const ScalarMeasColumn<MEpoch>& releaseDateMeas() const {
return releaseDateMeas_p;}
const ArrayColumn<String>& schedule() const {return schedule_p;}
const ScalarColumn<String>& scheduleType() const {return scheduleType_p;}
const ScalarColumn<String>& telescopeName() const {return telescopeName_p;}
const ArrayColumn<Double>& timeRange() const {return timeRange_p;}
const ArrayQuantColumn<Double>& timeRangeQuant() const {
return timeRangeQuant_p;}
const ArrayMeasColumn<MEpoch>& timeRangeMeas() const {
return timeRangeMeas_p;}
// </group>
// Convenience function that returns the number of rows in any of the columns
rownr_t nrow() const {return flagRow_p.nrow();}
// set the epoch type for the TIME_RANGE & RELEASE_DATE columns.
// <note role=tip>
// In principle this function can only be used if the table is empty,
// otherwise already written values may thereafter have an incorrect
// reference, offset, or unit. However, it is possible that part of the
// table gets written before these values are known. In that case the
// reference, offset, or units can be set by using a False
// <src>tableMustBeEmpty</src> argument.
// </note>
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
protected:
//# default constructor creates a object that is not usable. Use the attach
//# function correct this.
MSObservationColumns();
//# attach this object to the supplied table.
void attach(const MSObservation& msObservation);
private:
//# Make the assignment operator and the copy constructor private to prevent
//# any compiler generated one from being used.
MSObservationColumns(const MSObservationColumns&);
MSObservationColumns& operator=(const MSObservationColumns&);
//# required columns
ScalarColumn<Bool> flagRow_p;
ArrayColumn<String> log_p;
ScalarColumn<String> observer_p;
ScalarColumn<String> project_p;
ScalarColumn<Double> releaseDate_p;
ArrayColumn<String> schedule_p;
ScalarColumn<String> scheduleType_p;
ScalarColumn<String> telescopeName_p;
ArrayColumn<Double> timeRange_p;
//# Access to Measure columns
ScalarMeasColumn<MEpoch> releaseDateMeas_p;
ArrayMeasColumn<MEpoch> timeRangeMeas_p;
//# Access to Quantum columns
ScalarQuantColumn<Double> releaseDateQuant_p;
ArrayQuantColumn<Double> timeRangeQuant_p;
};
//# Define the RO version for backward compatibility.
typedef MSObservationColumns ROMSObservationColumns;
} //# NAMESPACE CASACORE - END
#endif
casacore::ArrayColumn
Definition ArrayColumn.h:98
casacore::ArrayMeasColumn
Definition ArrayMeasColumn.h:169
casacore::ArrayQuantColumn
Definition ArrayQuantColumn.h:118
casacore::MEpoch::Types
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:114
casacore::MSObservationColumns
Definition MSObsColumns.h:79
casacore::MSObservationColumns::project
const ScalarColumn< String > & project() const
Definition MSObsColumns.h:109
casacore::MSObservationColumns::~MSObservationColumns
~MSObservationColumns()
The desctructor does nothing special.
casacore::MSObservationColumns::telescopeName_p
ScalarColumn< String > telescopeName_p
Definition MSObsColumns.h:161
casacore::MSObservationColumns::releaseDateMeas
ScalarMeasColumn< MEpoch > & releaseDateMeas()
Definition MSObsColumns.h:95
casacore::MSObservationColumns::MSObservationColumns
MSObservationColumns(const MSObservationColumns &)
casacore::MSObservationColumns::timeRangeMeas
ArrayMeasColumn< MEpoch > & timeRangeMeas()
Definition MSObsColumns.h:101
casacore::MSObservationColumns::timeRange
ArrayColumn< Double > & timeRange()
Definition MSObsColumns.h:99
casacore::MSObservationColumns::releaseDateQuant_p
ScalarQuantColumn< Double > releaseDateQuant_p
Definition MSObsColumns.h:169
casacore::MSObservationColumns::schedule_p
ArrayColumn< String > schedule_p
Definition MSObsColumns.h:159
casacore::MSObservationColumns::timeRangeQuant
const ArrayQuantColumn< Double > & timeRangeQuant() const
Definition MSObsColumns.h:119
casacore::MSObservationColumns::timeRangeQuant_p
ArrayQuantColumn< Double > timeRangeQuant_p
Definition MSObsColumns.h:170
casacore::MSObservationColumns::schedule
ArrayColumn< String > & schedule()
Definition MSObsColumns.h:96
casacore::MSObservationColumns::releaseDate
const ScalarColumn< Double > & releaseDate() const
Definition MSObsColumns.h:110
casacore::MSObservationColumns::MSObservationColumns
MSObservationColumns(const MSObservation &msObservation)
Create a columns object that accesses the data in the specified Table.
casacore::MSObservationColumns::log
ArrayColumn< String > & log()
Definition MSObsColumns.h:90
casacore::MSObservationColumns::observer_p
ScalarColumn< String > observer_p
Definition MSObsColumns.h:156
casacore::MSObservationColumns::timeRangeQuant
ArrayQuantColumn< Double > & timeRangeQuant()
Definition MSObsColumns.h:100
casacore::MSObservationColumns::flagRow_p
ScalarColumn< Bool > flagRow_p
Definition MSObsColumns.h:154
casacore::MSObservationColumns::timeRange
const ArrayColumn< Double > & timeRange() const
Definition MSObsColumns.h:118
casacore::MSObservationColumns::timeRangeMeas_p
ArrayMeasColumn< MEpoch > timeRangeMeas_p
Definition MSObsColumns.h:166
casacore::MSObservationColumns::releaseDateQuant
ScalarQuantColumn< Double > & releaseDateQuant()
Definition MSObsColumns.h:94
casacore::MSObservationColumns::scheduleType_p
ScalarColumn< String > scheduleType_p
Definition MSObsColumns.h:160
casacore::MSObservationColumns::MSObservationColumns
MSObservationColumns()
casacore::MSObservationColumns::attach
void attach(const MSObservation &msObservation)
casacore::MSObservationColumns::project
ScalarColumn< String > & project()
Definition MSObsColumns.h:92
casacore::MSObservationColumns::releaseDateQuant
const ScalarQuantColumn< Double > & releaseDateQuant() const
Definition MSObsColumns.h:111
casacore::MSObservationColumns::telescopeName
ScalarColumn< String > & telescopeName()
Definition MSObsColumns.h:98
casacore::MSObservationColumns::log_p
ArrayColumn< String > log_p
Definition MSObsColumns.h:155
casacore::MSObservationColumns::scheduleType
ScalarColumn< String > & scheduleType()
Definition MSObsColumns.h:97
casacore::MSObservationColumns::setEpochRef
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME_RANGE & RELEASE_DATE columns.
casacore::MSObservationColumns::releaseDateMeas_p
ScalarMeasColumn< MEpoch > releaseDateMeas_p
Definition MSObsColumns.h:165
casacore::MSObservationColumns::project_p
ScalarColumn< String > project_p
Definition MSObsColumns.h:157
casacore::MSObservationColumns::schedule
const ArrayColumn< String > & schedule() const
Definition MSObsColumns.h:115
casacore::MSObservationColumns::timeRangeMeas
const ArrayMeasColumn< MEpoch > & timeRangeMeas() const
Definition MSObsColumns.h:121
casacore::MSObservationColumns::flagRow
ScalarColumn< Bool > & flagRow()
Access to required columns.
Definition MSObsColumns.h:89
casacore::MSObservationColumns::operator=
MSObservationColumns & operator=(const MSObservationColumns &)
casacore::MSObservationColumns::telescopeName
const ScalarColumn< String > & telescopeName() const
Definition MSObsColumns.h:117
casacore::MSObservationColumns::scheduleType
const ScalarColumn< String > & scheduleType() const
Definition MSObsColumns.h:116
casacore::MSObservationColumns::observer
const ScalarColumn< String > & observer() const
Definition MSObsColumns.h:108
casacore::MSObservationColumns::timeRange_p
ArrayColumn< Double > timeRange_p
Definition MSObsColumns.h:162
casacore::MSObservationColumns::observer
ScalarColumn< String > & observer()
Definition MSObsColumns.h:91
casacore::MSObservationColumns::log
const ArrayColumn< String > & log() const
Definition MSObsColumns.h:107
casacore::MSObservationColumns::nrow
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
Definition MSObsColumns.h:126
casacore::MSObservationColumns::releaseDateMeas
const ScalarMeasColumn< MEpoch > & releaseDateMeas() const
Definition MSObsColumns.h:113
casacore::MSObservationColumns::releaseDate_p
ScalarColumn< Double > releaseDate_p
Definition MSObsColumns.h:158
casacore::MSObservationColumns::releaseDate
ScalarColumn< Double > & releaseDate()
Definition MSObsColumns.h:93
casacore::MSObservationColumns::flagRow
const ScalarColumn< Bool > & flagRow() const
Const access to required columns.
Definition MSObsColumns.h:106
casacore::MSObservation
Definition MSObservation.h:77
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::ROMSObservationColumns
MSObservationColumns ROMSObservationColumns
Definition MSObsColumns.h:174
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::True
const Bool True
Definition aipstype.h:41
casacore::rownr_t
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44