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 public:
79 // Construct from the supplied Table
80 MSPointingColumns(const MSPointing& msPointing);
81
82 // The destructor does nothing special
84
85 // Access to required columns
86 //
87 // Note that the direction measures with a stored polynomial have Col() added
88 // to their name. They are better accessed via the functions that have the
89 // same name, without the Col suffix, that will do the interpolation for
90 // you.
91 // <group>
108 // </group>
109
110 // Access to optional columns
111 //
112 // Note that the direction measures with a stored polynomial have Col() added
113 // to their name. They are better accessed via the functions that have the
114 // same name, without the Col suffix, that will do the interpolation for
115 // you.
116 // <group>
126 // </group>
127
128 // Const access to required columns
129 // <group>
130 const ScalarColumn<Int>& antennaId() const { return antennaId_p; }
131 const ScalarColumn<Double>& time() const { return time_p; }
134 const ScalarColumn<Double>& interval() const { return interval_p; }
136 const ScalarColumn<String>& name() const { return name_p; }
137 const ScalarColumn<Int>& numPoly() const { return numPoly_p; }
141 const ArrayColumn<Double>& direction() const { return direction_p; }
143 const ArrayColumn<Double>& target() const { return target_p; }
145 const ScalarColumn<Bool>& tracking() const { return tracking_p; }
146 // </group>
147
148 // Access to optional columns
149 // <group>
154 const ArrayColumn<Double>& encoder() const { return encoder_p; }
157 const ScalarColumn<Bool>& onSource() const { return onSource_p; }
158 const ScalarColumn<Bool>& overTheTop() const { return overTheTop_p; }
159 // </group>
160
161 // Access to interpolated directions, the default time of zero will
162 // return the 0th order element of the polynomial.
163 // <group>
168 // </group>
169
170 // return the first matching row index for this time and antenna,
171 // returns -1 if no match was found
172 // For long tables you may give a guess row...the last return
173 // is usually a good one.
174 Int64 pointingIndex(Int antenna, Double time, Int64 guessRow = 0) const;
175
176 // Convenience function that returns the number of rows in any of the columns
177 rownr_t nrow() const { return antennaId_p.nrow(); }
178
179 // set the epoch reference type for the TIME & TIME_ORIGIN column.
180 // <note role=tip>
181 // In principle this function can only be used if the table is empty,
182 // otherwise already written values may thereafter have an incorrect
183 // reference, offset, or unit. However, it is possible that part of the
184 // table gets written before these values are known. In that case the
185 // reference, offset, or units can be set by using a False
186 // <src>tableMustBeEmpty</src> argument.
187 // </note>
188 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty = True);
189
190 // set the direction reference type for the DIRECTION, TARGET & and, if
191 // defined, the SOURCE_OFFSET & POINTING_OFFSET columns. This can only be
192 // done when the table has no rows. Trying to do so at other times will throw
193 // an exception. Note that the optional ENCODER column must be done
194 // separately as the MSv2 definition requires this column to use the frame(s)
195 // of the antenna mounts.
197
198 // set the direction reference type for the ENCODER column (if it is defined).
199 // This can only be done when the table has no rows. Trying to do so at other
200 // times will throw an exception.
202
203 protected:
204 // # default constructor creates a object that is not usable. Use the attach
205 // # function correct this.
207
208 // # attach this object to the supplied table.
209 void attach(const MSPointing& msPointing);
210
211 private:
212 // # Make the assignment operator and the copy constructor private to prevent
213 // # any compiler generated one from being used.
216
217 // # Check if any optional columns exist and if so attach them.
218 void attachOptionalCols(const MSPointing& msPointing);
219
220 // # required columns
230 // # optional columns
237
238 // # Access to Measure columns
243 // # optional Measure columns
247
248 // # Access to Quantum columns
252};
253
254// # Define the RO version for backward compatibility.
256
257} // namespace casacore
258
259#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
~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 ...
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.
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