- Timestamp:
- 03/01/06 11:51:18 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.cpp
r852 r859 78 78 historyTable_ = table_.keywordSet().asTable("HISTORY"); 79 79 fitTable_ = table_.keywordSet().asTable("FITS"); 80 cout << "DEBUG" << endl;81 82 80 originalTable_ = table_; 83 81 attach(); 84 cout << "debug" << endl;85 82 } 86 83 … … 98 95 else 99 96 table_ = tab; 100 freqTable_ = STFrequencies(table_.keywordSet().asTable("FREQUENCIES")); 101 focusTable_ = STFocus(table_.keywordSet().asTable("FOCUS")); 102 weatherTable_ = STWeather(table_.keywordSet().asTable("WEATHER")); 103 tcalTable_ = STTcal(table_.keywordSet().asTable("TCAL")); 104 moleculeTable_ = STMolecules(table_.keywordSet().asTable("MOLECULES")); 97 attachSubtables(); 105 98 originalTable_ = table_; 106 99 attach(); … … 111 104 { 112 105 // with or without data 113 if (clear) { 114 table_ = TableCopy::makeEmptyMemoryTable(String(generateName()), 115 other.table_, True); 106 String newname = String(generateName()); 107 if ( other.table_.tableType() == Table::Memory ) { 108 if ( clear ) { 109 cout << "copy ctor memory clear" << endl; 110 table_ = TableCopy::makeEmptyMemoryTable(newname, 111 other.table_, True); 112 } else 113 table_ = other.table_.copyToMemoryTable(newname); 116 114 } else { 117 table_ = other.table_.copyToMemoryTable(String(generateName())); 118 } 119 115 if ( clear ) { 116 cout << "copy ctor clear" << endl; 117 other.table_.deepCopy(newname, Table::New); 118 cout << "reading table" << endl; 119 table_ = Table(newname, Table::Scratch); 120 cout << "removing rows" << endl; 121 table_.removeRow(table_.rowNumbers()); 122 123 } else { 124 cout << "copy ctor no clear" << endl; 125 other.table_.deepCopy(newname, Table::Scratch); 126 table_ = Table(newname, Table::Scratch); 127 } 128 } 129 //table_.rwKeywordSet().renameTables(newname, table_.tableName()); 130 //cout << table_.keywordSet().asTable("TCAL").tableName() << endl; 131 attachSubtables(); 120 132 originalTable_ = table_; 121 133 attach(); 134 } 135 136 void Scantable::attachSubtables() 137 { 138 freqTable_ = STFrequencies(table_); 139 focusTable_ = STFocus(table_); 140 weatherTable_ = STWeather(table_); 141 tcalTable_ = STTcal(table_); 142 moleculeTable_ = STMolecules(table_); 122 143 } 123 144 … … 188 209 189 210 // Now create Table SetUp from the description. 190 SetupNewTable aNewTab(generateName(), td, Table:: New);211 SetupNewTable aNewTab(generateName(), td, Table::Scratch); 191 212 table_ = Table(aNewTab, type_, 0); 192 213 originalTable_ = table_; … … 198 219 TableDesc tdh("", "1", TableDesc::Scratch); 199 220 tdh.addColumn(ScalarColumnDesc<String>("ITEM")); 200 SetupNewTable histtab("history", tdh, Table:: New);221 SetupNewTable histtab("history", tdh, Table::Scratch); 201 222 Table histTable(histtab, Table::Memory); 202 223 table_.rwKeywordSet().defineTable("HISTORY", histTable); … … 212 233 td.addColumn(ArrayColumnDesc<Bool>("PARMASK")); 213 234 td.addColumn(ArrayColumnDesc<String>("FRAMEINFO")); 214 SetupNewTable aNewTab("fits", td, Table:: New);235 SetupNewTable aNewTab("fits", td, Table::Scratch); 215 236 Table aTable(aNewTab, Table::Memory); 216 237 table_.rwKeywordSet().defineTable("FITS", aTable); … … 238 259 239 260 mfitidCol_.attach(table_,"FIT_ID"); 240 fitidCol_.attach(fitTable_,"FIT_ID");261 //fitidCol_.attach(fitTable_,"FIT_ID"); 241 262 242 263 mfreqidCol_.attach(table_, "FREQ_ID"); … … 378 399 Path path(inname); 379 400 inname = path.expandedName(); 401 //cout << table_.tableName() << endl; 402 //cout << freqTable_.table().tableName() << endl; 380 403 table_.deepCopy(inname, Table::New); 404 //Table t = Table(inname, Table::Update); 405 //cout << t.keywordSet().asTable("FREQUENCIES").tableName() << endl; 381 406 } 382 407 -
trunk/src/Scantable.h
r852 r859 326 326 void setupFitTable(); 327 327 328 void attachSubtables(); 328 329 /** 329 330 * Convert an "old" asap1 style row index into a new index
Note:
See TracChangeset
for help on using the changeset viewer.