casacore
Loading...
Searching...
No Matches
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: 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_MSWEATHERCOLUMNS_H
27#define MS_MSWEATHERCOLUMNS_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/measures/Measures/MEpoch.h>
31#include <casacore/measures/Measures/MCEpoch.h>
32#include <casacore/measures/TableMeasures/ScalarMeasColumn.h>
33#include <casacore/measures/TableMeasures/ScalarQuantColumn.h>
34#include <casacore/tables/Tables/ScalarColumn.h>
35
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38class MSWeather;
39
40// <summary>
41// A class to provide easy access to MSWeather columns
42// </summary>
43
44// <use visibility=export>
45
46// <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos="">
47// </reviewed>
48
49// <prerequisite>
50// <li> MSWeather
51// <li> ArrayColumn
52// <li> ScalarColumn
53// </prerequisite>
54//
55// <etymology>
56// MSWeatherColumns stands for MeasurementSet Weather Table columns.
57// </etymology>
58//
59// <synopsis>
60// This class provides access to the columns in the MSWeather Table,
61// it does the declaration of all the Scalar and ArrayColumns with the
62// correct types, so the application programmer doesn't have to
63// worry about getting those right. There is an access function
64// for every predefined column. Access to non-predefined columns will still
65// have to be done with explicit declarations.
66// See <linkto class=MSColumns> MSColumns</linkto> for an example.
67// </synopsis>
68//
69// <motivation>
70// See <linkto class=MSColumns> MSColumns</linkto> for the motivation.
71// </motivation>
72
74{
75public:
76 // Create a columns object that accesses the data in the specified Table
77 MSWeatherColumns(const MSWeather& msWeather);
78
79 // The destructor does nothing special
81
82 // Is this object defined? (MSWeather table is optional)
83 Bool isNull() const {return isNull_p;}
84
85 // Access to required columns
86 // <group>
93 // </group>
94
95 // Access to optional columns
96 // <group>
120 // </group>
121
122 // Const access to columns
123 // <group>
124 const ScalarColumn<Int>& antennaId() const {return antennaId_p;}
125 const ScalarColumn<Double>& interval() const {return interval_p;}
128 const ScalarColumn<Double>& time() const {return time_p;}
131 // </group>
132
133 // Access to optional columns
134 // <group>
135 const ScalarColumn<Float>& dewPoint() const {return dewPoint_p;}
139 const ScalarColumn<Float>& H2O() const {return H2O_p;}
140 const ScalarColumn<Bool>& H2OFlag() const {return H2OFlag_p;}
147 const ScalarColumn<Float>& pressure() const {return pressure_p;}
168 // </group>
169
170 // Convenience function that returns the number of rows in any of the
171 // columns. Returns zero if the object is null.
172 rownr_t nrow() const {return isNull() ? 0 : antennaId_p.nrow();}
173
174 // set the epoch type for the TIME column.
175 // <note role=tip>
176 // In principle this function can only be used if the table is empty,
177 // otherwise already written values may thereafter have an incorrect
178 // reference, offset, or unit. However, it is possible that part of the
179 // table gets written before these values are known. In that case the
180 // reference, offset, or units can be set by using a False
181 // <src>tableMustBeEmpty</src> argument.
182 // </note>
183 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True);
184
185protected:
186 //# default constructor creates a object that is not usable. Use the attach
187 //# function correct this.
189
190 //# attach this object to the supplied table.
191 void attach(const MSWeather& msWeather);
192
193private:
194 //# Make the assignment operator and the copy constructor private to prevent
195 //# any compiler generated one from being used.
198
199 //# Check if any optional columns exist and if so attach them.
200 void attachOptionalCols(const MSWeather& msWeather);
201
202 //# Is the object not attached to a Table.
204
205 //# required columns
209 //# optional columns
226
227 //# Access to Measure columns
229
230 //# Access to Quantum columns
233 //# optional Quantum columns
241};
242
243//# Define the RO version for backward compatibility.
245
246} //# NAMESPACE CASACORE - END
247
248#endif
Types
Types of known MEpochs Caution: The order defines the order in the translation matrix in the MCEpoch...
Definition MEpoch.h:114
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.
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41
MSWeatherColumns ROMSWeatherColumns
uInt64 rownr_t
Define the type of a row number in a table.
Definition aipsxtype.h:44