casacore
 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 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 // MSWeatherColumns stands for MeasurementSet Weather Table columns.
59 // </etymology>
60 //
61 // <synopsis>
62 // This class provides access to the columns in the MSWeather Table,
63 // it does the declaration of all the Scalar and ArrayColumns with the
64 // correct types, so the application programmer doesn't have to
65 // worry about getting those right. There is an access function
66 // for every predefined column. Access to non-predefined columns will still
67 // have to be done with explicit declarations.
68 // See <linkto class=MSColumns> MSColumns</linkto> for an example.
69 // </synopsis>
70 //
71 // <motivation>
72 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
73 // </motivation>
74 
76 {
77 public:
78  // Create a columns object that accesses the data in the specified Table
79  MSWeatherColumns(const MSWeather& msWeather);
80 
81  // The destructor does nothing special
83 
84  // Is this object defined? (MSWeather table is optional)
85  Bool isNull() const {return isNull_p;}
86 
87  // Access to required columns
88  // <group>
95  // </group>
96 
97  // Access to optional columns
98  // <group>
122  // </group>
123 
124  // Const access to columns
125  // <group>
126  const ScalarColumn<Int>& antennaId() const {return antennaId_p;}
127  const ScalarColumn<Double>& interval() const {return interval_p;}
129  return intervalQuant_p;}
130  const ScalarColumn<Double>& time() const {return time_p;}
133  // </group>
134 
135  // Access to optional columns
136  // <group>
137  const ScalarColumn<Float>& dewPoint() const {return dewPoint_p;}
139  return dewPointQuant_p;}
141  const ScalarColumn<Float>& H2O() const {return H2O_p;}
142  const ScalarColumn<Bool>& H2OFlag() const {return H2OFlag_p;}
146  return ionosElectronQuant_p;}
148  return ionosElectronFlag_p;}
149  const ScalarColumn<Float>& pressure() const {return pressure_p;}
151  return pressureQuant_p;}
155  return relHumidityFlag_p;}
158  return temperatureQuant_p;}
160  return temperatureFlag_p;}
163  return windDirectionQuant_p;}
165  return windDirectionFlag_p;}
166  const ScalarColumn<Float>& windSpeed() const {return windSpeed_p;}
168  return windSpeedQuant_p;}
170  // </group>
171 
172  // Convenience function that returns the number of rows in any of the
173  // columns. Returns zero if the object is null.
174  rownr_t nrow() const {return isNull() ? 0 : antennaId_p.nrow();}
175 
176  // set the epoch type for the TIME column.
177  // <note role=tip>
178  // In principle this function can only be used if the table is empty,
179  // otherwise already written values may thereafter have an incorrect
180  // reference, offset, or unit. However, it is possible that part of the
181  // table gets written before these values are known. In that case the
182  // reference, offset, or units can be set by using a False
183  // <src>tableMustBeEmpty</src> argument.
184  // </note>
185  void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
186 
187 protected:
188  //# default constructor creates a object that is not usable. Use the attach
189  //# function correct this.
191 
192  //# attach this object to the supplied table.
193  void attach(const MSWeather& msWeather);
194 
195 private:
196  //# Make the assignment operator and the copy constructor private to prevent
197  //# any compiler generated one from being used.
200 
201  //# Check if any optional columns exist and if so attach them.
202  void attachOptionalCols(const MSWeather& msWeather);
203 
204  //# Is the object not attached to a Table.
206 
207  //# required columns
211  //# optional columns
228 
229  //# Access to Measure columns
231 
232  //# Access to Quantum columns
235  //# optional Quantum columns
243 };
244 
245 //# Define the RO version for backward compatibility.
247 
248 } //# NAMESPACE CASACORE - END
249 
250 #endif
const ScalarQuantColumn< Float > & pressureQuant() const
const ScalarColumn< Float > & temperature() const
ScalarQuantColumn< Float > & pressureQuant()
const ScalarColumn< Bool > & relHumidityFlag() const
ScalarColumn< Double > interval_p
ScalarColumn< Int > & antennaId()
Access to required columns.
ScalarColumn< Float > & ionosElectron()
ScalarColumn< Bool > windSpeedFlag_p
Bool isNull() const
Is this object defined? (MSWeather table is optional)
const ScalarColumn< Int > & antennaId() const
Const access to columns.
const ScalarColumn< Float > & ionosElectron() const
ScalarQuantColumn< Float > windSpeedQuant_p
ScalarQuantColumn< Float > & windSpeedQuant()
const ScalarQuantColumn< Float > & H2OQuant() const
ScalarColumn< Float > pressure_p
ScalarColumn< Float > & temperature()
ScalarColumn< Float > temperature_p
ScalarColumn< Float > & dewPoint()
Access to optional columns.
ScalarColumn< Float > H2O_p
ScalarQuantColumn< Float > & temperatureQuant()
A Table intended to hold a MeasurementSet WEATHER table.
Definition: MSWeather.h:78
ScalarColumn< Float > & windSpeed()
const ScalarQuantColumn< Float > & windSpeedQuant() const
ScalarColumn< Bool > windDirectionFlag_p
ScalarColumn< Int > antennaId_p
ScalarColumn< Bool > ionosElectronFlag_p
const ScalarQuantColumn< Double > & intervalQuant() const
ScalarColumn< Float > & pressure()
ScalarQuantColumn< Float > H2OQuant_p
ScalarColumn< Bool > pressureFlag_p
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
ScalarQuantColumn< Float > ionosElectronQuant_p
ScalarQuantColumn< Double > & timeQuant()
const ScalarQuantColumn< Double > & timeQuant() const
ScalarColumn< Float > dewPoint_p
ScalarColumn< Bool > & dewPointFlag()
ScalarColumn< Bool > H2OFlag_p
ScalarColumn< Bool > & relHumidityFlag()
const ScalarColumn< Float > & dewPoint() const
Access to optional columns.
ScalarColumn< Float > ionosElectron_p
const ScalarColumn< Bool > & pressureFlag() const
ScalarColumn< Float > & windDirection()
const ScalarColumn< Bool > & windSpeedFlag() const
ScalarMeasColumn< MEpoch > timeMeas_p
const ScalarQuantColumn< Float > & ionosElectronQuant() const
ScalarColumn< Double > & time()
~MSWeatherColumns()
The destructor does nothing special.
rownr_t nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
void attach(const MSWeather &msWeather)
ScalarColumn< Float > relHumidity_p
ScalarQuantColumn< Double > timeQuant_p
const ScalarColumn< Bool > & dewPointFlag() const
const ScalarColumn< Double > & time() const
ScalarColumn< Float > windSpeed_p
const ScalarQuantColumn< Float > & temperatureQuant() const
const ScalarColumn< Float > & pressure() const
MSWeatherColumns ROMSWeatherColumns
const ScalarMeasColumn< MEpoch > & timeMeas() const
MSWeatherColumns & operator=(const MSWeatherColumns &)
ScalarColumn< Float > & relHumidity()
ScalarColumn< Bool > temperatureFlag_p
ScalarColumn< Bool > & temperatureFlag()
ScalarColumn< Double > time_p
ScalarQuantColumn< Double > intervalQuant_p
ScalarColumn< Bool > & windDirectionFlag()
const ScalarColumn< Float > & windSpeed() const
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ScalarColumn< Float > windDirection_p
ScalarColumn< Bool > dewPointFlag_p
const ScalarColumn< Bool > & temperatureFlag() const
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
const ScalarQuantColumn< Float > & dewPointQuant() const
ScalarQuantColumn< Float > dewPointQuant_p
ScalarColumn< Bool > & ionosElectronFlag()
const ScalarColumn< Bool > & windDirectionFlag() const
ScalarQuantColumn< Float > & H2OQuant()
ScalarMeasColumn< MEpoch > & timeMeas()
ScalarColumn< Float > & H2O()
void attachOptionalCols(const MSWeather &msWeather)
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
ScalarColumn< Bool > & windSpeedFlag()
const ScalarColumn< Float > & windDirection() const
ScalarColumn< Bool > & pressureFlag()
ScalarQuantColumn< Float > & dewPointQuant()
const ScalarColumn< Float > & H2O() const
ScalarColumn< Bool > relHumidityFlag_p
const ScalarColumn< Bool > & ionosElectronFlag() const
const ScalarColumn< Bool > & H2OFlag() const
ScalarColumn< Double > & interval()
const ScalarColumn< Double > & interval() const
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()
ScalarColumn< Bool > & H2OFlag()
ScalarQuantColumn< Float > temperatureQuant_p
const Bool True
Definition: aipstype.h:43
ScalarQuantColumn< Float > windDirectionQuant_p
const ScalarQuantColumn< Float > & windDirectionQuant() const
const ScalarColumn< Float > & relHumidity() const
ScalarQuantColumn< Float > & windDirectionQuant()
A class to provide easy access to MSWeather columns.