casacore
Loading...
Searching...
No Matches
MSPointingColumns.h
Go to the documentation of this file.
1//# MSPointingColumns.h: provides easy access to MSPointing columns
2//# Copyright (C) 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_MSPOINTINGCOLUMNS_H
27#define MS_MSPOINTINGCOLUMNS_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/measures/Measures/MDirection.h>
31#include <casacore/measures/Measures/MEpoch.h>
32#include <casacore/measures/Measures/MCDirection.h>
33#include <casacore/measures/Measures/MCEpoch.h>
34#include <casacore/measures/TableMeasures/ArrayMeasColumn.h>
35#include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
36#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
37#include <casacore/tables/Tables/ArrayColumn.h>
38#include <casacore/tables/Tables/ScalarColumn.h>
39
40namespace casacore { //# NAMESPACE CASACORE - BEGIN
41
42class MSPointing;
43
44// <summary>
45// A class to provide easy access to MSPointing 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> MSPointing
55// <li> ArrayColumn
56// <li> ScalarColumn
57// </prerequisite>
58//
59// <etymology>
60// MSPointingColumns stands for MeasurementSet Pointing Table columns.
61// </etymology>
62//
63// <synopsis>
64// This class provides access to the columns in the MSPointing Table,
65// it does the declaration of all the Scalar and ArrayColumns with the
66// correct types, so the application programmer doesn't have to
67// worry about getting those right. There is an access function
68// for every predefined column. Access to non-predefined columns will still
69// have to be done with explicit declarations.
70// See <linkto class=MSColumns> MSColumns</linkto> for an example.
71// </synopsis>
72//
73// <motivation>
74// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
75// </motivation>
76
78{
79public:
80 // Construct from the supplied Table
81 MSPointingColumns(const MSPointing& msPointing);
82
83 // The destructor does nothing special
85
86 // Access to required columns
87 //
88 // Note that the direction measures with a stored polynomial have Col() added
89 // to their name. They are better accessed via the functions that have the
90 // same name, without the Col suffix, that will do the interpolation for
91 // you.
92 // <group>
109 // </group>
110
111 // Access to optional columns
112 //
113 // Note that the direction measures with a stored polynomial have Col() added
114 // to their name. They are better accessed via the functions that have the
115 // same name, without the Col suffix, that will do the interpolation for
116 // you.
117 // <group>
129 // </group>
130
131 // Const access to required columns
132 // <group>
133 const ScalarColumn<Int>& antennaId() const {return antennaId_p;}
134 const ScalarColumn<Double>& time() const {return time_p;}
137 const ScalarColumn<Double>& interval() const {return interval_p;}
140 const ScalarColumn<String>& name() const {return name_p;}
141 const ScalarColumn<Int>& numPoly() const {return numPoly_p;}
150 const ArrayColumn<Double>& target() const {return target_p;}
153 const ScalarColumn<Bool>& tracking() const {return tracking_p;}
154 // </group>
155
156 // Access to optional columns
157 // <group>
165 const ArrayColumn<Double>& encoder() const {return encoder_p;}
170 const ScalarColumn<Bool>& onSource() const {return onSource_p;}
172 // </group>
173
174 // Access to interpolated directions, the default time of zero will
175 // return the 0th order element of the polynomial.
176 // <group>
181 // </group>
182
183 // return the first matching row index for this time and antenna,
184 // returns -1 if no match was found
185 // For long tables you may give a guess row...the last return
186 // is usually a good one.
187 Int64 pointingIndex(Int antenna, Double time, Int64 guessRow=0) const;
188
189 // Convenience function that returns the number of rows in any of the columns
190 rownr_t nrow() const {return antennaId_p.nrow();}
191
192 // set the epoch reference type for the TIME & TIME_ORIGIN column.
193 // <note role=tip>
194 // In principle this function can only be used if the table is empty,
195 // otherwise already written values may thereafter have an incorrect
196 // reference, offset, or unit. However, it is possible that part of the
197 // table gets written before these values are known. In that case the
198 // reference, offset, or units can be set by using a False
199 // <src>tableMustBeEmpty</src> argument.
200 // </note>
201 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
202
203 // set the direction reference type for the DIRECTION, TARGET & and, if
204 // defined, the SOURCE_OFFSET & POINTING_OFFSET columns. This can only be
205 // done when the table has no rows. Trying to do so at other times will throw
206 // an exception. Note that the optional ENCODER column must be done
207 // separately as the MSv2 definition requires this column to use the frame(s)
208 // of the antenna mounts.
210
211 // set the direction reference type for the ENCODER column (if it is defined).
212 // This can only be done when the table has no rows. Trying to do so at other
213 // times will throw an exception.
215
216protected:
217 //# default constructor creates a object that is not usable. Use the attach
218 //# function correct this.
220
221 //# attach this object to the supplied table.
222 void attach(const MSPointing& msPointing);
223
224private:
225 //# Make the assignment operator and the copy constructor private to prevent
226 //# any compiler generated one from being used.
229
230 //# Check if any optional columns exist and if so attach them.
231 void attachOptionalCols(const MSPointing& msPointing);
232
233 //# required columns
243 //# optional columns
250
251 //# Access to Measure columns
256 //# optional Measure columns
260
261 //# Access to Quantum columns
265};
266
267//# Define the RO version for backward compatibility.
269
270} //# NAMESPACE CASACORE - END
271
272#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
~MSPointingColumns()
The destructor does nothing special.
ScalarColumn< Bool > & overTheTop()
ScalarColumn< Double > interval_p
const ArrayMeasColumn< MDirection > & pointingOffsetMeasCol() const
const ScalarQuantColumn< Double > & timeQuant() const
ScalarQuantColumn< Double > timeQuant_p
ScalarColumn< Double > & time()
ArrayColumn< Double > & target()
MDirection targetMeas(rownr_t row, Double time=0) const
ArrayColumn< Double > & direction()
const ScalarMeasColumn< MDirection > & encoderMeas() const
const ScalarColumn< Double > & timeOrigin() const
ScalarMeasColumn< MEpoch > & timeOriginMeas()
ScalarColumn< String > & name()
const ArrayMeasColumn< MDirection > & directionMeasCol() const
MDirection sourceOffsetMeas(rownr_t row, Double time=0) const
ScalarColumn< Double > & timeOrigin()
ScalarQuantColumn< Double > & timeOriginQuant()
ArrayColumn< Double > encoder_p
ScalarColumn< Int > & pointingModelId()
const ArrayMeasColumn< MDirection > & targetMeasCol() const
const ArrayColumn< Double > & sourceOffset() const
ScalarColumn< Bool > onSource_p
ScalarMeasColumn< MDirection > encoderMeas_p
const ScalarColumn< Double > & time() const
ScalarQuantColumn< Double > & intervalQuant()
ArrayMeasColumn< MDirection > targetMeas_p
ScalarColumn< Int > pointingModelId_p
const ArrayColumn< Double > & target() const
ArrayMeasColumn< MDirection > & sourceOffsetMeasCol()
ScalarColumn< Double > timeOrigin_p
ArrayMeasColumn< MDirection > pointingOffsetMeas_p
ArrayMeasColumn< MDirection > & targetMeasCol()
void setDirectionRef(MDirection::Types ref)
set the direction reference type for the DIRECTION, TARGET & and, if defined, the SOURCE_OFFSET & POI...
const ScalarColumn< Int > & numPoly() const
const ScalarColumn< Double > & interval() const
const ScalarColumn< Bool > & overTheTop() const
ScalarColumn< Bool > & tracking()
const ScalarColumn< Int > & pointingModelId() const
const ArrayColumn< Double > & pointingOffset() const
Access to optional columns.
ArrayColumn< Double > target_p
ScalarMeasColumn< MEpoch > & timeMeas()
ArrayMeasColumn< MDirection > & pointingOffsetMeasCol()
ScalarColumn< Bool > & onSource()
Int64 pointingIndex(Int antenna, Double time, Int64 guessRow=0) const
return the first matching row index for this time and antenna, returns -1 if no match was found For l...
MSPointingColumns(const MSPointingColumns &)
void attachOptionalCols(const MSPointing &msPointing)
const ScalarColumn< Bool > & tracking() const
const ScalarColumn< String > & name() const
ScalarQuantColumn< Double > timeOriginQuant_p
ArrayColumn< Double > sourceOffset_p
ScalarColumn< Bool > overTheTop_p
ArrayMeasColumn< MDirection > & directionMeasCol()
ScalarColumn< Int > & numPoly()
const ScalarColumn< Int > & antennaId() const
Const access to required columns.
const ScalarQuantColumn< Double > & timeOriginQuant() const
ArrayColumn< Double > & encoder()
ScalarColumn< Double > time_p
ArrayMeasColumn< MDirection > directionMeas_p
ScalarColumn< Int > antennaId_p
ScalarColumn< String > name_p
ScalarMeasColumn< MDirection > & encoderMeas()
const ScalarColumn< Bool > & onSource() const
void setEncoderDirectionRef(MDirection::Types ref)
set the direction reference type for the ENCODER column (if it is defined).
ScalarColumn< Int > & antennaId()
Access to required columns.
ScalarMeasColumn< MEpoch > timeOriginMeas_p
MDirection pointingOffsetMeas(rownr_t row, Double time=0) const
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
ArrayColumn< Double > & sourceOffset()
const ArrayMeasColumn< MDirection > & sourceOffsetMeasCol() const
ScalarColumn< Bool > tracking_p
const ScalarMeasColumn< MEpoch > & timeOriginMeas() const
void attach(const MSPointing &msPointing)
const ArrayColumn< Double > & encoder() const
MSPointingColumns & operator=(const MSPointingColumns &)
const ScalarQuantColumn< Double > & intervalQuant() const
MSPointingColumns(const MSPointing &msPointing)
Construct from the supplied Table.
ArrayColumn< Double > & pointingOffset()
Access to optional columns.
ArrayMeasColumn< MDirection > sourceOffsetMeas_p
ArrayColumn< Double > pointingOffset_p
ArrayColumn< Double > direction_p
ScalarQuantColumn< Double > intervalQuant_p
const ScalarMeasColumn< MEpoch > & timeMeas() const
ScalarColumn< Double > & interval()
const ArrayColumn< Double > & direction() const
ScalarQuantColumn< Double > & timeQuant()
ScalarMeasColumn< MEpoch > timeMeas_p
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch reference type for the TIME & TIME_ORIGIN column.
MDirection directionMeas(rownr_t row, Double time=0) const
Access to interpolated directions, the default time of zero will return the 0th order element of the ...
rownr_t nrow() const
Get the number of rows in the column.
this file contains all the compiler specific defines
Definition mainpage.dox:28
MSPointingColumns ROMSPointingColumns
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
double Double
Definition aipstype.h:53
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44