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 public:
80 // Create a columns object that accesses the data in the specified Table
81 MSObservationColumns(const MSObservation& msObservation);
82
83 // The desctructor does nothing special
85
86 // Access to required columns
87 // <group>
101 // </group>
102
103 // Const access to required columns
104 // <group>
105 const ScalarColumn<Bool>& flagRow() const { return flagRow_p; }
106 const ArrayColumn<String>& log() const { return log_p; }
107 const ScalarColumn<String>& observer() const { return observer_p; }
108 const ScalarColumn<String>& project() const { return project_p; }
112 const ArrayColumn<String>& schedule() const { return schedule_p; }
115 const ArrayColumn<Double>& timeRange() const { return timeRange_p; }
118 // </group>
119
120 // Convenience function that returns the number of rows in any of the columns
121 rownr_t nrow() const { return flagRow_p.nrow(); }
122
123 // set the epoch type for the TIME_RANGE & RELEASE_DATE columns.
124 // <note role=tip>
125 // In principle this function can only be used if the table is empty,
126 // otherwise already written values may thereafter have an incorrect
127 // reference, offset, or unit. However, it is possible that part of the
128 // table gets written before these values are known. In that case the
129 // reference, offset, or units can be set by using a False
130 // <src>tableMustBeEmpty</src> argument.
131 // </note>
132 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty = True);
133
134 protected:
135 // # default constructor creates a object that is not usable. Use the attach
136 // # function correct this.
138
139 // # attach this object to the supplied table.
140 void attach(const MSObservation& msObservation);
141
142 private:
143 // # Make the assignment operator and the copy constructor private to prevent
144 // # any compiler generated one from being used.
147
148 // # required columns
158
159 // # Access to Measure columns
162
163 // # Access to Quantum columns
166};
167
168// # Define the RO version for backward compatibility.
170
171} // namespace casacore
172
173#endif
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:116
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.
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const RecordRep & ref() const
Return a const reference to the underlying RecordRep.
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