Changeset 860 for trunk/src/Scantable.cpp
- Timestamp:
- 03/01/06 14:00:04 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.cpp
r859 r860 74 74 moleculeTable_ = STMolecules(*this); 75 75 table_.rwKeywordSet().defineTable("MOLECULES", moleculeTable_.table()); 76 setupHistoryTable(); 76 historyTable_ = STHistory(*this); 77 table_.rwKeywordSet().defineTable("HISTORY", historyTable_.table()); 77 78 setupFitTable(); 78 historyTable_ = table_.keywordSet().asTable("HISTORY");79 79 fitTable_ = table_.keywordSet().asTable("FITS"); 80 80 originalTable_ = table_; … … 99 99 attach(); 100 100 } 101 102 101 103 102 Scantable::Scantable( const Scantable& other, bool clear ) … … 141 140 tcalTable_ = STTcal(table_); 142 141 moleculeTable_ = STMolecules(table_); 142 historyTable_ = STHistory(table_); 143 143 } 144 144 … … 213 213 originalTable_ = table_; 214 214 215 }216 217 void Scantable::setupHistoryTable( )218 {219 TableDesc tdh("", "1", TableDesc::Scratch);220 tdh.addColumn(ScalarColumnDesc<String>("ITEM"));221 SetupNewTable histtab("history", tdh, Table::Scratch);222 Table histTable(histtab, Table::Memory);223 table_.rwKeywordSet().defineTable("HISTORY", histTable);224 215 } 225 216 … … 522 513 { 523 514 return polCol_(whichrow); 524 }525 526 Table Scantable::getHistoryTable() const527 {528 return table_.keywordSet().asTable("HISTORY");529 }530 531 void Scantable::appendToHistoryTable(const Table& otherHist)532 {533 Table t = table_.rwKeywordSet().asTable("HISTORY");534 535 addHistory(asap::SEPERATOR);536 TableCopy::copyRows(t, otherHist, t.nrow(), 0, otherHist.nrow());537 addHistory(asap::SEPERATOR);538 }539 540 void Scantable::addHistory(const std::string& hist)541 {542 Table t = table_.rwKeywordSet().asTable("HISTORY");543 uInt nrow = t.nrow();544 t.addRow();545 ScalarColumn<String> itemCol(t, "ITEM");546 itemCol.put(nrow, hist);547 }548 549 std::vector<std::string> Scantable::getHistory() const550 {551 Vector<String> history;552 const Table& t = table_.keywordSet().asTable("HISTORY");553 uInt nrow = t.nrow();554 ROScalarColumn<String> itemCol(t, "ITEM");555 std::vector<std::string> stlout;556 String hist;557 for (uInt i=0; i<nrow; ++i) {558 itemCol.get(i, hist);559 stlout.push_back(hist);560 }561 return stlout;562 515 } 563 516 … … 678 631 oss << endl; 679 632 String tmp; 680 //table_.keywordSet().get("Observer", tmp);681 oss << setw(15) << "Observer:"<< table_.keywordSet().asString("Observer") << endl;633 oss << setw(15) << "Observer:" 634 << table_.keywordSet().asString("Observer") << endl; 682 635 oss << setw(15) << "Obs Date:" << getTime(-1,true) << endl; 683 636 table_.keywordSet().get("Project", tmp);
Note: See TracChangeset
for help on using the changeset viewer.