casa
$Rev:20696$
|
00001 //# MSDopplerColumns.h: provides easy access to MSDoppler 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: MSDopplerColumns.h 19944 2007-02-27 11:14:34Z Malte.Marquarding $ 00027 00028 #ifndef MS_MSDOPPLERCOLUMNS_H 00029 #define MS_MSDOPPLERCOLUMNS_H 00030 00031 #include <casa/aips.h> 00032 #include <measures/Measures/MDoppler.h> 00033 #include <measures/Measures/MCDoppler.h> 00034 #include <tables/Tables/ScalarColumn.h> 00035 #include <measures/TableMeasures/ScalarMeasColumn.h> 00036 #include <measures/TableMeasures/ScalarQuantColumn.h> 00037 00038 namespace casa { //# NAMESPACE CASA - BEGIN 00039 00040 class MSDoppler; 00041 00042 // <summary> 00043 // A class to provide easy read-only access to MSDoppler columns 00044 // </summary> 00045 00046 // <use visibility=export> 00047 00048 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos=""> 00049 // </reviewed> 00050 00051 // <prerequisite> 00052 // <li> MSDoppler 00053 // <li> ScalarColumn 00054 // </prerequisite> 00055 // 00056 // <etymology> 00057 // ROMSDopplerColumns stands for Read-Only MeasurementSet Doppler Table 00058 // columns. 00059 // </etymology> 00060 // 00061 // <synopsis> 00062 // This class provides read-only access to the columns in the MSDoppler 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 // </synopsis> 00070 // 00071 // <motivation> 00072 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation. 00073 // </motivation> 00074 00075 class ROMSDopplerColumns 00076 { 00077 public: 00078 // Create a columns object that accesses the data in the specified Table 00079 ROMSDopplerColumns(const MSDoppler& msDoppler); 00080 00081 // The destructor does nothing special 00082 ~ROMSDopplerColumns(); 00083 00084 // Is this object defined? (MSDoppler table is optional) 00085 Bool isNull() const {return isNull_p;} 00086 00087 // Access to columns 00088 // <group> 00089 const ROScalarColumn<Int>& dopplerId() const {return dopplerId_p;} 00090 const ROScalarColumn<Int>& sourceId() const {return sourceId_p;} 00091 const ROScalarColumn<Int>& transitionId() const {return transitionId_p;} 00092 const ROScalarColumn<Double>& velDef() const {return velDef_p;} 00093 const ROScalarQuantColumn<Double>& velDefQuant() const {return velDefQuant_p;} 00094 const ROScalarMeasColumn<MDoppler>& velDefMeas() const {return velDefMeas_p;} 00095 // </group> 00096 00097 // Convenience function that returns the number of rows in any of the 00098 // columns. Returns zero if the object is null. 00099 uInt nrow() const {return isNull() ? 0 : dopplerId_p.nrow();} 00100 00101 protected: 00102 //# default constructor creates a object that is not usable. Use the attach 00103 //# function correct this. 00104 ROMSDopplerColumns(); 00105 00106 //# attach this object to the supplied table. 00107 void attach(const MSDoppler& msDoppler); 00108 00109 private: 00110 //# Make the assignment operator and the copy constructor private to prevent 00111 //# any compiler generated one from being used. 00112 ROMSDopplerColumns(const ROMSDopplerColumns&); 00113 ROMSDopplerColumns& operator=(const ROMSDopplerColumns&); 00114 00115 //# Is the object not attached to a Table. 00116 Bool isNull_p; 00117 00118 //# required columns 00119 ROScalarColumn<Int> dopplerId_p; 00120 ROScalarColumn<Int> sourceId_p; 00121 ROScalarColumn<Int> transitionId_p; 00122 ROScalarColumn<Double> velDef_p; 00123 00124 //# Access to Measure columns 00125 ROScalarMeasColumn<MDoppler> velDefMeas_p; 00126 00127 //# Access to Quantum columns 00128 ROScalarQuantColumn<Double> velDefQuant_p; 00129 00130 }; 00131 00132 // <summary> 00133 // A class to provide easy read-write access to MSDoppler columns 00134 // </summary> 00135 00136 // <use visibility=export> 00137 00138 // <reviewed reviewer="Bob Garwood" date="1997/02/01" tests="" demos=""> 00139 // </reviewed> 00140 00141 // <prerequisite> 00142 // <li> MSDoppler 00143 // <li> ScalarColumn 00144 // </prerequisite> 00145 // 00146 // <etymology> 00147 // MSDopplerColumns stands for MeasurementSet Doppler Table columns. 00148 // </etymology> 00149 // 00150 // <synopsis> 00151 // This class provides access to the columns in the MSDoppler Table, 00152 // it does the declaration of all the Scalar and ArrayColumns with the 00153 // correct types, so the application programmer doesn't have to 00154 // worry about getting those right. There is an access function 00155 // for every predefined column. Access to non-predefined columns will still 00156 // have to be done with explicit declarations. 00157 // See <linkto class=MSColumns> MSColumns</linkto> for an example. 00158 // </synopsis> 00159 // 00160 // <motivation> 00161 // See <linkto class=MSColumns> MSColumns</linkto> for the motivation. 00162 // </motivation> 00163 00164 class MSDopplerColumns: public ROMSDopplerColumns 00165 { 00166 public: 00167 // Create a columns object that accesses the data in the specified Table 00168 MSDopplerColumns(MSDoppler& msDoppler); 00169 00170 // The destructor does nothing special 00171 ~MSDopplerColumns(); 00172 00173 // Read-write access to required columns 00174 // <group> 00175 ScalarColumn<Int>& dopplerId() {return dopplerId_p;} 00176 ScalarColumn<Int>& sourceId() {return sourceId_p;} 00177 ScalarColumn<Int>& transitionId() {return transitionId_p;} 00178 ScalarColumn<Double>& velDef() {return velDef_p;} 00179 ScalarQuantColumn<Double>& velDefQuant(){return velDefQuant_p;} 00180 ScalarMeasColumn<MDoppler>& velDefMeas() {return velDefMeas_p;} 00181 // </group> 00182 00183 // Read-only access to required columns 00184 // <group> 00185 const ROScalarColumn<Int>& dopplerId() const { 00186 return ROMSDopplerColumns::dopplerId();} 00187 const ROScalarColumn<Int>& sourceId() const { 00188 return ROMSDopplerColumns::sourceId();} 00189 const ROScalarColumn<Int>& transitionId() const { 00190 return ROMSDopplerColumns::transitionId();} 00191 const ROScalarColumn<Double>& velDef() const { 00192 return ROMSDopplerColumns::velDef();} 00193 const ROScalarQuantColumn<Double>& velDefQuant() const { 00194 return ROMSDopplerColumns::velDefQuant();} 00195 const ROScalarMeasColumn<MDoppler>& velDefMeas() const { 00196 return ROMSDopplerColumns::velDefMeas();} 00197 // </group> 00198 00199 // set the DOPPLER type for the VELDEF column. 00200 void setVelDefRef(MDoppler::Types ref); 00201 00202 protected: 00203 //# default constructor creates a object that is not usable. Use the attach 00204 //# function correct this. 00205 MSDopplerColumns(); 00206 00207 //# attach this object to the supplied table. 00208 void attach(MSDoppler& msDoppler); 00209 00210 private: 00211 //# Make the assignment operator and the copy constructor private to prevent 00212 //# any compiler generated one from being used. 00213 MSDopplerColumns(const MSDopplerColumns&); 00214 MSDopplerColumns& operator=(const MSDopplerColumns&); 00215 00216 //# required columns 00217 ScalarColumn<Int> dopplerId_p; 00218 ScalarColumn<Int> sourceId_p; 00219 ScalarColumn<Int> transitionId_p; 00220 ScalarColumn<Double> velDef_p; 00221 00222 //# Access to Measure columns 00223 ScalarMeasColumn<MDoppler> velDefMeas_p; 00224 00225 //# Access to Quantum columns 00226 ScalarQuantColumn<Double> velDefQuant_p; 00227 }; 00228 00229 00230 } //# NAMESPACE CASA - END 00231 00232 #endif