00001 //# MSTransform.h: this defines MSTransform 00002 //# Copyright (C) 2000,2001 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 #ifndef MSTRANSFORM_H 00028 #define MSTRANSFORM_H 00029 00030 #include <iostream> 00031 #include <vector> 00032 00033 #include <casacore/casa/Logging/LogIO.h> 00034 #include <casacore/casa/Arrays/Vector.h> 00035 #include <casacore/casa/Containers/Record.h> 00036 #include <casacore/casa/Quanta/Quantum.h> 00037 #include <mstransform/MSTransform/MSTransformManager.h> 00038 00039 namespace casa { //# NAMESPACE CASA - BEGIN 00040 00041 // <summary> 00042 // MSTransform: Apply transformations to data on the fly 00043 // </summary> 00044 00045 // <use visibility=global> 00046 00047 // <reviewed reviewer="" date="" tests="" demos=""> 00048 // </reviewed> 00049 00050 // <prerequisite> 00051 // <li> <linkto class="MSTransformManager:description">MSTransformManager</linkto> 00052 // </prerequisite> 00053 // 00054 // <synopsis> 00055 // MSTransform ....... 00056 // </synopsis> 00057 // 00058 // <example> 00059 // The following is a typical way of using this class and its methods ... 00060 // 00061 // <srcblock> 00062 // MSTransform *mst = new MSTransform(); 00063 // </srcblock> 00064 // 00065 // Create a Record with the desired parameters. The parameters are: data selection parameters and any parameters 00066 // for the transformations. 00067 // 00068 // <srcblock> 00069 // Record params = Recod(); 00070 // params.define("spw", "0,1,2"); 00071 // params.define("combinespws",true); 00072 // mst->configure(params); 00073 // </srcblock> 00074 // 00075 // Open the MS, select the data and setup the output MS. 00076 // 00077 // <srcblock> 00078 // mst->open(); 00079 // </srcblock> 00080 // 00081 // Run the tool and afterwards, destroy any instance of it by calling the destructor. 00082 // 00083 // <srcblock> 00084 // mst->run(); 00085 // 00086 // mst->done(); 00087 // </srcblock> 00088 // </example> 00089 // 00090 // <motivation> 00091 // To avoid multiple read/writes of the data.... 00092 // </motivation> 00093 // 00094 00095 00096 class MSTransform 00097 { 00098 protected: 00099 00100 LogIO log_p; 00101 00102 // variables used to initialize the MSTransformManager 00103 String msname_p; 00104 String outputms_p; 00105 00106 00107 // members to parse to selectData 00108 String spw_p; 00109 String scan_p; 00110 String field_p; 00111 String antenna_p; 00112 String timerange_p; 00113 String correlation_p; 00114 String intent_p; 00115 String feed_p; 00116 String array_p; 00117 String uvrange_p; 00118 String observation_p; 00119 Record config_p; 00120 String datacolumn_p; 00121 00122 // Tells if tool is already configured at least once 00123 Bool isconfigured_p; 00124 00125 00126 // variables for initAgents 00127 MSTransformManager *mdh_p; 00128 00129 public: 00130 // default constructor 00131 MSTransform(); 00132 00133 // destructor 00134 ~MSTransform(); 00135 00136 // reset everything 00137 void done(); 00138 00139 // set the defaults of the parameters 00140 // Record & defaultOptions(); 00141 00142 00143 // configure the tool and parse the parameters 00144 bool configure(Record config); 00145 00146 // Open the MS and select the data 00147 bool open(); 00148 00149 // Run the tool and write the flags to the MS 00150 Record run(); 00151 00152 00153 private: 00154 00155 MSTransform(const MSTransform &) {}; 00156 00157 MSTransform& operator=(const MSTransform &) {return *this;}; 00158 00159 // String validateDataColumn(String datacol); 00160 00161 // Sink used to store history 00162 LogSink logSink_p; 00163 00164 00165 }; 00166 00167 00168 } //# NAMESPACE CASA - END 00169 00170 #endif 00171