// // C++ Implementation: STBaselineParamTable // // Description: // // // Author: Wataru Kawasaki (C) 2013 // // Copyright: See COPYING file that comes with this distribution // // #include #include #include #include #include #include #include #include #include #include #include "Scantable.h" #include "STBaselineParamTable.h" using namespace casa; namespace asap { const String STBaselineParamTable::name_ = "APPLY_BASELINE"; STBaselineParamTable::STBaselineParamTable(const Scantable& parent) : STApplyTable(parent, name_) { setup(); } STBaselineParamTable::STBaselineParamTable(const String &name) : STApplyTable(name) { attachOptionalColumns(); } STBaselineParamTable::~STBaselineParamTable() { } void STBaselineParamTable::setup() { table_.addColumn(ScalarColumnDesc("BLFUNC")); table_.addColumn(ScalarColumnDesc("ORDER")); table_.addColumn(ArrayColumnDesc("BOUNDARY")); table_.addColumn(ArrayColumnDesc("PARAMETER")); table_.rwKeywordSet().define("ApplyType", "BASELINE"); attachOptionalColumns(); } void STBaselineParamTable::attachOptionalColumns() { blfuncCol_.attach(table_, "BLFUNC"); orderCol_.attach(table_, "ORDER"); boundaryCol_.attach(table_, "BOUNDARY"); paramCol_.attach(table_, "PARAMETER"); } void STBaselineParamTable::setdata(uInt irow, uInt scanno, uInt cycleno, uInt beamno, uInt ifno, uInt polno, uInt freqid, Double time, uInt blfunc, uInt order, Vector boundary, Vector param) { if (irow >= (uInt)nrow()) { throw AipsError("row index out of range"); } if (!sel_.empty()) { os_.origin(LogOrigin("STBaselineParamTable","setdata",WHERE)); os_ << LogIO::WARN << "Data selection is effective. Specified row index may be wrong." << LogIO::POST; } setbasedata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time); blfuncCol_.put(irow, blfunc); orderCol_.put(irow, order); boundaryCol_.put(irow, boundary); paramCol_.put(irow, param); } void STBaselineParamTable::appenddata(uInt scanno, uInt cycleno, uInt beamno, uInt ifno, uInt polno, uInt freqid, Double time, uInt blfunc, uInt order, Vector boundary, Vector param) { uInt irow = nrow(); table_.addRow(1, True); setdata(irow, scanno, cycleno, beamno, ifno, polno, freqid, time, blfunc, order, boundary, param); } /* Vector getBlfunc() { Vector rawBlfuncColumn = blfuncCol_.getColumn(); Vector blfuncColumn; for (uInt i = 0; i < rawBlfuncColumn.size(); ++i) { blfuncColumn.append(STBaselineEnum::BaselineType(rawBlfuncColumn.get(i))); } return blfuncColumn; } */ }