casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WeatherRecord.h
Go to the documentation of this file.
1 /*
2  * WeatherRecord.h
3  *
4  * Created on: Jan 27, 2016
5  * Author: nakazato
6  */
7 
8 #ifndef SINGLEDISH_FILLER_WeatherRECORD_H_
9 #define SINGLEDISH_FILLER_WeatherRECORD_H_
10 
15 
16 namespace casa { //# NAMESPACE CASA - BEGIN
17 namespace sdfiller { //# NAMESPACE SDFILLER - BEGIN
18 
19 struct WeatherRecord {
22 
23  // mandatory
27 
28  // optional
34 
35  // method
36  void clear() {
37  antenna_id = -1;
38  time = 0.0;
39  interval = 0.0;
40  temperature = -1.0;
41  pressure = -1.0;
42  rel_humidity = -1.0;
43  wind_speed = -1.0;
44  wind_direction = -1.0;
45  }
46 
48  antenna_id = other.antenna_id;
49  time = other.time;
50  interval = other.interval;
51  temperature = other.temperature;
52  pressure = other.pressure;
53  rel_humidity = other.rel_humidity;
54  wind_speed = other.wind_speed;
56  return *this;
57  }
58 
59  bool operator==(WeatherRecord const &other) {
60  return (antenna_id == other.antenna_id)
61  && (temperature == other.temperature) && (pressure == other.pressure)
62  && (rel_humidity == other.rel_humidity)
63  && (wind_speed == other.wind_speed)
64  && (wind_direction == other.wind_direction);
65  }
66 
67  void add(AssociatingTable &table, AssociatingColumns &/*columns*/) {
68  table.addRow(1, true);
69  }
70 
72  if (columns.nrow() <= irow) {
73  return false;
74  }
75 
76  columns.antennaId().put(irow, antenna_id);
77  columns.time().put(irow, time);
78  columns.interval().put(irow, interval);
79  columns.temperature().put(irow, temperature);
80  columns.pressure().put(irow, pressure);
81  columns.relHumidity().put(irow, rel_humidity);
82  columns.windSpeed().put(irow, wind_speed);
83  columns.windDirection().put(irow, wind_direction);
84 
85  return true;
86  }
87 };
88 
89 } //# NAMESPACE SDFILLER - END
90 } //# NAMESPACE CASA - END
91 
92 #endif /* SINGLEDISH_FILLER_WeatherRECORD_H_ */
void addRow(uInt nrrow=1, Bool initialize=False)
Add one or more rows at the end of the table.
Definition: Table.h:1235
int Int
Definition: aipstype.h:50
casacore::MSWeather AssociatingTable
Definition: WeatherRecord.h:20
ScalarColumn< Int > & antennaId()
Read-write access to required columns.
casacore::Float wind_direction
Definition: WeatherRecord.h:33
ScalarColumn< Float > & temperature()
A Table intended to hold a MeasurementSet WEATHER table.
Definition: MSWeather.h:78
ScalarColumn< Float > & windSpeed()
ScalarColumn< Float > & pressure()
casacore::Bool fill(casacore::uInt irow, AssociatingColumns &columns)
Definition: WeatherRecord.h:71
bool operator==(WeatherRecord const &other)
Definition: WeatherRecord.h:59
ScalarColumn< Float > & windDirection()
uInt nrow() const
Convenience function that returns the number of rows in any of the columns.
ScalarColumn< Double > & time()
WeatherRecord & operator=(WeatherRecord const &other)
Definition: WeatherRecord.h:47
double Double
Definition: aipstype.h:55
casacore::Float temperature
optional
Definition: WeatherRecord.h:29
ScalarColumn< Float > & relHumidity()
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
float Float
Definition: aipstype.h:54
casacore::MSWeatherColumns AssociatingColumns
Definition: WeatherRecord.h:21
void put(uInt rownr, const T &value)
Put the value in a particular cell (i.e.
Definition: ScalarColumn.h:198
casacore::Int antenna_id
mandatory
Definition: WeatherRecord.h:24
void add(AssociatingTable &table, AssociatingColumns &)
Definition: WeatherRecord.h:67
ScalarColumn< Double > & interval()
unsigned int uInt
Definition: aipstype.h:51
A class to provide easy read-write access to MSWeather columns.