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