- Timestamp:
- 11/28/05 15:25:18 (19 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDMemTable.cc
r717 r745 75 75 IFSel_(0), 76 76 beamSel_(0), 77 polSel_(0) 77 polSel_(0) 78 78 { 79 79 setup(); … … 105 105 beamSel_= 0; 106 106 polSel_= 0; 107 chanMask_.resize(0);108 107 } else { 109 108 IFSel_= other.IFSel_; 110 109 beamSel_= other.beamSel_; 111 110 polSel_= other.polSel_; 112 chanMask_.resize(0);113 chanMask_ = other.chanMask_;114 111 } 115 112 … … 148 145 beamSel_= other.beamSel_; 149 146 polSel_= other.polSel_; 150 chanMask_.resize(0);151 chanMask_ = other.chanMask_;152 147 table_ = other.table_.copyToMemoryTable(String("dummy")); 153 148 attach(); … … 199 194 SDStokesEngine stokesEngine(String("STOKES"), String("SPECTRA")); 200 195 aNewTab.bindColumn("STOKES", stokesEngine); 201 196 202 197 // Create Table 203 table_ = Table(aNewTab, Table::Memory, 0); 204 // add subtable 198 table_ = Table(aNewTab, Table::Memory, 0); 199 // add subtable 205 200 TableDesc tdf("", "1", TableDesc::Scratch); 206 201 tdf.addColumn(ArrayColumnDesc<String>("FUNCTIONS")); … … 262 257 if (showDate) 263 258 mvt.setFormat(MVTime::YMD); 264 else 259 else 265 260 mvt.setFormat(MVTime::TIME); 266 261 ostringstream oss; … … 303 298 } 304 299 305 void SDMemTable::resetCursor() 300 void SDMemTable::resetCursor() 306 301 { 307 302 polSel_ = 0; … … 310 305 } 311 306 312 bool SDMemTable::setMask(std::vector<int> whichChans) 313 { 314 std::vector<int>::iterator it; 315 uInt n = flagsCol_.shape(0)(3); 316 if (whichChans.empty()) { 317 chanMask_ = std::vector<bool>(n,true); 318 return true; 319 } 320 chanMask_.resize(n,true); 321 for (it = whichChans.begin(); it != whichChans.end(); ++it) { 322 if (*it < n) { 323 chanMask_[*it] = false; 324 } 325 } 326 return true; 327 } 328 329 std::vector<bool> SDMemTable::getMask(Int whichRow) const 307 std::vector<bool> SDMemTable::getMask(Int whichRow) const 330 308 { 331 309 … … 342 320 aa2.reset(aa2.begin(uInt(polSel_)));// go to pol 343 321 344 Bool useUserMask = ( chanMask_.size() == arr.shape()(3) );345 346 std::vector<bool> tmp;347 tmp = chanMask_; // WHY the fxxx do I have to make a copy here348 std::vector<bool>::iterator miter;349 miter = tmp.begin();350 351 322 for (ArrayAccessor<uChar, Axis<asap::ChanAxis> > i(aa2); i != i.end(); ++i) { 352 323 bool out =!static_cast<bool>(*i); 353 if (useUserMask) {354 out = out && (*miter);355 miter++;356 }357 324 mask.push_back(out); 358 325 } … … 362 329 363 330 364 std::vector<float> SDMemTable::getSpectrum(Int whichRow) const 331 std::vector<float> SDMemTable::getSpectrum(Int whichRow) const 365 332 { 366 333 Array<Float> arr; … … 376 343 377 344 378 std::vector<float> SDMemTable::getStokesSpectrum(Int whichRow, 379 345 std::vector<float> SDMemTable::getStokesSpectrum(Int whichRow, 346 Bool doPol) const 380 347 // 381 348 // Gets one STokes parameter depending on cursor polSel location … … 388 355 throw (AipsError("You must have 1,2 or 4 polarizations to get the Stokes parameters")); 389 356 } 390 357 391 358 // For full conversion we are only supporting linears at the moment 392 359 393 360 if (nPol() > 2) { 394 361 String antName; … … 403 370 Array<Float> arr; 404 371 stokesCol_.get(whichRow, arr); 405 372 406 373 if (doPol && (polSel_==1 || polSel_==2)) { // Q,U --> P, P.A. 407 374 408 375 // Set current cursor location 409 376 410 377 const IPosition& shape = arr.shape(); 411 378 IPosition start, end; 412 379 getCursorSlice(start, end, shape); 413 380 414 381 // Get Q and U slices 415 382 416 383 Array<Float> Q = SDPolUtil::getStokesSlice(arr,start,end,"Q"); 417 384 Array<Float> U = SDPolUtil::getStokesSlice(arr,start,end,"U"); 418 419 // Compute output 420 385 386 // Compute output 387 421 388 Array<Float> out; 422 389 if (polSel_==1) { // P … … 425 392 out = SDPolUtil::positionAngle(Q,U); 426 393 } 427 394 428 395 // Copy to output 429 396 430 397 IPosition vecShape(1,shape(asap::ChanAxis)); 431 398 Vector<Float> outV = out.reform(vecShape); … … 433 400 outV.tovector(stlout); 434 401 return stlout; 435 436 } else { 402 403 } else { 437 404 // Selects at the cursor location 438 405 return getFloatSpectrum(arr); … … 440 407 } 441 408 442 std::string SDMemTable::getPolarizationLabel(Bool linear, Bool stokes, 443 444 { 445 uInt idx = polSel_; 409 std::string SDMemTable::getPolarizationLabel(Bool linear, Bool stokes, 410 Bool linPol, Int polIdx) const 411 { 412 uInt idx = polSel_; 446 413 if (polIdx >=0) idx = polIdx; 447 414 return SDPolUtil::polarizationLabel(idx, linear, stokes, linPol); … … 450 417 451 418 452 std::vector<float> SDMemTable::stokesToPolSpectrum(Int whichRow, 453 Bool toLinear, 454 419 std::vector<float> SDMemTable::stokesToPolSpectrum(Int whichRow, 420 Bool toLinear, 421 Int polIdx) const 455 422 // 456 423 // polIdx … … 489 456 throw(AipsError("Only conversion to RR & LL is currently supported")); 490 457 } 491 492 // Get I and V slices 458 459 // Get I and V slices 493 460 Array<Float> I = SDPolUtil::getStokesSlice(arr,start,end,"I"); 494 461 Array<Float> V = SDPolUtil::getStokesSlice(arr,start,end,"V"); 495 496 // Compute output 462 463 // Compute output 497 464 out = SDPolUtil::circularPolarizationFromStokes(I, V, doRR); 498 465 } 499 466 500 467 // Copy to output 501 468 IPosition vecShape(1,shape(asap::ChanAxis)); … … 521 488 522 489 const IPosition& shape = arr.shape(); 523 IPosition start(shape.nelements(),0); 490 IPosition start(shape.nelements(),0); 524 491 IPosition end(shape-1); 525 492 if (iBeam!=-1) { … … 587 554 MFrequency::Types mdr; 588 555 if (!MFrequency::getType(mdr, rfrm)) { 589 556 590 557 Int a,b;const uInt* c; 591 558 const String* valid = MFrequency::allMyTypes(a, b, c); … … 662 629 } else if (u == Unit("Hz")) { 663 630 664 // Set world axis units 631 // Set world axis units 665 632 Vector<String> wau(1); wau = u.getName(); 666 633 spc.setWorldAxisUnits(wau); … … 689 656 Vector<uInt> freqIDs; 690 657 freqidCol_.get(whichRow, freqIDs); 691 uInt freqID = freqIDs(IFSel_); 658 uInt freqID = freqIDs(IFSel_); 692 659 restfreqidCol_.get(whichRow, freqIDs); 693 660 uInt restFreqID = freqIDs(IFSel_); … … 697 664 698 665 String s = "Channel"; 699 if (u == Unit("km/s")) { 666 if (u == Unit("km/s")) { 700 667 s = CoordinateUtil::axisLabel(spc,0,True,True,True); 701 668 } else if (u == Unit("Hz")) { … … 789 756 */ 790 757 791 MaskedArray<Float> SDMemTable::rowAsMaskedArray(uInt whichRow, 792 Bool toStokes) const 758 MaskedArray<Float> SDMemTable::rowAsMaskedArray(uInt whichRow, 759 Bool toStokes) const 793 760 { 794 761 // Get flags … … 871 838 SpectralCoordinate SDMemTable::getSpectralCoordinate(uInt freqID) const 872 839 { 873 840 874 841 Table t = table_.keywordSet().asTable("FREQUENCIES"); 875 842 if (freqID> t.nrow() ) { … … 900 867 901 868 902 SpectralCoordinate SDMemTable::getSpectralCoordinate(uInt freqID, 903 869 SpectralCoordinate SDMemTable::getSpectralCoordinate(uInt freqID, 870 uInt restFreqID, 904 871 uInt whichRow) const 905 872 { 906 873 907 874 // Create basic SC 908 875 SpectralCoordinate spec = getSpectralCoordinate (freqID); … … 989 956 std::vector<double> stlout; 990 957 tvec.tovector(stlout); 991 return stlout; 958 return stlout; 992 959 } 993 960 … … 1065 1032 Vector<String> funcs; 1066 1033 Vector<String> finfo; 1067 Vector<Int> comps; 1034 Vector<Int> comps; 1068 1035 ROArrayColumn<Double> parmsCol(t, "PARAMETERS"); 1069 1036 ROArrayColumn<Bool> parmaskCol(t, "PARMASK"); … … 1102 1069 Vector<String> funcs; 1103 1070 Vector<String> finfo; 1104 Vector<Int> comps; 1071 Vector<Int> comps; 1105 1072 ROArrayColumn<Double> parmsCol(t, "PARAMETERS"); 1106 1073 ROArrayColumn<Bool> parmaskCol(t, "PARMASK"); … … 1130 1097 1131 1098 void SDMemTable::addFit(uInt whichRow, 1132 1133 1099 const Vector<Double>& p, const Vector<Bool>& m, 1100 const Vector<String>& f, const Vector<Int>& c) 1134 1101 { 1135 1102 if (whichRow >= nRow()) { … … 1137 1104 } 1138 1105 Table t = table_.keywordSet().asTable("FITS"); 1139 uInt nrow = t.nrow(); 1106 uInt nrow = t.nrow(); 1140 1107 t.addRow(); 1141 1108 ArrayColumn<Double> parmsCol(t, "PARAMETERS"); … … 1154 1121 fitCol_.get(whichRow, fitarr); 1155 1122 1156 Array<Int> newarr; // The new Array containing the fitid 1157 Int pos =-1; // The fitid position in the array 1123 Array<Int> newarr; // The new Array containing the fitid 1124 Int pos =-1; // The fitid position in the array 1158 1125 if ( fitarr.nelements() == 0 ) { // no fits at all in this row 1159 1126 Array<Int> arr(IPosition(4,nBeam(),nIF(),nPol(),1)); 1160 1127 arr = -1; 1161 1128 newarr.reference(arr); 1162 pos = 0; 1129 pos = 0; 1163 1130 } else { 1164 1131 IPosition shp = fitarr.shape(); … … 1172 1139 while (it != fits.end()) { 1173 1140 if (*it == -1) { 1174 1175 1141 pos = i; 1142 break; 1176 1143 } 1177 1144 ++i; … … 1186 1153 newarr = fitarr; 1187 1154 } 1188 newarr(IPosition(4, beamSel_, IFSel_, polSel_, pos)) = Int(nrow); 1155 newarr(IPosition(4, beamSel_, IFSel_, polSel_, pos)) = Int(nrow); 1189 1156 fitCol_.put(whichRow, newarr); 1190 1157 … … 1218 1185 sdft.setRefFrame(baseFrame); 1219 1186 1220 // Equinox 1187 // Equinox 1221 1188 Float equinox; 1222 1189 t.keywordSet().get("EQUINOX", equinox); … … 1283 1250 Array<Double> direction; 1284 1251 Array<Int> fits; 1285 1252 1286 1253 specCol_.get(whichRow, spectrum); 1287 1254 sdc.putSpectrum(spectrum); … … 1344 1311 } 1345 1312 void SDMemTable::makePersistent(const std::string& filename) 1346 { 1313 { 1347 1314 table_.deepCopy(filename,Table::New); 1348 1315 … … 1369 1336 if (x < 59.95) 1370 1337 return String(" ") + mvt.string(MVTime::TIME_CLEAN_NO_HM, 7)+"s"; 1371 else if (x < 3599.95) 1338 else if (x < 3599.95) 1372 1339 return String(" ") + mvt.string(MVTime::TIME_CLEAN_NO_H,7)+" "; 1373 1340 else { … … 1376 1343 oss << ":" << mvt.string(MVTime::TIME_CLEAN_NO_H,7) << " "; 1377 1344 return String(oss); 1378 } 1345 } 1379 1346 }; 1380 1347 … … 1465 1432 << setw(24) << dirtype 1466 1433 << setw(10) << "Time" 1467 << setw(18) << "Integration" 1434 << setw(18) << "Integration" 1468 1435 << setw(7) << "FreqIDs" << endl; 1469 1436 oss << "--------------------------------------------------------------------------------" << endl; 1470 1437 1471 1438 // Generate list of scan start and end integrations 1472 1439 Vector<Int> scanIDs = scanCol_.getColumn(); … … 1488 1455 1489 1456 // Find all the FreqIDs in this scan 1490 listFQ.resize(0); 1491 listRestFQ.resize(0); 1457 listFQ.resize(0); 1458 listRestFQ.resize(0); 1492 1459 for (uInt j=startInt(i); j<endInt(i)+1; j++) { 1493 1460 freqidCol_.get(j, freqIDs); 1494 1461 for (uInt k=0; k<freqIDs.nelements(); k++) { 1495 1462 mathutil::addEntry(listFQ, freqIDs(k)); 1496 1463 } 1497 1464 // 1498 1465 restfreqidCol_.get(j, restFreqIDs); 1499 1466 for (uInt k=0; k<restFreqIDs.nelements(); k++) { 1500 1467 mathutil::addEntry(listRestFQ, restFreqIDs(k)); 1501 1468 } 1502 1469 } … … 1504 1471 nInt = endInt(i) - startInt(i) + 1; 1505 1472 oss << setw(3) << std::right << i << std::left << setw(2) << " " 1506 1507 1508 << setw(10) << time 1509 1510 1511 1473 << setw(15) << name 1474 << setw(24) << posit 1475 << setw(10) << time 1476 << setw(3) << std::right << nInt << setw(3) << " x " << std::left 1477 << setw(6) << tInt 1478 << " " << listFQ << " " << listRestFQ << endl; 1512 1479 } 1513 1480 oss << endl; 1514 oss << "Table contains " << table_.nrow() << " integration(s) in " 1481 oss << "Table contains " << table_.nrow() << " integration(s) in " 1515 1482 << nScans << " scan(s)." << endl; 1516 1483 … … 1524 1491 for (uInt i=0; i<sdft.length(); i++) { 1525 1492 oss << setw(8) << i << setw(8) 1526 1527 1528 1529 1493 << info[3] << setw(16) << setprecision(8) 1494 << sdft.referenceValue(i) << setw(10) 1495 << sdft.referencePixel(i) << setw(12) 1496 << sdft.increment(i) << endl; 1530 1497 } 1531 1498 oss << "--------------------------------------------------------------------------------" << endl; … … 1586 1553 { 1587 1554 Table t = table_.rwKeywordSet().asTable("HISTORY"); 1588 uInt nrow = t.nrow(); 1555 uInt nrow = t.nrow(); 1589 1556 t.addRow(); 1590 1557 ScalarColumn<String> itemCol(t, "ITEM"); … … 1596 1563 Vector<String> history; 1597 1564 const Table& t = table_.keywordSet().asTable("HISTORY"); 1598 uInt nrow = t.nrow(); 1565 uInt nrow = t.nrow(); 1599 1566 ROScalarColumn<String> itemCol(t, "ITEM"); 1600 1567 std::vector<std::string> stlout; … … 1647 1614 1648 1615 MDirection::Types SDMemTable::getDirectionReference() const 1649 { 1616 { 1650 1617 Float eq; 1651 1618 table_.keywordSet().get("Equinox",eq); … … 1654 1621 mp[1950.0] = "B1950"; 1655 1622 MDirection::Types mdr; 1656 if (!MDirection::getType(mdr, mp[eq])) { 1623 if (!MDirection::getType(mdr, mp[eq])) { 1657 1624 mdr = MDirection::J2000; 1658 1625 pushLog("WARNING: Unknown equinox using J2000"); 1659 1626 1660 1627 } 1661 1628 … … 1677 1644 1678 1645 1679 Bool SDMemTable::setRestFreqs(const Vector<Double>& restFreqsIn, 1680 1681 1682 1683 1646 Bool SDMemTable::setRestFreqs(const Vector<Double>& restFreqsIn, 1647 const String& sUnit, 1648 const vector<string>& lines, 1649 const String& source, 1650 Int whichIF) 1684 1651 { 1685 1652 const Int nIFs = nIF(); … … 1707 1674 restFreqs[i] = lineFreq.getValue().getValue(); // Hz 1708 1675 } else { 1709 String s = String(lines[i]) + 1710 1676 String s = String(lines[i]) + 1677 String(" is an unrecognized spectral line"); 1711 1678 throw(AipsError(s)); 1712 1679 } … … 1757 1724 for (uInt i=0; i<nRow; i++) { 1758 1725 srcnCol_.get(i, srcName); 1759 restfreqidCol_.get(i,restFreqIDs); 1726 restfreqidCol_.get(i,restFreqIDs); 1760 1727 if (idx==-1) { 1761 1762 1728 // Replace vector of restFreqs; one per IF. 1729 // No selection possible 1763 1730 for (uInt i=0; i<nIFs; i++) restFreqIDs[i] = i; 1764 1731 } else { 1765 1732 // Set RestFreqID for selected data 1766 1733 if (empty || source==srcName) { 1767 1734 if (whichIF<0) { 1768 1735 restFreqIDs = idx; 1769 } else { 1736 } else { 1770 1737 restFreqIDs[whichIF] = idx; 1771 1738 } 1772 1739 } 1773 1740 } 1774 restfreqidCol_.put(i,restFreqIDs); 1741 restfreqidCol_.put(i,restFreqIDs); 1775 1742 } 1776 1743 ok = True; … … 1813 1780 // renumber 1814 1781 scanCol_.put(i,newscanid); 1815 } else { 1782 } else { 1816 1783 ++newscanid; 1817 1784 pIdx = cIdx; // store scanid … … 1823 1790 1824 1791 void SDMemTable::getCursorSlice(IPosition& start, IPosition& end, 1825 1792 const IPosition& shape) const 1826 1793 { 1827 1794 const uInt nDim = shape.nelements(); 1828 1795 start.resize(nDim); 1829 1796 end.resize(nDim); 1830 1797 1831 1798 start(asap::BeamAxis) = beamSel_; 1832 1799 end(asap::BeamAxis) = beamSel_; … … 1855 1822 ArrayAccessor<Float, Axis<asap::PolAxis> > aa2(aa1); 1856 1823 aa2.reset(aa2.begin(uInt(polSel_))); // Pol selection 1857 1824 1858 1825 std::vector<float> spectrum; 1859 1826 for (ArrayAccessor<Float, Axis<asap::ChanAxis> > i(aa2); i != i.end(); ++i) { -
trunk/src/SDMemTable.h
r717 r745 49 49 50 50 namespace asap { 51 51 52 52 class SDContainer; 53 53 class SDHeader; … … 71 71 SDMemTable(const casa::Table& tab, const std::string& expr); 72 72 73 // Assignment operator (copy semantics) 73 // Assignment operator (copy semantics) 74 74 SDMemTable &operator=(const SDMemTable& other); 75 75 76 76 virtual ~SDMemTable(); 77 77 … … 86 86 SDHeader getSDHeader() const; 87 87 88 // Get SD Frequency table. 88 // Get SD Frequency table. 89 89 SDFrequencyTable getSDFreqTable() const; 90 90 … … 101 101 // I,P,PA,V (doPol=True) (determined by the polSel cursor location 102 102 // 0->3) If the latter, you can add a PA offset (degrees) 103 virtual std::vector<float> getStokesSpectrum(casa::Int whichRow=0, 103 virtual std::vector<float> getStokesSpectrum(casa::Int whichRow=0, 104 104 casa::Bool doPol=casa::False) const; 105 105 … … 108 108 // label for raw correlations (linear or circular). If True returns 109 109 // label for Stokes. If doPol=False, I,Q,U,V else I,P,PA,V 110 std::string getPolarizationLabel(casa::Bool linear, casa::Bool stokes, 111 casa::Bool linPol, 112 110 std::string getPolarizationLabel(casa::Bool linear, casa::Bool stokes, 111 casa::Bool linPol, 112 casa::Int polIdx=-1) const; 113 113 114 114 // Convert Stokes to linear or circular polarizations (specified by … … 116 116 // supported. 117 117 virtual std::vector<float> stokesToPolSpectrum(casa::Int whichRow, 118 119 118 casa::Bool toLinear, 119 casa::Int polIdx) const; 120 120 121 121 // Get all Stokes at the specified Beam/IF cursor location (ignoring … … 125 125 // is not the same as nPol(), I have put it here for direct access as needed 126 126 virtual casa::Array<casa::Float> getStokesSpectrum(casa::Int whichRow=0, 127 casa::Int iBeam=-1, 127 casa::Int iBeam=-1, 128 128 casa::Int iIF=-1) const; 129 129 … … 132 132 133 133 // get all as aips++ Vectors 134 virtual void getSpectrum(casa::Vector<casa::Float>& spectrum, 135 casa::Int whichRow=0) const; 136 //virtual void getMask(Vector<Bool>& mask,Int whichRow=0) const; 134 virtual void getSpectrum(casa::Vector<casa::Float>& spectrum, 135 casa::Int whichRow=0) const; 137 136 138 137 // Get rest frequencies 139 138 std::vector<double> getRestFreqs() const; 140 141 // get info for current row 139 140 // get info for current row 142 141 // if whichRow == -1 the Header time is given 143 std::string getTime(casa::Int whichRow=0, 144 145 casa::MEpoch getEpoch(casa::Int whichRow=0) const; 142 std::string getTime(casa::Int whichRow=0, 143 casa::Bool showDate=casa::False) const ; 144 casa::MEpoch getEpoch(casa::Int whichRow=0) const; 146 145 casa::MDirection getDirection(casa::Int whichRow=0, 147 casa::Bool refBeam=casa::False) const; 146 casa::Bool refBeam=casa::False) const; 148 147 149 148 std::string getSourceName(casa::Int whichRow=0) const; … … 154 153 155 154 // Set RestFreqID. source="" and IF=-1 means select all 156 virtual casa::Bool setRestFreqs(const casa::Vector<casa::Double>& restFreqs, 157 158 159 160 155 virtual casa::Bool setRestFreqs(const casa::Vector<casa::Double>& restFreqs, 156 const casa::String& unit, 157 const std::vector<std::string>& lines, 158 const casa::String& source, 159 casa::Int whichIF=-1); 161 160 162 161 // List lines … … 166 165 std::string getFluxUnit() const; 167 166 void setFluxUnit (const std::string& unit); 168 167 169 168 // Set Instrument 170 169 void setInstrument (const std::string& instrument); … … 178 177 virtual void resetCursor(); 179 178 180 //sets the user mask applied to all spectra181 virtual bool setMask(std::vector<int> whichChans);182 179 // Hard flags the current spectrum, not reversible 183 180 virtual void flag(int whichRow); … … 226 223 // return a row as a Masked array, internally converting uChar flags 227 224 // to bool mask 228 casa::MaskedArray<casa::Float> rowAsMaskedArray(casa::uInt whichRow, 225 casa::MaskedArray<casa::Float> rowAsMaskedArray(casa::uInt whichRow, 229 226 casa::Bool toStokes=casa::False) const; 230 227 … … 237 234 // rest frequency. If row number given (>=0), also set 238 235 // frame conversion layer (needs direction & time which require row) 239 casa::SpectralCoordinate getSpectralCoordinate(casa::uInt freqID, 236 casa::SpectralCoordinate getSpectralCoordinate(casa::uInt freqID, 240 237 casa::uInt restFreqID, 241 238 casa::uInt row) const; … … 243 240 // Set just the reference value, pixel and increment into the table 244 241 // No other state is extracted. 245 casa::Bool setCoordinate(const casa::SpectralCoordinate& speccord, 246 242 casa::Bool setCoordinate(const casa::SpectralCoordinate& speccord, 243 casa::uInt whichIdx); 247 244 248 245 casa::Int nCoordinates() const; … … 263 260 264 261 void addFit(casa::uInt whichRow, 265 const casa::Vector<casa::Double>& p, 266 267 const casa::Vector<casa::String>& f, 268 269 270 262 const casa::Vector<casa::Double>& p, 263 const casa::Vector<casa::Bool>& m, 264 const casa::Vector<casa::String>& f, 265 const casa::Vector<casa::Int>& c); 266 267 271 268 private: 272 269 // utility func for nice printout … … 279 276 280 277 // Generate start and end for shape and current cursor selection 281 void getCursorSlice(casa::IPosition& start, casa::IPosition& end, 282 278 void getCursorSlice(casa::IPosition& start, casa::IPosition& end, 279 const casa::IPosition& shape) const; 283 280 284 281 // the current cursor into the array 285 282 casa::Int IFSel_,beamSel_,polSel_; 286 std::vector<bool> chanMask_;287 283 // the underlying memory table 288 284 casa::Table table_; -
trunk/src/SDMemTableWrapper.h
r717 r745 86 86 } 87 87 88 std::vector<float> getStokesSpectrum(int whichRow=0, 89 88 std::vector<float> getStokesSpectrum(int whichRow=0, 89 bool linPol=false) const { 90 90 return table_->getStokesSpectrum(whichRow, linPol); 91 91 } 92 92 93 93 std::vector<float> stokesToPolSpectrum(int whichRow=0, bool linear=false, 94 94 int polIdx=-1) const { 95 95 return table_->stokesToPolSpectrum(whichRow, linear, polIdx); 96 96 } … … 98 98 // std::string getPolarizationLabel(bool linear, bool stokes, bool linPol, int polIdx) const { 99 99 // Boost fails with 4 arguments. 100 std::string getPolarizationLabel(bool linear, bool stokes, 101 100 std::string getPolarizationLabel(bool linear, bool stokes, 101 bool linPol) const { 102 102 int polIdx = -1; 103 103 return table_->getPolarizationLabel(linear, stokes, linPol, polIdx); … … 130 130 return table_->getMask(whichRow); 131 131 } 132 bool setMask(const std::vector<int> mvals) const {133 return table_->setMask(mvals);134 }135 132 136 133 void flag(int whichRow=-1) { … … 169 166 } 170 167 171 bool setRestFreqs(const std::vector<double>& restfreqs, 172 const std::string& unit, 168 bool setRestFreqs(const std::vector<double>& restfreqs, 169 const std::string& unit, 173 170 const std::vector<std::string>& lines, 174 171 const std::string& source, int whichIF) { … … 178 175 casa::Int(whichIF)); 179 176 } 180 181 std::string spectralLines() const { table_->spectralLines();}177 178 std::string spectralLines() const {return table_->spectralLines();} 182 179 183 180 std::vector<double> getRestFreqs() { … … 195 192 SDMemTable* getPtr() {return &(*table_);} 196 193 197 std::string summary(bool verbose=false) const { 198 return table_->summary(verbose); 199 } 200 201 std::vector<std::string> getHistory() { 202 return table_->getHistory(); 203 } 204 void addHistory(const std::string& hist) { 205 table_->addHistory(hist); 194 std::string summary(bool verbose=false) const { 195 return table_->summary(verbose); 196 } 197 198 std::vector<std::string> getHistory() { 199 return table_->getHistory(); 200 } 201 void addHistory(const std::string& hist) { 202 table_->addHistory(hist); 206 203 } 207 204 208 205 void addFit(int whichRow, const std::vector<double>& p, 209 210 211 206 const std::vector<bool>& m, const std::vector<string>& f, 207 const std::vector<int>& c) { 208 212 209 casa::Vector<casa::Double> p2(p); 213 casa::Vector<casa::Bool> m2(m); 210 casa::Vector<casa::Bool> m2(m); 214 211 casa::Vector<casa::String> f2 = mathutil::toVectorString(f); 215 212 casa::Vector<casa::Int> c2(c); -
trunk/src/python_SDMemTable.cc
r539 r745 62 62 .def("setbeam", &SDMemTableWrapper::setBeam) 63 63 .def("setpol", &SDMemTableWrapper::setPol) 64 .def("_setmask", &SDMemTableWrapper::setMask)65 64 .def("get_fluxunit", &SDMemTableWrapper::getFluxUnit) 66 65 .def("set_fluxunit", &SDMemTableWrapper::setFluxUnit) … … 100 99 .def("_save", &SDMemTableWrapper::makePersistent) 101 100 .def("_summary", &SDMemTableWrapper::summary, 102 101 (boost::python::arg("verbose")=true) ) 103 102 .def("_getrestfreqs", &SDMemTableWrapper::getRestFreqs) 104 103 .def("_setrestfreqs", &SDMemTableWrapper::setRestFreqs)
Note:
See TracChangeset
for help on using the changeset viewer.