Line data Source code
1 : //# CTInterface.h: Class to present a CalTable with casacore::MS interface 2 : //# Copyright (C) 1996,1997,1998,1999,2001 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 : //# 27 : //# $Id$ 28 : 29 : #ifndef CT_CTINTERFACE_H 30 : #define CT_CTINTERFACE_H 31 : 32 : #include <casacore/casa/aips.h> 33 : #include <casacore/casa/BasicSL/String.h> 34 : #include <casacore/ms/MSSel/MSSelectableTable.h> 35 : #include <casacore/ms/MeasurementSets/MSMainEnums.h> 36 : #include <synthesis/CalTables/NewCalTable.h> 37 : #include <synthesis/CalTables/CTEnums.h> 38 : #include <synthesis/CalTables/CTMainColInterface.h> 39 : //#include <ms/MeasurementSets/MSDataDescription.h> 40 : #include <casacore/tables/Tables/SetupNewTab.h> 41 : #include <casacore/tables/Tables/TableDesc.h> 42 : namespace casa { //# NAMESPACE CASA - BEGIN 43 : 44 : class CTInterface: public casacore::MSSelectableTable 45 : { 46 : public: 47 : CTInterface():fakeDDSubTable(), ctMainCols_p(NULL) {}; 48 : CTInterface(const casacore::Table& table); 49 : 50 : virtual ~CTInterface(); 51 3 : virtual const CTObservation& observation() {return asCT()->observation();} 52 5 : virtual const CTAntenna& antenna() {return asCT()->antenna();} 53 3 : virtual const CTField& field() {return asCT()->field();} 54 390 : virtual const CTSpectralWindow& spectralWindow() {return asCT()->spectralWindow();} 55 743 : virtual casacore::Bool isMS() {return false;}; 56 : 57 : // BASELINE_BASED, PURE_ANTENNA_BASED, REF_ANTENNA_BASED 58 : virtual casacore::MSSelectableTable::MSSDataType dataType(); 59 : 60 : virtual const casacore::MSDataDescription& dataDescription(); 61 : virtual casacore::String columnName(casacore::MSMainEnums::PredefinedColumns nameEnum); 62 : // virtual const casacore::MSObservation& observation(); 63 : 64 367 : virtual const casacore::MeasurementSet* asMS() 65 : { 66 : //{throw(casacore::AipsError("asMS() called from CTInterface class"));} 67 : //cerr << "asMS() called from CTInterface class" << endl; 68 : //return static_cast<const casacore::MeasurementSet *>(table()); 69 367 : return NULL; 70 : } 71 : virtual const NewCalTable* asCT(); 72 188 : virtual casacore::MSSelectableMainColumn* mainColumns() 73 188 : {ctMainCols_p = new CTMainColInterface(*table_p); return ctMainCols_p;}; 74 : private: 75 : casacore::MSDataDescription fakeDDSubTable; 76 : void makeDDSubTable(); 77 : CTMainColInterface *ctMainCols_p; 78 : }; 79 : } //# NAMESPACE CASA - END 80 : 81 : #endif