- Timestamp:
- 03/01/06 14:00:04 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Makefile
r828 r860 93 93 STWeather.o \ 94 94 STFrequencies.o \ 95 STHistory.o \ 95 96 STWriter.o \ 96 97 RowAccumulator.o \ … … 113 114 STFocus.h \ 114 115 STWeather.h \ 116 STHistory.h \ 115 117 STFrequencies.h \ 116 118 STDefs.h \ -
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); -
trunk/src/Scantable.h
r859 r860 38 38 #include "STMolecules.h" 39 39 #include "STSelector.h" 40 #include "STHistory.h" 40 41 41 42 … … 253 254 void makePersistent(const std::string& filename); 254 255 255 std::vector<std::string> getHistory() const; 256 void addHistory(const std::string& hist); 257 258 casa::Table getHistoryTable() const; 259 void appendToHistoryTable(const casa::Table& otherHist); 256 std::vector<std::string> getHistory() const 257 { return historyTable_.getHistory(); }; 258 259 void addHistory(const std::string& hist) { historyTable_.addEntry(hist); } 260 261 void appendToHistoryTable(const STHistory& otherhist) 262 { historyTable_.append(otherhist); } 260 263 261 264 std::string summary(bool verbose=false); … … 287 290 STTcal& tcal() { return tcalTable_; } 288 291 STMolecules& molecules() { return moleculeTable_; } 292 STHistory& history() { return historyTable_; } 289 293 290 294 private: … … 322 326 void setupMainTable(); 323 327 324 void setupHistoryTable();325 void setupMoleculeTable();326 328 void setupFitTable(); 327 329 … … 349 351 STFocus focusTable_; 350 352 STMolecules moleculeTable_; 353 STHistory historyTable_; 354 351 355 casa::Table fitTable_; 352 casa::Table historyTable_;353 356 354 357 // Cached Columns to avoid reconstructing them for each row get/put
Note:
See TracChangeset
for help on using the changeset viewer.