// // C++ Interface: STApplyTable // // Description: // // Base class for application tables. // // Author: Takeshi Nakazato (C) 2012 // // Copyright: See COPYING file that comes with this distribution // // #ifndef ASAP_APPLY_TABLE_H #define ASAP_APPLY_TABLE_H #include #include #include #include #include #include "Scantable.h" #include "STSelector.h" #include "STCalEnum.h" namespace asap { /** Abstract base class for all application tables. @author Takeshi Nakazato @date $Date:$ @version $Revision:$ */ class STApplyTable { public: STApplyTable() {;} STApplyTable(const Scantable& parent, const casacore::String& name); STApplyTable(const casacore::String &name); virtual ~STApplyTable(); /** * Add extra columns. To be implemented in derived class */ virtual void setup() = 0; /*** * Name of the table ***/ virtual const casacore::String& name() const = 0; const casacore::Table& table() const { return table_; } casacore::Table table() { return table_; } void attach(); void attachBaseColumns(); virtual void attachOptionalColumns() = 0; casacore::uInt nrow() {return table_.nrow();} casacore::Vector getScan() const {return scanCol_.getColumn();} casacore::Vector getCycle() const {return cycleCol_.getColumn();} casacore::Vector getBeam() const {return beamCol_.getColumn();} casacore::Vector getIF() const {return ifCol_.getColumn();} casacore::Vector getPol() const {return polCol_.getColumn();} casacore::Vector getTime() const {return timeCol_.getColumn();} void setSelection(STSelector &sel, bool sortByTime=false); void unsetSelection(); casacore::String caltype(); void save(const casacore::String &name); virtual casacore::uInt nchan(casacore::uInt ifno) = 0; // static methods static STCalEnum::CalType getCalType(const casacore::String &name); static STCalEnum::CalType getCalType(casacore::CountedPtr tab); static STCalEnum::CalType getCalType(STApplyTable *tab); protected: void setbasedata(casacore::uInt irow, casacore::uInt scanno, casacore::uInt cycleno, casacore::uInt beamno, casacore::uInt ifno, casacore::uInt polno, casacore::uInt freqid, casacore::Double time); casacore::Block getFrequenciesRow(casacore::uInt id); casacore::Table table_, originaltable_; casacore::ScalarColumn scanCol_, cycleCol_, beamCol_, ifCol_, polCol_, freqidCol_; casacore::ScalarColumn timeCol_; casacore::MEpoch::ScalarColumn timeMeasCol_; STSelector sel_; casacore::LogIO os_; private: static STCalEnum::CalType stringToType(const casacore::String &caltype); }; } #endif