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{
84public:
85 // Create a columns object that accesses the data in the specified Table
86 MSFeedColumns(const MSFeed& msFeed);
87
88 // The desctructor does nothing special
90
91 // Access to required columns
92 // <group>
116 // </group>
117
118 // Const access to required columns
119 // <group>
120 const ScalarColumn<Int>& antennaId() const {return antennaId_p;}
121 const ScalarColumn<Int>& beamId() const {return beamId_p;}
126 const ScalarColumn<Int>& feedId() const {return feedId_p;}
127 const ScalarColumn<Double>& interval() const {return interval_p;}
132 const ArrayColumn<Double>& position() const {return position_p;}
140 const ScalarColumn<Double>& time() const {return time_p;}
143 // </group>
144
145 // Access to optional columns
146 // <group>
150 // </group>
151
152 // Const access to optional columns
153 // <group>
157 // </group>
158
159 // set the epoch type for the TIME column.
160 // <note role=tip>
161 // In principle this function can only be used if the table is empty,
162 // otherwise already written values may thereafter have an incorrect
163 // reference, offset, or unit. However, it is possible that part of the
164 // table gets written before these values are known. In that case the
165 // reference, offset, or units can be set by using a False
166 // <src>tableMustBeEmpty</src> argument.
167 // </note>
168 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
169
170 // set the direction type for the BEAM_OFFSET column. This can only be done
171 // when the table has no rows. Trying to do so at other times will throw an
172 // exception.
174
175 // set the position type for the POSITION column. This can only be done when
176 // the table has no rows. Trying to do so at other times will throw an
177 // exception.
179
180 // Convenience function that returns the number of rows in any of the columns
181 rownr_t nrow() const {return antennaId_p.nrow();}
182
183 // Returns the last row that contains a feed with the specified values.
184 // If no matching row can be found, but a match is possible if the validity
185 // time interval is widened, return that row and the suggestion for the
186 // new time information.
187 // If no change to time is necessary, newTimeQ and newIntervalQ are zero.
188 // Returns -1 if no match could be found.
189 // Ignore the Feed table rows contained in vector ignoreRows.
190 // focusLengthQ is only compared if this optional column is present and
191 // if the value of focusLengthQ is not dimensionless.
193 Quantum<Double>& newIntervalQ,
194 Int antId,
195 Int feedId,
196 Int spwId,
197 const Quantum<Double>& timeQ,
198 const Quantum<Double>& intervalQ,
199 Int numReceptor,
200 const Array<Quantum<Double> >& beamOffsetQ,
201 const Array<String>& polType,
202 const Array<Complex>& polResp,
203 const Array<Quantum<Double> >& positionQ,
204 const Array<Quantum<Double> >& receptorAngleQ,
205 const RowNumbers& ignoreRows,
206 const Quantum<Double>& focusLengthQ=Quantum<Double>()
207 );
208
209protected:
210 //# default constructor creates a object that is not usable. Use the attach
211 //# function correct this.
213
214 //# attach this object to the supplied table.
215 void attach(const MSFeed& msFeed);
216
217private:
218 //# Make the assignment operator and the copy constructor private to prevent
219 //# any compiler generated one from being used.
222
223 //# Check if any optional columns exist and if so attach them.
224 void attachOptionalCols(const MSFeed& msFeed);
225
226 //# required columns
239 //# optional columns
242
243 //# Access to Measure columns
247
248 //# Access to Quantum columns
254 //# optional Quantum columns
256};
257
258//# Define the RO version for backward compatibility.
260
261} //# NAMESPACE CASACORE - END
262
263#endif
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition MDirection.h:185
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:114
Types
Types of known MPositions Warning: The order defines the order in the translation matrix FromTo in t...
Definition MPosition.h:91
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()
rownr_t nrow() const
Get the number of rows in the column.
this file contains all the compiler specific defines
Definition mainpage.dox:28
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