Loading...
Searching...
No Matches
MSColumns.h
Go to the documentation of this file.
//# MSColumns.h: provides easy access to MeasurementSet 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_MSCOLUMNS_H
#define MS_MSCOLUMNS_H
#include <casacore/casa/aips.h>
#include <casacore/measures/Measures/MDirection.h>
#include <casacore/measures/Measures/MEpoch.h>
#include <casacore/measures/Measures/MCPosition.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/ms/MeasurementSets/MSAntennaColumns.h>
#include <casacore/ms/MeasurementSets/MSDataDescColumns.h>
#include <casacore/ms/MeasurementSets/MSDopplerColumns.h>
#include <casacore/ms/MeasurementSets/MSFeedColumns.h>
#include <casacore/ms/MeasurementSets/MSFieldColumns.h>
#include <casacore/ms/MeasurementSets/MSFlagCmdColumns.h>
#include <casacore/ms/MeasurementSets/MSFreqOffColumns.h>
#include <casacore/ms/MeasurementSets/MSHistoryColumns.h>
#include <casacore/ms/MeasurementSets/MSMainColumns.h>
#include <casacore/ms/MeasurementSets/MSObsColumns.h>
#include <casacore/ms/MeasurementSets/MSPointingColumns.h>
#include <casacore/ms/MeasurementSets/MSPolColumns.h>
#include <casacore/ms/MeasurementSets/MSProcessorColumns.h>
#include <casacore/ms/MeasurementSets/MSSourceColumns.h>
#include <casacore/ms/MeasurementSets/MSSpWindowColumns.h>
#include <casacore/ms/MeasurementSets/MSStateColumns.h>
#include <casacore/ms/MeasurementSets/MSSysCalColumns.h>
#include <casacore/ms/MeasurementSets/MSWeatherColumns.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
class MeasurementSet;
// <summary>
// A class to provide easy access to MeasurementSet columns
// </summary>
// <use visibility=export>
// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
// </reviewed>
// <prerequisite>
// <li> MeasurementSet
// <li> ArrayColumn
// <li> ScalarColumn
// </prerequisite>
//
// <etymology>
// MSColumns stands for MeasurementSet Table columns.
// </etymology>
//
// <synopsis>
// This class provides access to all the subtables and direct access to all the
// columns in the MeasurementSet. 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.
// </synopsis>
//
// <example>
// <srcblock>
// // use as follows
// MeasurementSet ms("myMS",Table::Update);
// MSColumns msc(ms);
// // show data from row 5
// cout << msc.data()(5);
// // change name of antenna on row 3 in antenna table
// msc.antenna().name().put(3,"NewAnt-3");
// </srcblock>
// </example>
//
// <motivation>
// Having to type long lists of Scalar and Array column declarations gets
// very tedious. This class attempts to relieve some of that tedium, while
// at the same time concentrating all the declarations in one place,
// making Type errors in the column declaration (only caught at run-time) less
// probable. Type errors in the use of the columns is caught at compile
// time.
// </motivation>
//
// <todo asof="1997/02/01">
// <li> We might decide to merge this class with the MeasurementSet
// </todo>
class MSColumns: public MSMainColumns
{
public:
// Create a columns object that accesses the data in the specified MS
MSColumns(const MeasurementSet& ms);
// The destructor does nothing special
~MSColumns();
// Access to required subtables
// <group>
MSAntennaColumns& antenna() {return antenna_p;}
MSDataDescColumns& dataDescription() {return dataDesc_p;}
MSFeedColumns& feed() {return feed_p;}
MSFieldColumns& field() {return field_p;}
MSFlagCmdColumns& flagCmd() {return flagCmd_p;}
MSHistoryColumns& history() {return history_p;}
MSObservationColumns& observation() {return observation_p;}
MSPointingColumns& pointing() {return pointing_p;}
MSPolarizationColumns& polarization() {return polarization_p;}
MSProcessorColumns& processor() {return processor_p;}
MSSpWindowColumns& spectralWindow() {return spectralWindow_p;}
MSStateColumns& state() {return state_p;}
// </group>
// Access to optional subtables
// <group>
MSDopplerColumns& doppler() {return doppler_p;}
MSFreqOffsetColumns& freqOffset() {return freqOffset_p;}
MSSourceColumns& source() {return source_p;}
MSSysCalColumns& sysCal() {return sysCal_p;}
MSWeatherColumns& weather() {return weather_p;}
// </group>
// Access to required subtables
// <group>
const MSAntennaColumns& antenna() const {return antenna_p;}
const MSDataDescColumns& dataDescription() const {return dataDesc_p;}
const MSFeedColumns& feed() const {return feed_p;}
const MSFieldColumns& field() const {return field_p;}
const MSFlagCmdColumns& flagCmd() const {return flagCmd_p;}
const MSHistoryColumns& history() const {return history_p;}
const MSObservationColumns& observation() const {return observation_p;}
const MSPointingColumns& pointing() const {return pointing_p;}
const MSPolarizationColumns& polarization() const {
return polarization_p;}
const MSProcessorColumns& processor() const {return processor_p;}
const MSSpWindowColumns& spectralWindow() const {
return spectralWindow_p;}
const MSStateColumns& state() const {return state_p;}
// </group>
// Access to optional subtables
// <group>
const MSDopplerColumns& doppler() const {return doppler_p;}
const MSFreqOffsetColumns& freqOffset() const {return freqOffset_p;}
const MSSourceColumns& source() const {return source_p;}
const MSSysCalColumns& sysCal() const {return sysCal_p;}
const MSWeatherColumns& weather() const {return weather_p;}
// </group>
// set the EPOCH reference type in all EPOCH columns in the MS. Note that
// only a single EPOCH reference is allowed in the MS. This
// <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);
// set the DIRECTION reference type for FIELD, POINTING and SOURCE tables
// (except for antenna frame directions).
void setDirectionRef(MDirection::Types ref);
private:
// Access to subtables
MSAntennaColumns antenna_p;
MSDataDescColumns dataDesc_p;
MSDopplerColumns doppler_p; //optional
MSFeedColumns feed_p;
MSFieldColumns field_p;
MSFlagCmdColumns flagCmd_p;
MSFreqOffsetColumns freqOffset_p; //optional
MSHistoryColumns history_p;
MSObservationColumns observation_p;
MSPointingColumns pointing_p;
MSPolarizationColumns polarization_p;
MSProcessorColumns processor_p;
MSSourceColumns source_p; // optional
MSSpWindowColumns spectralWindow_p;
MSStateColumns state_p;
MSSysCalColumns sysCal_p; //optional
MSWeatherColumns weather_p; //optional
};
//# Define the RO version for backward compatibility.
typedef MSColumns ROMSColumns;
//# Declare extern templates for often used types.
extern template class ArrayMeasColumn<MDirection>;
extern template class ScalarMeasColumn<MPosition>;
extern template class ScalarMeasColumn<MEpoch>;
extern template class ArrayQuantColumn<Double>;
extern template class ScalarQuantColumn<Double>;
} //# NAMESPACE CASACORE - END
#endif
casacore::ArrayMeasColumn
Definition ArrayMeasColumn.h:169
casacore::ArrayQuantColumn
Definition ArrayQuantColumn.h:118
casacore::MDirection::Types
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition MDirection.h:185
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::MSAntennaColumns
Definition MSAntennaColumns.h:78
casacore::MSColumns
Definition MSColumns.h:115
casacore::MSColumns::antenna_p
MSAntennaColumns antenna_p
Access to subtables.
Definition MSColumns.h:193
casacore::MSColumns::spectralWindow
const MSSpWindowColumns & spectralWindow() const
Definition MSColumns.h:161
casacore::MSColumns::doppler
MSDopplerColumns & doppler()
Access to optional subtables.
Definition MSColumns.h:141
casacore::MSColumns::polarization
const MSPolarizationColumns & polarization() const
Definition MSColumns.h:158
casacore::MSColumns::feed
const MSFeedColumns & feed() const
Definition MSColumns.h:152
casacore::MSColumns::sysCal
MSSysCalColumns & sysCal()
Definition MSColumns.h:144
casacore::MSColumns::observation
MSObservationColumns & observation()
Definition MSColumns.h:131
casacore::MSColumns::state_p
MSStateColumns state_p
Definition MSColumns.h:207
casacore::MSColumns::observation_p
MSObservationColumns observation_p
Definition MSColumns.h:201
casacore::MSColumns::setEpochRef
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the EPOCH reference type in all EPOCH columns in the MS.
casacore::MSColumns::weather_p
MSWeatherColumns weather_p
Definition MSColumns.h:209
casacore::MSColumns::dataDesc_p
MSDataDescColumns dataDesc_p
Definition MSColumns.h:194
casacore::MSColumns::history
const MSHistoryColumns & history() const
Definition MSColumns.h:155
casacore::MSColumns::processor
MSProcessorColumns & processor()
Definition MSColumns.h:134
casacore::MSColumns::field
MSFieldColumns & field()
Definition MSColumns.h:128
casacore::MSColumns::doppler_p
MSDopplerColumns doppler_p
Definition MSColumns.h:195
casacore::MSColumns::flagCmd
MSFlagCmdColumns & flagCmd()
Definition MSColumns.h:129
casacore::MSColumns::doppler
const MSDopplerColumns & doppler() const
Access to optional subtables.
Definition MSColumns.h:168
casacore::MSColumns::sysCal_p
MSSysCalColumns sysCal_p
Definition MSColumns.h:208
casacore::MSColumns::feed_p
MSFeedColumns feed_p
Definition MSColumns.h:196
casacore::MSColumns::feed
MSFeedColumns & feed()
Definition MSColumns.h:127
casacore::MSColumns::freqOffset
const MSFreqOffsetColumns & freqOffset() const
Definition MSColumns.h:169
casacore::MSColumns::field
const MSFieldColumns & field() const
Definition MSColumns.h:153
casacore::MSColumns::source
const MSSourceColumns & source() const
Definition MSColumns.h:170
casacore::MSColumns::observation
const MSObservationColumns & observation() const
Definition MSColumns.h:156
casacore::MSColumns::~MSColumns
~MSColumns()
The destructor does nothing special.
casacore::MSColumns::processor
const MSProcessorColumns & processor() const
Definition MSColumns.h:160
casacore::MSColumns::antenna
MSAntennaColumns & antenna()
Access to required subtables.
Definition MSColumns.h:125
casacore::MSColumns::pointing_p
MSPointingColumns pointing_p
Definition MSColumns.h:202
casacore::MSColumns::history_p
MSHistoryColumns history_p
Definition MSColumns.h:200
casacore::MSColumns::flagCmd_p
MSFlagCmdColumns flagCmd_p
Definition MSColumns.h:198
casacore::MSColumns::freqOffset
MSFreqOffsetColumns & freqOffset()
Definition MSColumns.h:142
casacore::MSColumns::spectralWindow_p
MSSpWindowColumns spectralWindow_p
Definition MSColumns.h:206
casacore::MSColumns::antenna
const MSAntennaColumns & antenna() const
Access to required subtables.
Definition MSColumns.h:150
casacore::MSColumns::dataDescription
const MSDataDescColumns & dataDescription() const
Definition MSColumns.h:151
casacore::MSColumns::sysCal
const MSSysCalColumns & sysCal() const
Definition MSColumns.h:171
casacore::MSColumns::setDirectionRef
void setDirectionRef(MDirection::Types ref)
set the DIRECTION reference type for FIELD, POINTING and SOURCE tables (except for antenna frame dire...
casacore::MSColumns::field_p
MSFieldColumns field_p
Definition MSColumns.h:197
casacore::MSColumns::source
MSSourceColumns & source()
Definition MSColumns.h:143
casacore::MSColumns::polarization
MSPolarizationColumns & polarization()
Definition MSColumns.h:133
casacore::MSColumns::dataDescription
MSDataDescColumns & dataDescription()
Definition MSColumns.h:126
casacore::MSColumns::weather
MSWeatherColumns & weather()
Definition MSColumns.h:145
casacore::MSColumns::spectralWindow
MSSpWindowColumns & spectralWindow()
Definition MSColumns.h:135
casacore::MSColumns::history
MSHistoryColumns & history()
Definition MSColumns.h:130
casacore::MSColumns::pointing
MSPointingColumns & pointing()
Definition MSColumns.h:132
casacore::MSColumns::freqOffset_p
MSFreqOffsetColumns freqOffset_p
Definition MSColumns.h:199
casacore::MSColumns::source_p
MSSourceColumns source_p
Definition MSColumns.h:205
casacore::MSColumns::processor_p
MSProcessorColumns processor_p
Definition MSColumns.h:204
casacore::MSColumns::state
MSStateColumns & state()
Definition MSColumns.h:136
casacore::MSColumns::flagCmd
const MSFlagCmdColumns & flagCmd() const
Definition MSColumns.h:154
casacore::MSColumns::weather
const MSWeatherColumns & weather() const
Definition MSColumns.h:172
casacore::MSColumns::state
const MSStateColumns & state() const
Definition MSColumns.h:163
casacore::MSColumns::pointing
const MSPointingColumns & pointing() const
Definition MSColumns.h:157
casacore::MSColumns::MSColumns
MSColumns(const MeasurementSet &ms)
Create a columns object that accesses the data in the specified MS.
casacore::MSColumns::polarization_p
MSPolarizationColumns polarization_p
Definition MSColumns.h:203
casacore::MSDataDescColumns
Definition MSDataDescColumns.h:73
casacore::MSDopplerColumns
Definition MSDopplerColumns.h:73
casacore::MSFeedColumns
Definition MSFeedColumns.h:83
casacore::MSFieldColumns
Definition MSFieldColumns.h:86
casacore::MSFlagCmdColumns
Definition MSFlagCmdColumns.h:74
casacore::MSFreqOffsetColumns
Definition MSFreqOffColumns.h:74
casacore::MSHistoryColumns
Definition MSHistoryColumns.h:81
casacore::MSMainColumns::MSMainColumns
MSMainColumns(const MeasurementSet &ms)
Create a columns object that accesses the data in the specified Table.
casacore::MSObservationColumns
Definition MSObsColumns.h:79
casacore::MSPointingColumns
Definition MSPointingColumns.h:78
casacore::MSPolarizationColumns
Definition MSPolColumns.h:73
casacore::MSProcessorColumns
Definition MSProcessorColumns.h:70
casacore::MSSourceColumns
Definition MSSourceColumns.h:87
casacore::MSSpWindowColumns
Definition MSSpWindowColumns.h:81
casacore::MSStateColumns
Definition MSStateColumns.h:71
casacore::MSSysCalColumns
Definition MSSysCalColumns.h:76
casacore::MSWeatherColumns
Definition MSWeatherColumns.h:74
casacore::MeasurementSet
Definition MeasurementSet.h:278
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::ROMSColumns
MSColumns ROMSColumns
Definition MSColumns.h:213
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
casacore::True
const Bool True
Definition aipstype.h:41