casacore
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>
32 #include <casacore/measures/Measures/MEpoch.h>
33 #include <casacore/measures/Measures/MCEpoch.h>
34 #include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
35 #include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
36 #include <casacore/tables/Tables/ScalarColumn.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  uInt 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
casacore::MSWeatherColumns::interval
const ScalarColumn< Double > & interval() const
Definition: MSWeatherColumns.h:127
casacore::MSWeatherColumns::ionosElectronQuant_p
ScalarQuantColumn< Float > ionosElectronQuant_p
Definition: MSWeatherColumns.h:238
casacore::MSWeatherColumns::setEpochRef
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
casacore::MSWeatherColumns::ionosElectronFlag
ScalarColumn< Bool > & ionosElectronFlag()
Definition: MSWeatherColumns.h:107
casacore::ROMSWeatherColumns
MSWeatherColumns ROMSWeatherColumns
Definition: MSWeatherColumns.h:246
casacore::MSWeatherColumns::attach
void attach(const MSWeather &msWeather)
casacore::MSWeatherColumns::ionosElectron_p
ScalarColumn< Float > ionosElectron_p
Definition: MSWeatherColumns.h:216
casacore::MSWeatherColumns::windDirection
ScalarColumn< Float > & windDirection()
Definition: MSWeatherColumns.h:116
casacore::MSWeatherColumns
A class to provide easy access to MSWeather columns.
Definition: MSWeatherColumns.h:76
casacore::MSWeatherColumns::MSWeatherColumns
MSWeatherColumns(const MSWeatherColumns &)
casacore::MSWeatherColumns::ionosElectronQuant
ScalarQuantColumn< Float > & ionosElectronQuant()
Definition: MSWeatherColumns.h:106
casacore::MSWeatherColumns::pressureQuant_p
ScalarQuantColumn< Float > pressureQuant_p
Definition: MSWeatherColumns.h:239
casacore::MSWeatherColumns::temperatureQuant_p
ScalarQuantColumn< Float > temperatureQuant_p
Definition: MSWeatherColumns.h:240
casacore::MSWeatherColumns::temperature
const ScalarColumn< Float > & temperature() const
Definition: MSWeatherColumns.h:156
casacore::MSWeatherColumns::relHumidity
const ScalarColumn< Float > & relHumidity() const
Definition: MSWeatherColumns.h:153
casacore::MSWeatherColumns::dewPointFlag
const ScalarColumn< Bool > & dewPointFlag() const
Definition: MSWeatherColumns.h:140
casacore::MSWeatherColumns::H2OQuant
const ScalarQuantColumn< Float > & H2OQuant() const
Definition: MSWeatherColumns.h:143
casacore::MSWeatherColumns::windDirection
const ScalarColumn< Float > & windDirection() const
Definition: MSWeatherColumns.h:161
casacore::MSWeatherColumns::windDirectionQuant_p
ScalarQuantColumn< Float > windDirectionQuant_p
Definition: MSWeatherColumns.h:241
casacore::MSWeatherColumns::relHumidity
ScalarColumn< Float > & relHumidity()
Definition: MSWeatherColumns.h:111
casacore::MSWeatherColumns::temperatureFlag
ScalarColumn< Bool > & temperatureFlag()
Definition: MSWeatherColumns.h:115
casacore::MSWeatherColumns::nrow
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
Definition: MSWeatherColumns.h:174
casacore::MSWeatherColumns::time
const ScalarColumn< Double > & time() const
Definition: MSWeatherColumns.h:130
casacore::MSWeather
A Table intended to hold a MeasurementSet WEATHER table.
Definition: MSWeather.h:80
casacore::MSWeatherColumns::intervalQuant
ScalarQuantColumn< Double > & intervalQuant()
Definition: MSWeatherColumns.h:91
casacore::MSWeatherColumns::windSpeed_p
ScalarColumn< Float > windSpeed_p
Definition: MSWeatherColumns.h:226
casacore::ScalarColumn< Int >
casacore::MSWeatherColumns::MSWeatherColumns
MSWeatherColumns(const MSWeather &msWeather)
Create a columns object that accesses the data in the specified Table.
casacore::MSWeatherColumns::pressureQuant
ScalarQuantColumn< Float > & pressureQuant()
Definition: MSWeatherColumns.h:109
casacore::MSWeatherColumns::operator=
MSWeatherColumns & operator=(const MSWeatherColumns &)
casacore::MSWeatherColumns::temperatureFlag_p
ScalarColumn< Bool > temperatureFlag_p
Definition: MSWeatherColumns.h:223
casacore::MSWeatherColumns::time_p
ScalarColumn< Double > time_p
Definition: MSWeatherColumns.h:210
casacore::MSWeatherColumns::windDirection_p
ScalarColumn< Float > windDirection_p
Definition: MSWeatherColumns.h:224
casacore::MSWeatherColumns::timeMeas
ScalarMeasColumn< MEpoch > & timeMeas()
Definition: MSWeatherColumns.h:94
casacore::MSWeatherColumns::H2OQuant
ScalarQuantColumn< Float > & H2OQuant()
Definition: MSWeatherColumns.h:103
casacore::MSWeatherColumns::ionosElectronFlag
const ScalarColumn< Bool > & ionosElectronFlag() const
Definition: MSWeatherColumns.h:147
casacore::MSWeatherColumns::windSpeedFlag_p
ScalarColumn< Bool > windSpeedFlag_p
Definition: MSWeatherColumns.h:227
casacore::MSWeatherColumns::attachOptionalCols
void attachOptionalCols(const MSWeather &msWeather)
casacore::MSWeatherColumns::windDirectionQuant
const ScalarQuantColumn< Float > & windDirectionQuant() const
Definition: MSWeatherColumns.h:162
casacore::MSWeatherColumns::interval_p
ScalarColumn< Double > interval_p
Definition: MSWeatherColumns.h:209
casacore::MSWeatherColumns::windSpeedQuant_p
ScalarQuantColumn< Float > windSpeedQuant_p
Definition: MSWeatherColumns.h:242
casacore::MSWeatherColumns::windSpeedFlag
const ScalarColumn< Bool > & windSpeedFlag() const
Definition: MSWeatherColumns.h:169
casacore::MSWeatherColumns::pressureFlag
ScalarColumn< Bool > & pressureFlag()
Definition: MSWeatherColumns.h:110
casacore::MSWeatherColumns::antennaId
ScalarColumn< Int > & antennaId()
Access to required columns.
Definition: MSWeatherColumns.h:89
casacore::MEpoch::Types
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
casacore::MSWeatherColumns::dewPointQuant_p
ScalarQuantColumn< Float > dewPointQuant_p
Definition: MSWeatherColumns.h:236
casacore::MSWeatherColumns::temperature_p
ScalarColumn< Float > temperature_p
Definition: MSWeatherColumns.h:222
casacore::MSWeatherColumns::dewPointQuant
ScalarQuantColumn< Float > & dewPointQuant()
Definition: MSWeatherColumns.h:100
casacore::MSWeatherColumns::isNull
Bool isNull() const
Is this object defined? (MSWeather table is optional)
Definition: MSWeatherColumns.h:85
casacore::MSWeatherColumns::timeQuant
const ScalarQuantColumn< Double > & timeQuant() const
Definition: MSWeatherColumns.h:131
casacore::MSWeatherColumns::MSWeatherColumns
MSWeatherColumns()
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::MSWeatherColumns::ionosElectron
const ScalarColumn< Float > & ionosElectron() const
Definition: MSWeatherColumns.h:144
casacore::MSWeatherColumns::interval
ScalarColumn< Double > & interval()
Definition: MSWeatherColumns.h:90
casacore::MSWeatherColumns::temperatureFlag
const ScalarColumn< Bool > & temperatureFlag() const
Definition: MSWeatherColumns.h:159
casacore::MSWeatherColumns::ionosElectronFlag_p
ScalarColumn< Bool > ionosElectronFlag_p
Definition: MSWeatherColumns.h:217
casacore::MSWeatherColumns::relHumidityFlag_p
ScalarColumn< Bool > relHumidityFlag_p
Definition: MSWeatherColumns.h:221
casacore::MSWeatherColumns::windSpeed
ScalarColumn< Float > & windSpeed()
Definition: MSWeatherColumns.h:119
casacore::MSWeatherColumns::pressureFlag
const ScalarColumn< Bool > & pressureFlag() const
Definition: MSWeatherColumns.h:152
casacore::MSWeatherColumns::dewPointFlag
ScalarColumn< Bool > & dewPointFlag()
Definition: MSWeatherColumns.h:101
casacore::MSWeatherColumns::dewPoint_p
ScalarColumn< Float > dewPoint_p
Definition: MSWeatherColumns.h:212
casacore::MSWeatherColumns::intervalQuant
const ScalarQuantColumn< Double > & intervalQuant() const
Definition: MSWeatherColumns.h:128
casacore::MSWeatherColumns::pressure
ScalarColumn< Float > & pressure()
Definition: MSWeatherColumns.h:108
casacore::MSWeatherColumns::relHumidityFlag
ScalarColumn< Bool > & relHumidityFlag()
Definition: MSWeatherColumns.h:112
casacore::MSWeatherColumns::H2O
const ScalarColumn< Float > & H2O() const
Definition: MSWeatherColumns.h:141
casacore::MSWeatherColumns::H2OQuant_p
ScalarQuantColumn< Float > H2OQuant_p
Definition: MSWeatherColumns.h:237
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::MSWeatherColumns::dewPointQuant
const ScalarQuantColumn< Float > & dewPointQuant() const
Definition: MSWeatherColumns.h:138
casacore::MSWeatherColumns::windDirectionQuant
ScalarQuantColumn< Float > & windDirectionQuant()
Definition: MSWeatherColumns.h:117
casacore::MSWeatherColumns::timeMeas_p
ScalarMeasColumn< MEpoch > timeMeas_p
Definition: MSWeatherColumns.h:230
casacore::MSWeatherColumns::timeQuant
ScalarQuantColumn< Double > & timeQuant()
Definition: MSWeatherColumns.h:93
casacore::MSWeatherColumns::H2OFlag
const ScalarColumn< Bool > & H2OFlag() const
Definition: MSWeatherColumns.h:142
casacore::MSWeatherColumns::pressure
const ScalarColumn< Float > & pressure() const
Definition: MSWeatherColumns.h:149
casacore::MSWeatherColumns::H2OFlag
ScalarColumn< Bool > & H2OFlag()
Definition: MSWeatherColumns.h:104
casacore::True
const Bool True
Definition: aipstype.h:43
casacore::MSWeatherColumns::~MSWeatherColumns
~MSWeatherColumns()
The destructor does nothing special.
casacore::MSWeatherColumns::isNull_p
Bool isNull_p
Definition: MSWeatherColumns.h:205
casacore::MSWeatherColumns::ionosElectron
ScalarColumn< Float > & ionosElectron()
Definition: MSWeatherColumns.h:105
casacore::MSWeatherColumns::relHumidity_p
ScalarColumn< Float > relHumidity_p
Definition: MSWeatherColumns.h:220
casacore::MSWeatherColumns::time
ScalarColumn< Double > & time()
Definition: MSWeatherColumns.h:92
casacore::ScalarQuantColumn< Double >
casacore::MSWeatherColumns::pressure_p
ScalarColumn< Float > pressure_p
Definition: MSWeatherColumns.h:218
casacore::MSWeatherColumns::ionosElectronQuant
const ScalarQuantColumn< Float > & ionosElectronQuant() const
Definition: MSWeatherColumns.h:145
casacore::MSWeatherColumns::dewPoint
ScalarColumn< Float > & dewPoint()
Access to optional columns.
Definition: MSWeatherColumns.h:99
casacore::MSWeatherColumns::H2O_p
ScalarColumn< Float > H2O_p
Definition: MSWeatherColumns.h:214
casacore::MSWeatherColumns::antennaId
const ScalarColumn< Int > & antennaId() const
Const access to columns.
Definition: MSWeatherColumns.h:126
casacore::ScalarMeasColumn< MEpoch >
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::MSWeatherColumns::intervalQuant_p
ScalarQuantColumn< Double > intervalQuant_p
Definition: MSWeatherColumns.h:233
casacore::MSWeatherColumns::windDirectionFlag
const ScalarColumn< Bool > & windDirectionFlag() const
Definition: MSWeatherColumns.h:164
casacore::MSWeatherColumns::timeQuant_p
ScalarQuantColumn< Double > timeQuant_p
Definition: MSWeatherColumns.h:234
casacore::MSWeatherColumns::relHumidityFlag
const ScalarColumn< Bool > & relHumidityFlag() const
Definition: MSWeatherColumns.h:154
casacore::MSWeatherColumns::temperatureQuant
const ScalarQuantColumn< Float > & temperatureQuant() const
Definition: MSWeatherColumns.h:157
casacore::MSWeatherColumns::antennaId_p
ScalarColumn< Int > antennaId_p
Definition: MSWeatherColumns.h:208
casacore::MSWeatherColumns::windSpeedQuant
ScalarQuantColumn< Float > & windSpeedQuant()
Definition: MSWeatherColumns.h:120
casacore::MSWeatherColumns::dewPointFlag_p
ScalarColumn< Bool > dewPointFlag_p
Definition: MSWeatherColumns.h:213
casacore::MSWeatherColumns::temperature
ScalarColumn< Float > & temperature()
Definition: MSWeatherColumns.h:113
casacore::MSWeatherColumns::windSpeed
const ScalarColumn< Float > & windSpeed() const
Definition: MSWeatherColumns.h:166
casacore::MSWeatherColumns::temperatureQuant
ScalarQuantColumn< Float > & temperatureQuant()
Definition: MSWeatherColumns.h:114
casacore::MSWeatherColumns::windDirectionFlag_p
ScalarColumn< Bool > windDirectionFlag_p
Definition: MSWeatherColumns.h:225
casacore::MSWeatherColumns::windDirectionFlag
ScalarColumn< Bool > & windDirectionFlag()
Definition: MSWeatherColumns.h:118
casacore::MSWeatherColumns::H2OFlag_p
ScalarColumn< Bool > H2OFlag_p
Definition: MSWeatherColumns.h:215
casacore::MSWeatherColumns::H2O
ScalarColumn< Float > & H2O()
Definition: MSWeatherColumns.h:102
casacore::MSWeatherColumns::timeMeas
const ScalarMeasColumn< MEpoch > & timeMeas() const
Definition: MSWeatherColumns.h:132
casacore::MSWeatherColumns::windSpeedQuant
const ScalarQuantColumn< Float > & windSpeedQuant() const
Definition: MSWeatherColumns.h:167
casacore::MSWeatherColumns::pressureQuant
const ScalarQuantColumn< Float > & pressureQuant() const
Definition: MSWeatherColumns.h:150
casacore::MSWeatherColumns::dewPoint
const ScalarColumn< Float > & dewPoint() const
Access to optional columns.
Definition: MSWeatherColumns.h:137
casacore::MSWeatherColumns::windSpeedFlag
ScalarColumn< Bool > & windSpeedFlag()
Definition: MSWeatherColumns.h:121
casacore::MSWeatherColumns::pressureFlag_p
ScalarColumn< Bool > pressureFlag_p
Definition: MSWeatherColumns.h:219