casacore
Loading...
Searching...
No Matches
MSObsColumns.h
Go to the documentation of this file.
1//# MSObservationColumns.h: provides easy access to MSObservation columns
2//# Copyright (C) 1996,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: aips2-request@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//# $Id$
27
28#ifndef MS_MSOBSCOLUMNS_H
29#define MS_MSOBSCOLUMNS_H
30
31#include <casacore/casa/aips.h>
32#include <casacore/measures/Measures/MEpoch.h>
33#include <casacore/measures/Measures/MCEpoch.h>
34#include <casacore/measures/TableMeasures/ArrayMeasColumn.h>
35#include <casacore/measures/TableMeasures/ArrayQuantColumn.h>
36#include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
37#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
38#include <casacore/tables/Tables/ArrayColumn.h>
39#include <casacore/tables/Tables/ScalarColumn.h>
40#include <casacore/casa/BasicSL/String.h>
41
42namespace casacore { //# NAMESPACE CASACORE - BEGIN
43
44class MSObservation;
45
46// <summary>
47// A class to provide easy access to MSObservation columns
48// </summary>
49
50// <use visibility=export>
51
52// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
53// </reviewed>
54
55// <prerequisite>
56// <li> MSObservation
57// <li> ArrayColumn
58// <li> ScalarColumn
59// </prerequisite>
60//
61// <etymology>
62// MSObservationColumns stands for MeasurementSet Observation Table
63// columns.
64// </etymology>
65//
66// <synopsis>
67// This class provides access to the columns in the MSObservation Table,
68// it does the declaration of all the Scalar and ArrayColumns with the
69// correct types, so the application programmer doesn't have to
70// worry about getting those right. There is an access function
71// for every predefined column. Access to non-predefined columns will still
72// have to be done with explicit declarations.
73// See <linkto class=MSColumns> MSColumns</linkto> for an example.
74// </synopsis>
75//
76// <motivation>
77// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
78// </motivation>
79
81{
82public:
83 // Create a columns object that accesses the data in the specified Table
84 MSObservationColumns(const MSObservation& msObservation);
85
86 // The desctructor does nothing special
88
89 // Access to required columns
90 // <group>
104 // </group>
105
106 // Const access to required columns
107 // <group>
108 const ScalarColumn<Bool>& flagRow() const {return flagRow_p;}
109 const ArrayColumn<String>& log() const {return log_p;}
110 const ScalarColumn<String>& observer() const {return observer_p;}
111 const ScalarColumn<String>& project() const {return project_p;}
117 const ArrayColumn<String>& schedule() const {return schedule_p;}
125 // </group>
126
127 // Convenience function that returns the number of rows in any of the columns
128 rownr_t nrow() const {return flagRow_p.nrow();}
129
130 // set the epoch type for the TIME_RANGE & RELEASE_DATE columns.
131 // <note role=tip>
132 // In principle this function can only be used if the table is empty,
133 // otherwise already written values may thereafter have an incorrect
134 // reference, offset, or unit. However, it is possible that part of the
135 // table gets written before these values are known. In that case the
136 // reference, offset, or units can be set by using a False
137 // <src>tableMustBeEmpty</src> argument.
138 // </note>
139 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
140
141protected:
142 //# default constructor creates a object that is not usable. Use the attach
143 //# function correct this.
145
146 //# attach this object to the supplied table.
147 void attach(const MSObservation& msObservation);
148
149private:
150 //# Make the assignment operator and the copy constructor private to prevent
151 //# any compiler generated one from being used.
154
155 //# required columns
165
166 //# Access to Measure columns
169
170 //# Access to Quantum columns
173};
174
175//# Define the RO version for backward compatibility.
177
178} //# NAMESPACE CASACORE - END
179
180#endif
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:117
const ScalarColumn< String > & project() const
~MSObservationColumns()
The desctructor does nothing special.
ScalarColumn< String > telescopeName_p
ScalarMeasColumn< MEpoch > & releaseDateMeas()
MSObservationColumns(const MSObservationColumns &)
ArrayMeasColumn< MEpoch > & timeRangeMeas()
ArrayColumn< Double > & timeRange()
ScalarQuantColumn< Double > releaseDateQuant_p
ArrayColumn< String > schedule_p
const ArrayQuantColumn< Double > & timeRangeQuant() const
ArrayQuantColumn< Double > timeRangeQuant_p
ArrayColumn< String > & schedule()
const ScalarColumn< Double > & releaseDate() const
MSObservationColumns(const MSObservation &msObservation)
Create a columns object that accesses the data in the specified Table.
ArrayColumn< String > & log()
ScalarColumn< String > observer_p
ArrayQuantColumn< Double > & timeRangeQuant()
ScalarColumn< Bool > flagRow_p
const ArrayColumn< Double > & timeRange() const
ArrayMeasColumn< MEpoch > timeRangeMeas_p
ScalarQuantColumn< Double > & releaseDateQuant()
ScalarColumn< String > scheduleType_p
void attach(const MSObservation &msObservation)
ScalarColumn< String > & project()
const ScalarQuantColumn< Double > & releaseDateQuant() const
ScalarColumn< String > & telescopeName()
ArrayColumn< String > log_p
ScalarColumn< String > & scheduleType()
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME_RANGE & RELEASE_DATE columns.
ScalarMeasColumn< MEpoch > releaseDateMeas_p
ScalarColumn< String > project_p
const ArrayColumn< String > & schedule() const
const ArrayMeasColumn< MEpoch > & timeRangeMeas() const
ScalarColumn< Bool > & flagRow()
Access to required columns.
MSObservationColumns & operator=(const MSObservationColumns &)
const ScalarColumn< String > & telescopeName() const
const ScalarColumn< String > & scheduleType() const
const ScalarColumn< String > & observer() const
ArrayColumn< Double > timeRange_p
ScalarColumn< String > & observer()
const ArrayColumn< String > & log() const
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
const ScalarMeasColumn< MEpoch > & releaseDateMeas() const
ScalarColumn< Double > releaseDate_p
ScalarColumn< Double > & releaseDate()
const ScalarColumn< Bool > & flagRow() const
Const access to required 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
MSObservationColumns ROMSObservationColumns
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:42
const Bool True
Definition aipstype.h:43
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:46