casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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: 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_MSFEEDCOLUMNS_H
29 #define MS_MSFEEDCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
46 
47 namespace casacore { //# NAMESPACE CASACORE - BEGIN
48 
49 class MSFeed;
50 
51 // <summary>
52 // A class to provide easy access to MSFeed columns
53 // </summary>
54 
55 // <use visibility=export>
56 
57 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
58 // </reviewed>
59 
60 // <prerequisite>
61 // <li> MSFeed
62 // <li> ArrayColumn
63 // <li> ScalarColumn
64 // </prerequisite>
65 //
66 // <etymology>
67 // MSFeedColumns stands for MeasurementSet Feed Table columns.
68 // </etymology>
69 //
70 // <synopsis>
71 // This class provides access to the columns in the MSFeed Table,
72 // it does the declaration of all the Scalar and ArrayColumns with the
73 // correct types, so the application programmer doesn't have to
74 // worry about getting those right. There is an access function
75 // for every predefined column. Access to non-predefined columns will still
76 // have to be done with explicit declarations.
77 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
78 // </synopsis>
79 //
80 // <motivation>
81 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
82 // </motivation>
83 
85 {
86 public:
87  // Create a columns object that accesses the data in the specified Table
88  MSFeedColumns(const MSFeed& msFeed);
89 
90  // The desctructor does nothing special
92 
93  // Access to required columns
94  // <group>
100  {return beamOffsetMeas_p;}
110  { return positionMeas_p;}
113  return receptorAngleQuant_p;}
118  // </group>
119 
120  // Const access to required columns
121  // <group>
122  const ScalarColumn<Int>& antennaId() const {return antennaId_p;}
123  const ScalarColumn<Int>& beamId() const {return beamId_p;}
124  const ArrayColumn<Double>& beamOffset() const {return beamOffset_p;}
127  {return beamOffsetMeas_p;}
128  const ScalarColumn<Int>& feedId() const {return feedId_p;}
129  const ScalarColumn<Double>& interval() const {return interval_p;}
134  const ArrayColumn<Double>& position() const {return position_p;}
137  { return positionMeas_p;}
140  return receptorAngleQuant_p;}
142  const ScalarColumn<Double>& time() const {return time_p;}
144  const ScalarMeasColumn<MEpoch>& timeMeas() const { return timeMeas_p;}
145  // </group>
146 
147  // Access to optional columns
148  // <group>
152  // </group>
153 
154  // Const access to optional columns
155  // <group>
159  // </group>
160 
161  // set the epoch type for the TIME column.
162  // <note role=tip>
163  // In principle this function can only be used if the table is empty,
164  // otherwise already written values may thereafter have an incorrect
165  // reference, offset, or unit. However, it is possible that part of the
166  // table gets written before these values are known. In that case the
167  // reference, offset, or units can be set by using a False
168  // <src>tableMustBeEmpty</src> argument.
169  // </note>
170  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
171 
172  // set the direction type for the BEAM_OFFSET column. This can only be done
173  // when the table has no rows. Trying to do so at other times will throw an
174  // exception.
176 
177  // set the position type for the POSITION column. This can only be done when
178  // the table has no rows. Trying to do so at other times will throw an
179  // exception.
181 
182  // Convenience function that returns the number of rows in any of the columns
183  rownr_t nrow() const {return antennaId_p.nrow();}
184 
185  // Returns the last row that contains a feed with the specified values.
186  // If no matching row can be found, but a match is possible if the validity
187  // time interval is widened, return that row and the suggestion for the
188  // new time information.
189  // If no change to time is necessary, newTimeQ and newIntervalQ are zero.
190  // Returns -1 if no match could be found.
191  // Ignore the Feed table rows contained in vector ignoreRows.
192  // focusLengthQ is only compared if this optional column is present and
193  // if the value of focusLengthQ is not dimensionless.
194  Int64 matchFeed(Quantum<Double>& newTimeQ,
195  Quantum<Double>& newIntervalQ,
196  Int antId,
197  Int feedId,
198  Int spwId,
199  const Quantum<Double>& timeQ,
200  const Quantum<Double>& intervalQ,
201  Int numReceptor,
202  const Array<Quantum<Double> >& beamOffsetQ,
203  const Array<String>& polType,
204  const Array<Complex>& polResp,
205  const Array<Quantum<Double> >& positionQ,
206  const Array<Quantum<Double> >& receptorAngleQ,
207  const RowNumbers& ignoreRows,
208  const Quantum<Double>& focusLengthQ=Quantum<Double>()
209  );
210 
211 protected:
212  //# default constructor creates a object that is not usable. Use the attach
213  //# function correct this.
214  MSFeedColumns();
215 
216  //# attach this object to the supplied table.
217  void attach(const MSFeed& msFeed);
218 
219 private:
220  //# Make the assignment operator and the copy constructor private to prevent
221  //# any compiler generated one from being used.
224 
225  //# Check if any optional columns exist and if so attach them.
226  void attachOptionalCols(const MSFeed& msFeed);
227 
228  //# required columns
241  //# optional columns
244 
245  //# Access to Measure columns
249 
250  //# Access to Quantum columns
256  //# optional Quantum columns
258 };
259 
260 //# Define the RO version for backward compatibility.
262 
263 } //# NAMESPACE CASACORE - END
264 
265 #endif
ScalarQuantColumn< Double > intervalQuant_p
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
ScalarColumn< Int > feedId_p
int Int
Definition: aipstype.h:50
ArrayQuantColumn< Double > & receptorAngleQuant()
const ScalarColumn< Int > & phasedFeedId() const
ArrayMeasColumn< MDirection > & beamOffsetMeas()
Definition: MSFeedColumns.h:99
ScalarColumn< Double > & interval()
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.
void setPositionRef(MPosition::Types ref)
set the position type for the POSITION column.
const ScalarQuantColumn< Double > & intervalQuant() const
ArrayColumn< String > polarizationType_p
const ArrayColumn< Complex > & polResponse() const
ArrayQuantColumn< Double > & beamOffsetQuant()
Definition: MSFeedColumns.h:98
ArrayColumn< Double > position_p
ScalarMeasColumn< MEpoch > timeMeas_p
const ScalarColumn< Int > & beamId() const
const ArrayColumn< Double > & position() const
void setDirectionRef(MDirection::Types ref)
set the direction type for the BEAM_OFFSET column.
void attachOptionalCols(const MSFeed &msFeed)
MSFeedColumns ROMSFeedColumns
ScalarColumn< Int > & feedId()
ArrayQuantColumn< Double > beamOffsetQuant_p
A Table intended to hold a MeasurementSet FEED table.
Definition: MSFeed.h:78
ArrayColumn< Double > beamOffset_p
ScalarQuantColumn< Double > & timeQuant()
~MSFeedColumns()
The desctructor does nothing special.
const ScalarColumn< Double > & interval() const
const ScalarMeasColumn< MPosition > & positionMeas() const
const ArrayColumn< Double > & receptorAngle() const
const ScalarQuantColumn< Double > & timeQuant() const
MSFeedColumns & operator=(const MSFeedColumns &)
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
ArrayColumn< Double > & position()
ArrayColumn< Complex > polResponse_p
const ScalarColumn< Double > & focusLength() const
Const access to optional columns.
ScalarQuantColumn< Double > timeQuant_p
ScalarColumn< Int > phasedFeedId_p
rownr_t nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
ArrayColumn< Double > receptorAngle_p
ScalarMeasColumn< MPosition > positionMeas_p
const ArrayMeasColumn< MDirection > & beamOffsetMeas() const
const ScalarQuantColumn< Double > & focusLengthQuant() const
const ScalarColumn< Int > & spectralWindowId() const
const ScalarColumn< Int > & numReceptors() const
void attach(const MSFeed &msFeed)
ScalarColumn< Double > time_p
ScalarColumn< Int > beamId_p
ArrayColumn< String > & polarizationType()
ScalarQuantColumn< Double > focusLengthQuant_p
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const ScalarColumn< Int > & antennaId() const
Const access to required columns.
ScalarMeasColumn< MEpoch > & timeMeas()
ScalarQuantColumn< Double > & intervalQuant()
ScalarColumn< Double > & focusLength()
Access to optional columns.
const ArrayColumn< String > & polarizationType() const
const ScalarColumn< Double > & time() const
const ArrayQuantColumn< Double > & receptorAngleQuant() const
ArrayMeasColumn< MDirection > beamOffsetMeas_p
ScalarColumn< Int > numReceptors_p
const ArrayQuantColumn< Double > & positionQuant() const
const ScalarMeasColumn< MEpoch > & timeMeas() const
A templated N-D Array class with zero origin. Array&lt;T, Alloc&gt; is a templated, N-dimensional, Array class. The origin is zero, but by default indices are zero-based. This Array class is the base class for the Vector, Matrix, and Cube subclasses.
Definition: Array.h:156
Types
Types of known MPositions Warning: The order defines the order in the translation matrix FromTo in t...
Definition: MPosition.h:94
A class to provide easy access to MSFeed columns.
Definition: MSFeedColumns.h:84
const ArrayColumn< Double > & beamOffset() const
ArrayColumn< Complex > & polResponse()
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
ScalarMeasColumn< MPosition > & positionMeas()
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
ArrayColumn< Double > & beamOffset()
Definition: MSFeedColumns.h:97
const ArrayQuantColumn< Double > & beamOffsetQuant() const
ArrayQuantColumn< Double > positionQuant_p
ScalarColumn< Int > & spectralWindowId()
ScalarColumn< Double > focusLength_p
ScalarColumn< Int > & numReceptors()
ScalarColumn< Int > spectralWindowId_p
const ScalarColumn< Int > & feedId() const
ScalarColumn< Int > antennaId_p
ScalarColumn< Double > interval_p
ScalarColumn< Int > & antennaId()
Access to required columns.
Definition: MSFeedColumns.h:95
ScalarQuantColumn< Double > & focusLengthQuant()
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
ScalarColumn< Double > & time()
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ArrayQuantColumn< Double > receptorAngleQuant_p
const Bool True
Definition: aipstype.h:43
ScalarColumn< Int > & phasedFeedId()
ScalarColumn< Int > & beamId()
Definition: MSFeedColumns.h:96
ArrayQuantColumn< Double > & positionQuant()
ArrayColumn< Double > & receptorAngle()