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
38namespace casacore { //# NAMESPACE CASACORE - BEGIN
39
40class 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{
77public:
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;}
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
187protected:
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
195private:
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
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition: MEpoch.h:117
ScalarColumn< Bool > windDirectionFlag_p
const ScalarQuantColumn< Float > & dewPointQuant() const
const ScalarColumn< Float > & pressure() const
const ScalarQuantColumn< Float > & windSpeedQuant() const
const ScalarColumn< Float > & ionosElectron() const
const ScalarColumn< Double > & time() const
const ScalarColumn< Bool > & relHumidityFlag() const
ScalarColumn< Double > time_p
ScalarQuantColumn< Float > pressureQuant_p
ScalarColumn< Bool > & ionosElectronFlag()
Bool isNull() const
Is this object defined? (MSWeather table is optional)
ScalarColumn< Bool > dewPointFlag_p
ScalarColumn< Double > interval_p
ScalarQuantColumn< Double > & intervalQuant()
ScalarColumn< Float > dewPoint_p
const ScalarColumn< Float > & temperature() const
const ScalarColumn< Bool > & H2OFlag() const
const ScalarColumn< Bool > & windSpeedFlag() const
const ScalarQuantColumn< Float > & H2OQuant() const
const ScalarColumn< Float > & relHumidity() const
void attach(const MSWeather &msWeather)
ScalarMeasColumn< MEpoch > & timeMeas()
const ScalarColumn< Float > & H2O() const
void attachOptionalCols(const MSWeather &msWeather)
ScalarColumn< Bool > & dewPointFlag()
ScalarColumn< Float > relHumidity_p
const ScalarColumn< Bool > & pressureFlag() const
ScalarColumn< Float > & ionosElectron()
ScalarQuantColumn< Float > & windSpeedQuant()
ScalarQuantColumn< Float > windSpeedQuant_p
ScalarColumn< Bool > & pressureFlag()
~MSWeatherColumns()
The destructor does nothing special.
ScalarColumn< Float > & relHumidity()
MSWeatherColumns(const MSWeatherColumns &)
const ScalarColumn< Float > & dewPoint() const
Access to optional columns.
const ScalarColumn< Bool > & temperatureFlag() const
ScalarQuantColumn< Float > & windDirectionQuant()
const ScalarColumn< Int > & antennaId() const
Const access to columns.
ScalarColumn< Bool > & windSpeedFlag()
void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True)
set the epoch type for the TIME column.
const ScalarMeasColumn< MEpoch > & timeMeas() const
ScalarColumn< Float > & windDirection()
ScalarColumn< Float > & H2O()
ScalarColumn< Float > & temperature()
ScalarColumn< Bool > & relHumidityFlag()
ScalarColumn< Float > ionosElectron_p
ScalarColumn< Float > temperature_p
const ScalarQuantColumn< Float > & ionosElectronQuant() const
const ScalarColumn< Bool > & dewPointFlag() const
const ScalarColumn< Bool > & ionosElectronFlag() const
rownr_t nrow() const
Convenience function that returns the number of rows in any of the columns.
ScalarQuantColumn< Float > & dewPointQuant()
ScalarColumn< Float > pressure_p
ScalarQuantColumn< Float > & ionosElectronQuant()
ScalarColumn< Float > windSpeed_p
const ScalarColumn< Bool > & windDirectionFlag() const
ScalarColumn< Float > H2O_p
ScalarQuantColumn< Float > dewPointQuant_p
ScalarColumn< Bool > H2OFlag_p
const ScalarQuantColumn< Double > & timeQuant() const
ScalarColumn< Float > & dewPoint()
Access to optional columns.
ScalarColumn< Float > windDirection_p
ScalarQuantColumn< Double > timeQuant_p
ScalarColumn< Double > & interval()
ScalarQuantColumn< Float > ionosElectronQuant_p
ScalarColumn< Bool > & windDirectionFlag()
ScalarQuantColumn< Float > H2OQuant_p
ScalarColumn< Float > & pressure()
ScalarQuantColumn< Float > & H2OQuant()
ScalarColumn< Bool > & temperatureFlag()
ScalarColumn< Bool > ionosElectronFlag_p
ScalarColumn< Bool > & H2OFlag()
ScalarColumn< Int > & antennaId()
Access to required columns.
ScalarQuantColumn< Float > & pressureQuant()
ScalarColumn< Int > antennaId_p
ScalarColumn< Bool > pressureFlag_p
ScalarColumn< Bool > windSpeedFlag_p
const ScalarQuantColumn< Double > & intervalQuant() const
ScalarQuantColumn< Double > intervalQuant_p
ScalarQuantColumn< Float > temperatureQuant_p
const ScalarQuantColumn< Float > & pressureQuant() const
ScalarColumn< Bool > temperatureFlag_p
ScalarColumn< Float > & windSpeed()
ScalarColumn< Bool > relHumidityFlag_p
const ScalarColumn< Float > & windSpeed() const
MSWeatherColumns & operator=(const MSWeatherColumns &)
const ScalarColumn< Double > & interval() const
ScalarMeasColumn< MEpoch > timeMeas_p
MSWeatherColumns(const MSWeather &msWeather)
Create a columns object that accesses the data in the specified Table.
const ScalarQuantColumn< Float > & windDirectionQuant() const
const ScalarQuantColumn< Float > & temperatureQuant() const
ScalarColumn< Double > & time()
ScalarQuantColumn< Float > windDirectionQuant_p
ScalarQuantColumn< Double > & timeQuant()
ScalarQuantColumn< Float > & temperatureQuant()
const ScalarColumn< Float > & windDirection() const
rownr_t nrow() const
Get the number of rows in the column.
Definition: TableColumn.h:197
this file contains all the compiler specific defines
Definition: mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
const Bool True
Definition: aipstype.h:43
MSWeatherColumns ROMSWeatherColumns
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46