casacore
Loading...
Searching...
No Matches
MSFeedColumns.h
Go to the documentation of this file.
1// # MSFeedColumns.h: provides easy access to MSFeed 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_MSFEEDCOLUMNS_H
27#define MS_MSFEEDCOLUMNS_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/casa/BasicSL/Complex.h>
31#include <casacore/measures/Measures/MDirection.h>
32#include <casacore/measures/Measures/MEpoch.h>
33#include <casacore/measures/Measures/MPosition.h>
34#include <casacore/measures/Measures/MCDirection.h>
35#include <casacore/measures/Measures/MCEpoch.h>
36#include <casacore/measures/Measures/MCPosition.h>
37#include <casacore/measures/TableMeasures/ArrayMeasColumn.h>
38#include <casacore/measures/TableMeasures/ArrayQuantColumn.h>
39#include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
40#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
41#include <casacore/tables/Tables/ArrayColumn.h>
42#include <casacore/tables/Tables/ScalarColumn.h>
43#include <casacore/casa/BasicSL/String.h>
44
45namespace casacore { // # NAMESPACE CASACORE - BEGIN
46
47class MSFeed;
48
49// <summary>
50// A class to provide easy access to MSFeed columns
51// </summary>
52
53// <use visibility=export>
54
55// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
56// </reviewed>
57
58// <prerequisite>
59// <li> MSFeed
60// <li> ArrayColumn
61// <li> ScalarColumn
62// </prerequisite>
63//
64// <etymology>
65// MSFeedColumns stands for MeasurementSet Feed Table columns.
66// </etymology>
67//
68// <synopsis>
69// This class provides access to the columns in the MSFeed Table,
70// it does the declaration of all the Scalar and ArrayColumns with the
71// correct types, so the application programmer doesn't have to
72// worry about getting those right. There is an access function
73// for every predefined column. Access to non-predefined columns will still
74// have to be done with explicit declarations.
75// See <linkto class=MSColumns> MSColumns</linkto> for an example.
76// </synopsis>
77//
78// <motivation>
79// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
80// </motivation>
81
83 public:
84 // Create a columns object that accesses the data in the specified Table
85 MSFeedColumns(const MSFeed& msFeed);
86
87 // The desctructor does nothing special
89
90 // Access to required columns
91 // <group>
112 // </group>
113
114 // Const access to required columns
115 // <group>
116 const ScalarColumn<Int>& antennaId() const { return antennaId_p; }
117 const ScalarColumn<Int>& beamId() const { return beamId_p; }
118 const ArrayColumn<Double>& beamOffset() const { return beamOffset_p; }
121 const ScalarColumn<Int>& feedId() const { return feedId_p; }
122 const ScalarColumn<Double>& interval() const { return interval_p; }
127 const ArrayColumn<Double>& position() const { return position_p; }
133 const ScalarColumn<Double>& time() const { return time_p; }
136 // </group>
137
138 // Access to optional columns
139 // <group>
143 // </group>
144
145 // Const access to optional columns
146 // <group>
150 // </group>
151
152 // set the epoch type for the TIME column.
153 // <note role=tip>
154 // In principle this function can only be used if the table is empty,
155 // otherwise already written values may thereafter have an incorrect
156 // reference, offset, or unit. However, it is possible that part of the
157 // table gets written before these values are known. In that case the
158 // reference, offset, or units can be set by using a False
159 // <src>tableMustBeEmpty</src> argument.
160 // </note>
161 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty = True);
162
163 // set the direction type for the BEAM_OFFSET column. This can only be done
164 // when the table has no rows. Trying to do so at other times will throw an
165 // exception.
167
168 // set the position type for the POSITION column. This can only be done when
169 // the table has no rows. Trying to do so at other times will throw an
170 // exception.
172
173 // Convenience function that returns the number of rows in any of the columns
174 rownr_t nrow() const { return antennaId_p.nrow(); }
175
176 // Returns the last row that contains a feed with the specified values.
177 // If no matching row can be found, but a match is possible if the validity
178 // time interval is widened, return that row and the suggestion for the
179 // new time information.
180 // If no change to time is necessary, newTimeQ and newIntervalQ are zero.
181 // Returns -1 if no match could be found.
182 // Ignore the Feed table rows contained in vector ignoreRows.
183 // focusLengthQ is only compared if this optional column is present and
184 // if the value of focusLengthQ is not dimensionless.
185 Int64 matchFeed(Quantum<Double>& newTimeQ, Quantum<Double>& newIntervalQ, Int antId, Int feedId,
186 Int spwId, const Quantum<Double>& timeQ, const Quantum<Double>& intervalQ,
187 Int numReceptor, const Array<Quantum<Double>>& beamOffsetQ,
188 const Array<String>& polType, const Array<Complex>& polResp,
189 const Array<Quantum<Double>>& positionQ,
190 const Array<Quantum<Double>>& receptorAngleQ, const RowNumbers& ignoreRows,
191 const Quantum<Double>& focusLengthQ = Quantum<Double>());
192
193 protected:
194 // # default constructor creates a object that is not usable. Use the attach
195 // # function correct this.
197
198 // # attach this object to the supplied table.
199 void attach(const MSFeed& msFeed);
200
201 private:
202 // # Make the assignment operator and the copy constructor private to prevent
203 // # any compiler generated one from being used.
206
207 // # Check if any optional columns exist and if so attach them.
208 void attachOptionalCols(const MSFeed& msFeed);
209
210 // # required columns
223 // # optional columns
226
227 // # Access to Measure columns
231
232 // # Access to Quantum columns
238 // # optional Quantum columns
240};
241
242// # Define the RO version for backward compatibility.
244
245} // namespace casacore
246
247#endif
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition MDirection.h:187
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:116
Types
Types of known MPositions Warning: The order defines the order in the translation matrix FromTo in t...
Definition MPosition.h:93
ScalarColumn< Double > focusLength_p
MSFeedColumns(const MSFeedColumns &)
MSFeedColumns(const MSFeed &msFeed)
Create a columns object that accesses the data in the specified Table.
ArrayMeasColumn< MDirection > beamOffsetMeas_p
ArrayColumn< Double > beamOffset_p
ScalarColumn< Int > & numReceptors()
const ArrayColumn< Double > & receptorAngle() const
ArrayQuantColumn< Double > & positionQuant()
ScalarQuantColumn< Double > focusLengthQuant_p
const ScalarMeasColumn< MEpoch > & timeMeas() const
const ArrayColumn< Complex > & polResponse() const
ScalarMeasColumn< MEpoch > timeMeas_p
const ScalarColumn< Double > & time() const
const ScalarColumn< Double > & focusLength() const
Const access to optional columns.
ScalarQuantColumn< Double > timeQuant_p
const ScalarMeasColumn< MPosition > & positionMeas() const
ArrayColumn< Double > & position()
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
void attach(const MSFeed &msFeed)
ScalarColumn< Int > beamId_p
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
ScalarColumn< Double > & interval()
const ScalarQuantColumn< Double > & intervalQuant() const
ScalarQuantColumn< Double > & intervalQuant()
const ArrayQuantColumn< Double > & beamOffsetQuant() const
ScalarColumn< Int > & feedId()
ScalarQuantColumn< Double > intervalQuant_p
MSFeedColumns & operator=(const MSFeedColumns &)
ArrayColumn< Double > position_p
ArrayQuantColumn< Double > positionQuant_p
ScalarMeasColumn< MPosition > positionMeas_p
void attachOptionalCols(const MSFeed &msFeed)
ScalarMeasColumn< MPosition > & positionMeas()
ScalarColumn< Int > spectralWindowId_p
const ScalarColumn< Int > & phasedFeedId() const
const ArrayColumn< Double > & position() const
ScalarColumn< Double > & time()
const ArrayQuantColumn< Double > & positionQuant() const
const ScalarQuantColumn< Double > & focusLengthQuant() const
ArrayQuantColumn< Double > beamOffsetQuant_p
ArrayColumn< String > polarizationType_p
const ArrayColumn< Double > & beamOffset() const
ScalarColumn< Int > antennaId_p
const ScalarQuantColumn< Double > & timeQuant() const
ScalarColumn< Int > & antennaId()
Access to required columns.
Int64 matchFeed(Quantum< Double > &newTimeQ, Quantum< Double > &newIntervalQ, Int antId, Int feedId, Int spwId, const Quantum< Double > &timeQ, const Quantum< Double > &intervalQ, Int numReceptor, const Array< Quantum< Double > > &beamOffsetQ, const Array< String > &polType, const Array< Complex > &polResp, const Array< Quantum< Double > > &positionQ, const Array< Quantum< Double > > &receptorAngleQ, const RowNumbers &ignoreRows, const Quantum< Double > &focusLengthQ=Quantum< Double >())
Returns the last row that contains a feed with the specified values.
ScalarColumn< Int > & beamId()
ScalarQuantColumn< Double > & timeQuant()
ScalarColumn< Int > & phasedFeedId()
const ScalarColumn< Int > & feedId() const
ScalarColumn< Double > & focusLength()
Access to optional columns.
ArrayQuantColumn< Double > receptorAngleQuant_p
ArrayColumn< Complex > & polResponse()
ScalarQuantColumn< Double > & focusLengthQuant()
ScalarColumn< Double > time_p
ArrayMeasColumn< MDirection > & beamOffsetMeas()
~MSFeedColumns()
The desctructor does nothing special.
ScalarColumn< Int > numReceptors_p
ArrayColumn< Double > & beamOffset()
ArrayColumn< Double > receptorAngle_p
ArrayColumn< Complex > polResponse_p
const ScalarColumn< Int > & antennaId() const
Const access to required columns.
ScalarColumn< Int > phasedFeedId_p
ArrayColumn< Double > & receptorAngle()
const ScalarColumn< Int > & spectralWindowId() const
ArrayColumn< String > & polarizationType()
void setPositionRef(MPosition::Types ref)
set the position type for the POSITION column.
ScalarMeasColumn< MEpoch > & timeMeas()
const ArrayQuantColumn< Double > & receptorAngleQuant() const
const ArrayColumn< String > & polarizationType() const
const ScalarColumn< Int > & beamId() const
ArrayQuantColumn< Double > & receptorAngleQuant()
ScalarColumn< Int > feedId_p
const ScalarColumn< Int > & numReceptors() const
ScalarColumn< Double > interval_p
void setDirectionRef(MDirection::Types ref)
set the direction type for the BEAM_OFFSET column.
ArrayQuantColumn< Double > & beamOffsetQuant()
const ArrayMeasColumn< MDirection > & beamOffsetMeas() const
const ScalarColumn< Double > & interval() const
ScalarColumn< Int > & spectralWindowId()
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.
MSFeedColumns ROMSFeedColumns
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
Definition aipsxtype.h:36
int Int
Definition aipstype.h:48
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