casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSWeatherColumns.h
Go to the documentation of this file.
1 //# MSWeatherColumns.h: provides easy access to MSWeather 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_MSWEATHERCOLUMNS_H
29 #define MS_MSWEATHERCOLUMNS_H
30 
31 #include <casacore/casa/aips.h>
37 
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39 
40 class MSWeather;
41 
42 // <summary>
43 // A class to provide easy read-only access to MSWeather columns
44 // </summary>
45 
46 // <use visibility=export>
47 
48 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
49 // </reviewed>
50 
51 // <prerequisite>
52 // <li> MSWeather
53 // <li> ArrayColumn
54 // <li> ScalarColumn
55 // </prerequisite>
56 //
57 // <etymology>
58 // ROMSWeatherColumns stands for Read-Only MeasurementSet Weather Table
59 // columns.
60 // </etymology>
61 //
62 // <synopsis>
63 // This class provides read-only access to the columns in the MSWeather
64 // Table. It does the declaration of all the Scalar and ArrayColumns with the
65 // correct types, so the application programmer doesn't have to worry about
66 // getting those right. There is an access function for every predefined
67 // column. Access to non-predefined columns will still have to be done with
68 // explicit declarations. See <linkto class=ROMSColumns>
69 // ROMSColumns</linkto> for an example.
70 // </synopsis>
71 //
72 // <motivation>
73 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
74 // </motivation>
75 
77 {
78 public:
79  // Create a columns object that accesses the data in the specified Table
80  ROMSWeatherColumns(const MSWeather& msWeather);
81 
82  // The destructor does nothing special
84 
85  // Is this object defined? (MSWeather table is optional)
86  Bool isNull() const {return isNull_p;}
87 
88  // Access to columns
89  // <group>
90  const ROScalarColumn<Int>& antennaId() const {return antennaId_p;}
91  const ROScalarColumn<Double>& interval() const {return interval_p;}
92  const ROScalarQuantColumn<Double>& intervalQuant() const {
93  return intervalQuant_p;}
94  const ROScalarColumn<Double>& time() const {return time_p;}
95  const ROScalarQuantColumn<Double>& timeQuant() const {return timeQuant_p;}
96  const ROScalarMeasColumn<MEpoch>& timeMeas() const {return timeMeas_p;}
97  // </group>
98 
99  // Access to optional columns
100  // <group>
101  const ROScalarColumn<Float>& dewPoint() const {return dewPoint_p;}
102  const ROScalarQuantColumn<Float>& dewPointQuant() const {
103  return dewPointQuant_p;}
104  const ROScalarColumn<Bool>& dewPointFlag() const {return dewPointFlag_p;}
105  const ROScalarColumn<Float>& H2O() const {return H2O_p;}
106  const ROScalarColumn<Bool>& H2OFlag() const {return H2OFlag_p;}
107  const ROScalarQuantColumn<Float>& H2OQuant() const {return H2OQuant_p;}
108  const ROScalarColumn<Float>& ionosElectron() const {return ionosElectron_p;}
109  const ROScalarQuantColumn<Float>& ionosElectronQuant() const {
110  return ionosElectronQuant_p;}
111  const ROScalarColumn<Bool>& ionosElectronFlag() const {
112  return ionosElectronFlag_p;}
113  const ROScalarColumn<Float>& pressure() const {return pressure_p;}
114  const ROScalarQuantColumn<Float>& pressureQuant() const {
115  return pressureQuant_p;}
116  const ROScalarColumn<Bool>& pressureFlag() const {return pressureFlag_p;}
117  const ROScalarColumn<Float>& relHumidity() const {return relHumidity_p;}
118  const ROScalarColumn<Bool>& relHumidityFlag() const {
119  return relHumidityFlag_p;}
120  const ROScalarColumn<Float>& temperature() const {return temperature_p;}
121  const ROScalarQuantColumn<Float>& temperatureQuant() const {
122  return temperatureQuant_p;}
123  const ROScalarColumn<Bool>& temperatureFlag() const {
124  return temperatureFlag_p;}
125  const ROScalarColumn<Float>& windDirection() const {return windDirection_p;}
126  const ROScalarQuantColumn<Float>& windDirectionQuant() const {
127  return windDirectionQuant_p;}
128  const ROScalarColumn<Bool>& windDirectionFlag() const {
129  return windDirectionFlag_p;}
130  const ROScalarColumn<Float>& windSpeed() const {return windSpeed_p;}
131  const ROScalarQuantColumn<Float>& windSpeedQuant() const {
132  return windSpeedQuant_p;}
133  const ROScalarColumn<Bool>& windSpeedFlag() const {return windSpeedFlag_p;}
134  // </group>
135 
136  // Convenience function that returns the number of rows in any of the
137  // columns. Returns zero if the object is null.
138  uInt nrow() const {return isNull() ? 0 : antennaId_p.nrow();}
139 
140 protected:
141  //# default constructor creates a object that is not usable. Use the attach
142  //# function correct this.
144 
145  //# attach this object to the supplied table.
146  void attach(const MSWeather& msWeather);
147 
148 private:
149  //# Make the assignment operator and the copy constructor private to prevent
150  //# any compiler generated one from being used.
153 
154  //# Check if any optional columns exist and if so attach them.
155  void attachOptionalCols(const MSWeather& msWeather);
156 
157  //# Is the object not attached to a Table.
159 
160  //# required columns
161  ROScalarColumn<Int> antennaId_p;
162  ROScalarColumn<Double> interval_p;
163  ROScalarColumn<Double> time_p;
164  //# optional columns
165  ROScalarColumn<Float> dewPoint_p;
166  ROScalarColumn<Bool> dewPointFlag_p;
167  ROScalarColumn<Float> H2O_p;
168  ROScalarColumn<Bool> H2OFlag_p;
169  ROScalarColumn<Float> ionosElectron_p;
170  ROScalarColumn<Bool> ionosElectronFlag_p;
171  ROScalarColumn<Float> pressure_p;
172  ROScalarColumn<Bool> pressureFlag_p;
173  ROScalarColumn<Float> relHumidity_p;
174  ROScalarColumn<Bool> relHumidityFlag_p;
175  ROScalarColumn<Float> temperature_p;
176  ROScalarColumn<Bool> temperatureFlag_p;
177  ROScalarColumn<Float> windDirection_p;
178  ROScalarColumn<Bool> windDirectionFlag_p;
179  ROScalarColumn<Float> windSpeed_p;
180  ROScalarColumn<Bool> windSpeedFlag_p;
181 
182  //# Access to Measure columns
183  ROScalarMeasColumn<MEpoch> timeMeas_p;
184 
185  //# Access to Quantum columns
186  ROScalarQuantColumn<Double> intervalQuant_p;
187  ROScalarQuantColumn<Double> timeQuant_p;
188  //# optional Quantum columns
189  ROScalarQuantColumn<Float> dewPointQuant_p;
190  ROScalarQuantColumn<Float> H2OQuant_p;
191  ROScalarQuantColumn<Float> ionosElectronQuant_p;
192  ROScalarQuantColumn<Float> pressureQuant_p;
193  ROScalarQuantColumn<Float> temperatureQuant_p;
194  ROScalarQuantColumn<Float> windDirectionQuant_p;
195  ROScalarQuantColumn<Float> windSpeedQuant_p;
196 };
197 
198 // <summary>
199 // A class to provide easy read-write access to MSWeather columns
200 // </summary>
201 
202 // <use visibility=export>
203 
204 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
205 // </reviewed>
206 
207 // <prerequisite>
208 // <li> MSWeather
209 // <li> ArrayColumn
210 // <li> ScalarColumn
211 // </prerequisite>
212 //
213 // <etymology>
214 // MSWeatherColumns stands for MeasurementSet Weather Table columns.
215 // </etymology>
216 //
217 // <synopsis>
218 // This class provides access to the columns in the MSWeather Table,
219 // it does the declaration of all the Scalar and ArrayColumns with the
220 // correct types, so the application programmer doesn't have to
221 // worry about getting those right. There is an access function
222 // for every predefined column. Access to non-predefined columns will still
223 // have to be done with explicit declarations.
224 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
225 // </synopsis>
226 //
227 // <motivation>
228 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
229 // </motivation>
230 
232 {
233 public:
234  // Create a columns object that accesses the data in the specified Table
235  MSWeatherColumns(MSWeather& msWeather);
236 
237  // The destructor does nothing special
239 
240  // Read-write access to required columns
241  // <group>
248  // </group>
249 
250  // Read-write access to optional columns
251  // <group>
275  // </group>
276 
277  // Read-only access to required columns
278  // <group>
279  const ROScalarColumn<Int>& antennaId() const {
281  const ROScalarColumn<Double>& interval() const {
283  const ROScalarQuantColumn<Double>& intervalQuant() const {
285  const ROScalarColumn<Double>& time() const {
286  return ROMSWeatherColumns::time();}
287  const ROScalarQuantColumn<Double>& timeQuant() const {
289  const ROScalarMeasColumn<MEpoch>& timeMeas() const {
291  // </group>
292 
293  // Read-only access to optional columns
294  // <group>
295  const ROScalarColumn<Float>& dewPoint() const {
297  const ROScalarQuantColumn<Float>& dewPointQuant() const {
299  const ROScalarColumn<Bool>& dewPointFlag() const {
301  const ROScalarColumn<Float>& H2O() const {
302  return ROMSWeatherColumns::H2O();}
303  const ROScalarColumn<Bool>& H2OFlag() const {
304  return ROMSWeatherColumns::H2OFlag();}
305  const ROScalarQuantColumn<Float>& H2OQuant() const {
307  const ROScalarColumn<Float>& ionosElectron() const {
309  const ROScalarQuantColumn<Float>& ionosElectronQuant() const {
311  const ROScalarColumn<Bool>& ionosElectronFlag() const {
313  const ROScalarColumn<Float>& pressure() const {
315  const ROScalarQuantColumn<Float>& pressureQuant() const {
317  const ROScalarColumn<Bool>& pressureFlag() const {
319  const ROScalarColumn<Float>& relHumidity() const {
321  const ROScalarColumn<Bool>& relHumidityFlag() const {
323  const ROScalarColumn<Float>& temperature() const {
325  const ROScalarQuantColumn<Float>& temperatureQuant() const {
327  const ROScalarColumn<Bool>& temperatureFlag() const {
329  const ROScalarColumn<Float>& windDirection() const {
331  const ROScalarQuantColumn<Float>& windDirectionQuant() const {
333  const ROScalarColumn<Bool>& windDirectionFlag() const {
335  const ROScalarColumn<Float>& windSpeed() const {
337  const ROScalarQuantColumn<Float>& windSpeedQuant() const {
339  const ROScalarColumn<Bool>& windSpeedFlag() const {
341  // </group>
342 
343  // set the epoch type for the TIME column.
344  // <note role=tip>
345  // In principle this function can only be used if the table is empty,
346  // otherwise already written values may thereafter have an incorrect
347  // reference, offset, or unit. However, it is possible that part of the
348  // table gets written before these values are known. In that case the
349  // reference, offset, or units can be set by using a False
350  // <src>tableMustBeEmpty</src> argument.
351  // </note>
352  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
353 
354 protected:
355  //# default constructor creates a object that is not usable. Use the attach
356  //# function correct this.
358 
359  //# attach this object to the supplied table.
360  void attach(MSWeather& msWeather);
361 
362 private:
363  //# Make the assignment operator and the copy constructor private to prevent
364  //# any compiler generated one from being used.
367 
368  //# Check if any optional columns exist and if so attach them.
369  void attachOptionalCols(MSWeather& msWeather);
370 
371  //# required columns
375  //# optional columns
392 
393  //# Access to Measure columns
395 
396  //# Access to Quantum columns
399  //# optional Quantum columns
407 };
408 
409 } //# NAMESPACE CASACORE - END
410 
411 #endif
const ROScalarColumn< Float > & dewPoint() const
Access to optional columns.
ROMSWeatherColumns & operator=(const ROMSWeatherColumns &)
const ROScalarColumn< Bool > & dewPointFlag() const
ScalarQuantColumn< Float > & pressureQuant()
ScalarColumn< Double > interval_p
const ROScalarColumn< Bool > & windDirectionFlag() const
const ROScalarColumn< Int > & antennaId() const
Access to columns.
ROScalarColumn< Float > relHumidity_p
Bool isNull() const
Is this object defined? (MSWeather table is optional)
ScalarColumn< Int > & antennaId()
Read-write access to required columns.
ROScalarColumn< Float > pressure_p
const ROScalarColumn< Bool > & temperatureFlag() const
ScalarColumn< Float > & ionosElectron()
ScalarColumn< Bool > windSpeedFlag_p
const ROScalarQuantColumn< Float > & dewPointQuant() const
const ROScalarColumn< Float > & temperature() const
ScalarQuantColumn< Float > windSpeedQuant_p
ScalarQuantColumn< Float > & windSpeedQuant()
ROScalarColumn< Double > interval_p
ScalarColumn< Float > pressure_p
void attach(MSWeather &msWeather)
ROScalarQuantColumn< Float > windSpeedQuant_p
ScalarColumn< Float > & temperature()
ScalarColumn< Float > temperature_p
ScalarColumn< Float > & dewPoint()
Read-write access to optional columns.
ScalarColumn< Float > H2O_p
ScalarQuantColumn< Float > & temperatureQuant()
ROScalarColumn< Float > H2O_p
A Table intended to hold a MeasurementSet WEATHER table.
Definition: MSWeather.h:78
ScalarColumn< Float > & windSpeed()
ScalarColumn< Bool > windDirectionFlag_p
ScalarColumn< Int > antennaId_p
ScalarColumn< Bool > ionosElectronFlag_p
const ROScalarColumn< Bool > & windDirectionFlag() const
ScalarColumn< Float > & pressure()
ScalarQuantColumn< Float > H2OQuant_p
ScalarColumn< Bool > pressureFlag_p
ROScalarColumn< Float > temperature_p
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
const ROScalarColumn< Float > & dewPoint() const
Read-only access to optional columns.
ScalarQuantColumn< Float > ionosElectronQuant_p
const ROScalarQuantColumn< Float > & temperatureQuant() const
ScalarQuantColumn< Double > & timeQuant()
const ROScalarColumn< Float > & relHumidity() const
const ROScalarQuantColumn< Float > & H2OQuant() const
const ROScalarColumn< Bool > & H2OFlag() const
ScalarColumn< Float > dewPoint_p
const ROScalarMeasColumn< MEpoch > & timeMeas() const
ScalarColumn< Bool > & dewPointFlag()
ScalarColumn< Bool > H2OFlag_p
const ROScalarQuantColumn< Double > & intervalQuant() const
ScalarColumn< Bool > & relHumidityFlag()
A class to provide easy read-only access to MSWeather columns.
ScalarColumn< Float > ionosElectron_p
ROScalarColumn< Float > windSpeed_p
ScalarColumn< Float > & windDirection()
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
const ROScalarColumn< Float > & windDirection() const
ScalarMeasColumn< MEpoch > timeMeas_p
const ROScalarQuantColumn< Float > & windSpeedQuant() const
const ROScalarQuantColumn< Float > & windSpeedQuant() const
ROScalarColumn< Float > ionosElectron_p
ScalarColumn< Double > & time()
const ROScalarColumn< Float > & windDirection() const
ROScalarColumn< Bool > H2OFlag_p
~MSWeatherColumns()
The destructor does nothing special.
const ROScalarColumn< Double > & interval() const
ROScalarColumn< Bool > pressureFlag_p
const ROScalarColumn< Bool > & pressureFlag() const
const ROScalarColumn< Float > & windSpeed() const
ROScalarColumn< Bool > windSpeedFlag_p
ROScalarQuantColumn< Float > dewPointQuant_p
ROScalarColumn< Bool > ionosElectronFlag_p
ROScalarColumn< Bool > windDirectionFlag_p
ScalarColumn< Float > relHumidity_p
ROScalarMeasColumn< MEpoch > timeMeas_p
const ROScalarQuantColumn< Double > & intervalQuant() const
const ROScalarQuantColumn< Float > & windDirectionQuant() const
ScalarQuantColumn< Double > timeQuant_p
~ROMSWeatherColumns()
The destructor does nothing special.
const ROScalarColumn< Bool > & H2OFlag() const
const ROScalarQuantColumn< Double > & timeQuant() const
ROScalarColumn< Bool > relHumidityFlag_p
ScalarColumn< Float > windSpeed_p
void attach(const MSWeather &msWeather)
const ROScalarColumn< Bool > & windSpeedFlag() const
MSWeatherColumns & operator=(const MSWeatherColumns &)
ScalarColumn< Float > & relHumidity()
ROScalarColumn< Bool > dewPointFlag_p
ScalarColumn< Bool > temperatureFlag_p
ScalarColumn< Bool > & temperatureFlag()
const ROScalarQuantColumn< Float > & ionosElectronQuant() const
void attachOptionalCols(MSWeather &msWeather)
ROScalarQuantColumn< Float > H2OQuant_p
const ROScalarColumn< Float > & relHumidity() const
const ROScalarColumn< Bool > & relHumidityFlag() const
ScalarColumn< Double > time_p
ScalarQuantColumn< Double > intervalQuant_p
ROScalarColumn< Double > time_p
ROScalarQuantColumn< Double > timeQuant_p
ScalarColumn< Bool > & windDirectionFlag()
const ROScalarQuantColumn< Float > & windDirectionQuant() const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ScalarColumn< Float > windDirection_p
const ROScalarColumn< Float > & windSpeed() const
ROScalarColumn< Int > antennaId_p
const ROScalarColumn< Float > & pressure() const
ScalarColumn< Bool > dewPointFlag_p
const ROScalarQuantColumn< Float > & H2OQuant() const
const ROScalarColumn< Double > & time() const
ROScalarColumn< Float > dewPoint_p
const ROScalarColumn< Double > & interval() const
ScalarQuantColumn< Float > dewPointQuant_p
ScalarColumn< Bool > & ionosElectronFlag()
const ROScalarQuantColumn< Double > & timeQuant() const
const ROScalarQuantColumn< Float > & temperatureQuant() const
ROScalarQuantColumn< Double > intervalQuant_p
const ROScalarColumn< Bool > & ionosElectronFlag() const
const ROScalarMeasColumn< MEpoch > & timeMeas() const
const ROScalarQuantColumn< Float > & pressureQuant() const
const ROScalarColumn< Float > & H2O() const
ScalarQuantColumn< Float > & H2OQuant()
ScalarMeasColumn< MEpoch > & timeMeas()
const ROScalarColumn< Bool > & windSpeedFlag() const
const ROScalarColumn< Float > & temperature() const
ScalarColumn< Float > & H2O()
const ROScalarColumn< Bool > & pressureFlag() const
const ROScalarColumn< Float > & pressure() const
ScalarColumn< Bool > & windSpeedFlag()
ScalarColumn< Bool > & pressureFlag()
void attachOptionalCols(const MSWeather &msWeather)
ROScalarColumn< Bool > temperatureFlag_p
ScalarQuantColumn< Float > & dewPointQuant()
const ROScalarColumn< Float > & ionosElectron() const
ROScalarQuantColumn< Float > windDirectionQuant_p
ROScalarQuantColumn< Float > temperatureQuant_p
ROScalarColumn< Float > windDirection_p
ScalarColumn< Bool > relHumidityFlag_p
const ROScalarQuantColumn< Float > & dewPointQuant() const
const ROScalarColumn< Bool > & temperatureFlag() const
ScalarColumn< Double > & interval()
ScalarQuantColumn< Float > pressureQuant_p
ScalarQuantColumn< Float > & ionosElectronQuant()
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ScalarQuantColumn< Double > & intervalQuant()
const ROScalarColumn< Bool > & ionosElectronFlag() const
ScalarColumn< Bool > & H2OFlag()
const ROScalarColumn< Bool > & relHumidityFlag() const
const ROScalarColumn< Bool > & dewPointFlag() const
const ROScalarColumn< Float > & ionosElectron() const
ScalarQuantColumn< Float > temperatureQuant_p
ROScalarQuantColumn< Float > pressureQuant_p
const Bool True
Definition: aipstype.h:43
const ROScalarColumn< Double > & time() const
const ROScalarQuantColumn< Float > & pressureQuant() const
ScalarQuantColumn< Float > windDirectionQuant_p
const ROScalarQuantColumn< Float > & ionosElectronQuant() const
ScalarQuantColumn< Float > & windDirectionQuant()
unsigned int uInt
Definition: aipstype.h:51
const ROScalarColumn< Int > & antennaId() const
Read-only access to required columns.
ROScalarQuantColumn< Float > ionosElectronQuant_p
const ROScalarColumn< Float > & H2O() const
A class to provide easy read-write access to MSWeather columns.
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42