00001 //# MSFreqOffsetColumns.h: provides easy access to FREQ_OFFSET columns 00002 //# Copyright (C) 1999,2000 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef MS_MSFREQOFFCOLUMNS_H 00029 #define MS_MSFREQOFFCOLUMNS_H 00030 00031 #include <casa/aips.h> 00032 #include <measures/Measures/MEpoch.h> 00033 #include <measures/TableMeasures/ScalarMeasColumn.h> 00034 #include <measures/TableMeasures/ScalarQuantColumn.h> 00035 #include <tables/Tables/ScalarColumn.h> 00036 00037 namespace casa { //# NAMESPACE CASA - BEGIN 00038 00039 class MSFreqOffset; 00040 00041 // <summary> 00042 // A class to provide easy read-only access to MSFreqOffset columns 00043 // </summary> 00044 00045 // <use visibility=export> 00046 00047 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos=""> 00048 // </reviewed> 00049 00050 // <prerequisite> 00051 // <li> MSFreqOffset 00052 // <li> ArrayColumn 00053 // <li> ScalarColumn 00054 // </prerequisite> 00055 // 00056 // <etymology> 00057 // ROMSFreqOffsetColumns stands for Read-Only MeasurementSet FreqOffset 00058 // Table columns. 00059 // </etymology> 00060 // 00061 // <synopsis> 00062 // This class provides read-only access to the columns in the MSFreqOffset 00063 // Table. It does the declaration of all the Scalar and ArrayColumns with the 00064 // correct types, so the application programmer doesn't have to worry about 00065 // getting those right. There is an access function for every predefined 00066 // column. Access to non-predefined columns will still have to be done with 00067 // explicit declarations. See <linkto class=ROMSColumns> 00068 // ROMSColumns</linkto> for an example. 00069 00070 // </synopsis> 00071 // 00072 // <motivation> 00073 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation. 00074 // </motivation> 00075 00076 class ROMSFreqOffsetColumns 00077 { 00078 public: 00079 // Create a columns object that accesses the data in the specified Table 00080 ROMSFreqOffsetColumns(const MSFreqOffset& msFreqOffset); 00081 00082 // The destructor does nothing special 00083 ~ROMSFreqOffsetColumns(); 00084 00085 // Is this object defined? (MSFreqOffset table is optional) 00086 Bool isNull() const {return isNull_p;} 00087 00088 // Access to columns 00089 // <group> 00090 const ROScalarColumn<Int>& antenna1() const {return antenna1_p;} 00091 const ROScalarColumn<Int>& antenna2() const {return antenna2_p;} 00092 const ROScalarColumn<Int>& feedId() const {return feedId_p;} 00093 const ROScalarColumn<Double>& interval() const {return interval_p;} 00094 const ROScalarQuantColumn<Double>& intervalQuant() const { 00095 return intervalQuant_p;} 00096 const ROScalarColumn<Double>& offset() const {return offset_p;} 00097 const ROScalarQuantColumn<Double>& offsetQuant() const { 00098 return offsetQuant_p;} 00099 const ROScalarColumn<Int>& spectralWindowId() const { 00100 return spectralWindowId_p;} 00101 const ROScalarColumn<Double>& time() const {return time_p;} 00102 const ROScalarQuantColumn<Double>& timeQuant() const {return timeQuant_p;} 00103 const ROScalarMeasColumn<MEpoch>& timeMeas() const {return timeMeas_p;} 00104 // </group> 00105 00106 // Convenience function that returns the number of rows in any of the 00107 // columns. Returns zero if the object is null. 00108 uInt nrow() const {return isNull() ? 0 : antenna1_p.nrow();} 00109 00110 protected: 00111 //# default constructor creates a object that is not usable. Use the attach 00112 //# function correct this. 00113 ROMSFreqOffsetColumns(); 00114 00115 //# attach this object to the supplied table. 00116 void attach(const MSFreqOffset& msFreqOffset); 00117 00118 private: 00119 //# Make the assignment operator and the copy constructor private to prevent 00120 //# any compiler generated one from being used. 00121 ROMSFreqOffsetColumns(const ROMSFreqOffsetColumns&); 00122 ROMSFreqOffsetColumns& operator=(const ROMSFreqOffsetColumns&); 00123 00124 //# Is the object not attached to a Table. 00125 Bool isNull_p; 00126 00127 //# required columns 00128 ROScalarColumn<Int> antenna1_p; 00129 ROScalarColumn<Int> antenna2_p; 00130 ROScalarColumn<Int> feedId_p; 00131 ROScalarColumn<Double> interval_p; 00132 ROScalarColumn<Double> offset_p; 00133 ROScalarColumn<Int> spectralWindowId_p; 00134 ROScalarColumn<Double> time_p; 00135 00136 //# Access to Measure columns 00137 ROScalarMeasColumn<MEpoch> timeMeas_p; 00138 00139 //# Access to Quantum columns 00140 ROScalarQuantColumn<Double> intervalQuant_p; 00141 ROScalarQuantColumn<Double> offsetQuant_p; 00142 ROScalarQuantColumn<Double> timeQuant_p; 00143 }; 00144 00145 // <summary> 00146 // A class to provide easy read-write access to MSFreqOffset columns 00147 // </summary> 00148 00149 // <use visibility=export> 00150 00151 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos=""> 00152 // </reviewed> 00153 00154 // <prerequisite> 00155 // <li> MSFreqOffset 00156 // <li> ScalarColumn 00157 // </prerequisite> 00158 // 00159 // <etymology> 00160 // MSFreqOffsetColumns stands for MeasurementSet FreqOffset Table 00161 // columns. 00162 // </etymology> 00163 // 00164 // <synopsis> 00165 // This class provides access to the columns in the MSFreqOffset Table, 00166 // it does the declaration of all the Scalar and ArrayColumns with the 00167 // correct types, so the application programmer doesn't have to 00168 // worry about getting those right. There is an access function 00169 // for every predefined column. Access to non-predefined columns will still 00170 // have to be done with explicit declarations. 00171 // See <linkto class=MSColumns> MSColumns</linkto> for an example. 00172 // </synopsis> 00173 // 00174 // <motivation> 00175 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation. 00176 // </motivation> 00177 00178 class MSFreqOffsetColumns: public ROMSFreqOffsetColumns 00179 { 00180 public: 00181 // Create a columns object that accesses the data in the specified Table 00182 MSFreqOffsetColumns(MSFreqOffset& msFreqOffset); 00183 00184 // The destructor does nothing special 00185 ~MSFreqOffsetColumns(); 00186 00187 // Read-write access to required columns 00188 // <group> 00189 ScalarColumn<Int>& antenna1() {return antenna1_p;} 00190 ScalarColumn<Int>& antenna2() {return antenna2_p;} 00191 ScalarColumn<Int>& feedId() {return feedId_p;} 00192 ScalarColumn<Double>& interval() {return interval_p;} 00193 ScalarQuantColumn<Double>& intervalQuant() {return intervalQuant_p;} 00194 ScalarColumn<Double>& offset() {return offset_p;} 00195 ScalarQuantColumn<Double>& offsetQuant() {return offsetQuant_p;} 00196 ScalarColumn<Int>& spectralWindowId() {return spectralWindowId_p;} 00197 ScalarColumn<Double>& time() {return time_p;} 00198 ScalarQuantColumn<Double>& timeQuant() {return timeQuant_p;} 00199 ScalarMeasColumn<MEpoch>& timeMeas() {return timeMeas_p;} 00200 // </group> 00201 00202 // Read-only access to required columns 00203 // <group> 00204 const ROScalarColumn<Int>& antenna1() const { 00205 return ROMSFreqOffsetColumns::antenna1();} 00206 const ROScalarColumn<Int>& antenna2() const { 00207 return ROMSFreqOffsetColumns::antenna2();} 00208 const ROScalarColumn<Int>& feedId() const { 00209 return ROMSFreqOffsetColumns::feedId();} 00210 const ROScalarColumn<Double>& interval() const { 00211 return ROMSFreqOffsetColumns::interval();} 00212 const ROScalarQuantColumn<Double>& intervalQuant() const { 00213 return ROMSFreqOffsetColumns::intervalQuant();} 00214 const ROScalarColumn<Double>& offset() const { 00215 return ROMSFreqOffsetColumns::offset();} 00216 const ROScalarQuantColumn<Double>& offsetQuant() const { 00217 return ROMSFreqOffsetColumns::offsetQuant();} 00218 const ROScalarColumn<Int>& spectralWindowId() const { 00219 return ROMSFreqOffsetColumns::spectralWindowId();} 00220 const ROScalarColumn<Double>& time() const { 00221 return ROMSFreqOffsetColumns::time();} 00222 const ROScalarQuantColumn<Double>& timeQuant() const { 00223 return ROMSFreqOffsetColumns::timeQuant();} 00224 const ROScalarMeasColumn<MEpoch>& timeMeas() const { 00225 return ROMSFreqOffsetColumns::timeMeas();} 00226 // </group> 00227 00228 // set the epoch type for the TIME column. 00229 // <note role=tip> 00230 // In principle this function can only be used if the table is empty, 00231 // otherwise already written values may thereafter have an incorrect 00232 // reference, offset, or unit. However, it is possible that part of the 00233 // table gets written before these values are known. In that case the 00234 // reference, offset, or units can be set by using a False 00235 // <src>tableMustBeEmpty</src> argument. 00236 // </note> 00237 void setEpochRef(MEpoch::Types ref, Bool tableMustBeEmpty=True); 00238 00239 protected: 00240 //# default constructor creates a object that is not usable. Use the attach 00241 //# function correct this. 00242 MSFreqOffsetColumns(); 00243 00244 //# attach this object to the supplied table. 00245 void attach(MSFreqOffset& msFreqOffset); 00246 00247 private: 00248 //# Make the assignment operator and the copy constructor private to prevent 00249 //# any compiler generated one from being used. 00250 MSFreqOffsetColumns(const MSFreqOffsetColumns&); 00251 MSFreqOffsetColumns& operator=(const MSFreqOffsetColumns&); 00252 00253 //# required columns 00254 ScalarColumn<Int> antenna1_p; 00255 ScalarColumn<Int> antenna2_p; 00256 ScalarColumn<Int> feedId_p; 00257 ScalarColumn<Double> interval_p; 00258 ScalarColumn<Double> offset_p; 00259 ScalarColumn<Int> spectralWindowId_p; 00260 ScalarColumn<Double> time_p; 00261 00262 //# Access to Measure columns 00263 ScalarMeasColumn<MEpoch> timeMeas_p; 00264 00265 //# Access to Quantum columns 00266 ScalarQuantColumn<Double> intervalQuant_p; 00267 ScalarQuantColumn<Double> offsetQuant_p; 00268 ScalarQuantColumn<Double> timeQuant_p; 00269 }; 00270 00271 00272 } //# NAMESPACE CASA - END 00273 00274 #endif
1.5.1