Changeset 488
- Timestamp:
- 02/21/05 11:36:17 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMath.cc
r480 r488 112 112 113 113 114 SDMemTable* SDMath::frequencyAlignment (const SDMemTable& in, const String& refTime, 115 const String& method, Bool perFreqID) const 114 SDMemTable* SDMath::frequencyAlignment(const SDMemTable& in, 115 const String& refTime, 116 const String& method, 117 Bool perFreqID) const 116 118 { 117 119 // Get frame info from Table … … 132 134 // Do it 133 135 134 return frequencyAlign 136 return frequencyAlign(in, freqSystem, refTime, method, perFreqID); 135 137 } 136 138 … … 153 155 154 156 SDMemTable* pTabOut = new SDMemTable(*in[0],True); 155 157 if (in.nelements() > 1) { 158 for (uInt i=1; i < in.nelements(); ++i) { 159 pTabOut->appendToHistoryTable(in[i]->getHistoryTable()); 160 } 161 } 156 162 // Setup 157 163 … … 376 382 377 383 378 CountedPtr<SDMemTable> SDMath::binaryOperate (const CountedPtr<SDMemTable>& left, 379 const CountedPtr<SDMemTable>& right, 380 const String& op, Bool preserve, 381 Bool doTSys) const 384 CountedPtr<SDMemTable> SDMath::binaryOperate(const CountedPtr<SDMemTable>& 385 left, 386 const CountedPtr<SDMemTable>& 387 right, 388 const String& op, Bool preserve, 389 Bool doTSys) const 382 390 { 383 391 … … 435 443 436 444 SDMemTable* pTabOut = new SDMemTable(*left, True); 437 445 pTabOut->appendToHistoryTable(right->getHistoryTable()); 438 446 // Loop over rows 439 447 … … 488 496 if (doTSys) sc.putTsys(tSysLeftArr/tSysRightArr); 489 497 } else if (what==4) { 490 if (preserve) { 491 MaskedArray<Float> tmp = (tSysRightArr * mLeft / *pMRight) - tSysRightArr; 492 putDataInSDC(sc, tmp.getArray(), tmp.getMask()); 493 } else { 494 MaskedArray<Float> tmp = (tSysRightArr * mLeft / *pMRight) - tSysLeftArr; 495 putDataInSDC(sc, tmp.getArray(), tmp.getMask()); 496 } 497 sc.putTsys(tSysRightArr); 498 if (preserve) { 499 MaskedArray<Float> tmp = (tSysRightArr * mLeft / *pMRight) - 500 tSysRightArr; 501 putDataInSDC(sc, tmp.getArray(), tmp.getMask()); 502 } else { 503 MaskedArray<Float> tmp = (tSysRightArr * mLeft / *pMRight) - 504 tSysLeftArr; 505 putDataInSDC(sc, tmp.getArray(), tmp.getMask()); 506 } 507 sc.putTsys(tSysRightArr); 498 508 } 499 509 … … 504 514 if (pMRight) delete pMRight; 505 515 pTabOut->resetCursor(); 506 // 516 507 517 return CountedPtr<SDMemTable>(pTabOut); 508 518 } … … 629 639 } 630 640 631 SDMemTable* SDMath::resample 632 641 SDMemTable* SDMath::resample(const SDMemTable& in, const String& methodStr, 642 Float width) const 633 643 // 634 644 // Should add the possibility of width being specified in km/s. This means … … 789 799 return pOut; 790 800 } 791 792 793 801 794 802 SDMemTable* SDMath::averagePol(const SDMemTable& in, const Vector<Bool>& mask, … … 1018 1026 1019 1027 1020 SDMemTable* SDMath::convertFlux 1021 1028 SDMemTable* SDMath::convertFlux(const SDMemTable& in, Float D, Float etaAp, 1029 Float JyPerK, Bool doAll) const 1022 1030 // 1023 1031 // etaAp = aperture efficiency (-1 means find) … … 1107 1115 1108 1116 1109 SDMemTable* SDMath::gainElevation (const SDMemTable& in, const Vector<Float>& coeffs, 1110 const String& fileName, 1111 const String& methodStr, Bool doAll) const 1117 SDMemTable* SDMath::gainElevation(const SDMemTable& in, 1118 const Vector<Float>& coeffs, 1119 const String& fileName, 1120 const String& methodStr, Bool doAll) const 1112 1121 { 1113 1122 … … 1188 1197 1189 1198 1190 SDMemTable* SDMath::opacity 1199 SDMemTable* SDMath::opacity(const SDMemTable& in, Float tau, Bool doAll) const 1191 1200 { 1192 1201 … … 1220 1229 1221 1230 1222 void SDMath::rotateXYPhase 1231 void SDMath::rotateXYPhase(SDMemTable& in, Float value, Bool doAll) 1223 1232 // 1224 1233 // phase in degrees … … 1270 1279 } 1271 1280 1272 1273 1274 1281 // 'private' functions 1275 1282 -
trunk/src/SDMemTable.cc
r483 r488 47 47 #include <tables/Tables/TableParse.h> 48 48 #include <tables/Tables/TableDesc.h> 49 #include <tables/Tables/TableCopy.h> 49 50 #include <tables/Tables/SetupNewTab.h> 50 51 #include <tables/Tables/ScaColDesc.h> … … 1509 1510 } 1510 1511 1512 Table SDMemTable::getHistoryTable() const 1513 { 1514 return table_.keywordSet().asTable("HISTORY"); 1515 } 1516 1517 void SDMemTable::appendToHistoryTable(const Table& otherHist) 1518 { 1519 Table t = table_.rwKeywordSet().asTable("HISTORY"); 1520 const String sep = "--------------------------------------------------------------------------------"; 1521 addHistory(sep); 1522 TableCopy::copyRows(t, otherHist, t.nrow(), 0, otherHist.nrow()); 1523 addHistory(sep); 1524 } 1525 1511 1526 void SDMemTable::addHistory(const std::string& hist) 1512 1527 { … … 1532 1547 return stlout; 1533 1548 } 1549 1550 1534 1551 /* 1535 1552 void SDMemTable::maskChannels(const std::vector<Int>& whichChans ) { -
trunk/src/SDMemTable.h
r483 r488 195 195 std::vector<std::string> getHistory() const; 196 196 void addHistory(const std::string& hist); 197 198 casa::Table getHistoryTable() const; 199 void appendToHistoryTable(const casa::Table& otherHist); 197 200 198 201 // write to disk as aips++ table
Note:
See TracChangeset
for help on using the changeset viewer.