- Timestamp:
- 02/10/10 11:59:23 (15 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STMath.cpp
r1618 r1689 1431 1431 1432 1432 CountedPtr< Scantable > STMath::opacity( const CountedPtr< Scantable > & in, 1433 floattau )1433 const std::vector<float>& tau ) 1434 1434 { 1435 1435 CountedPtr< Scantable > out = getScantable(in, false); 1436 1436 1437 Table tab = out->table(); 1438 ROScalarColumn<Float> elev(tab, "ELEVATION"); 1439 ArrayColumn<Float> specCol(tab, "SPECTRA"); 1440 ArrayColumn<uChar> flagCol(tab, "FLAGTRA"); 1441 ArrayColumn<Float> tsysCol(tab, "TSYS"); 1442 for ( uInt i=0; i<tab.nrow(); ++i) { 1443 Float zdist = Float(C::pi_2) - elev(i); 1444 Float factor = exp(tau/cos(zdist)); 1445 MaskedArray<Float> ma = maskedArray(specCol(i), flagCol(i)); 1446 ma *= factor; 1447 specCol.put(i, ma.getArray()); 1448 flagCol.put(i, flagsFromMA(ma)); 1449 Vector<Float> tsys; 1450 tsysCol.get(i, tsys); 1451 tsys *= factor; 1452 tsysCol.put(i, tsys); 1437 Table outtab = out->table(); 1438 1439 const uInt ntau = uInt(tau.size()); 1440 std::vector<float>::const_iterator tauit = tau.begin(); 1441 AlwaysAssert((ntau == 1 || ntau == in->nif() || ntau == in->nif() * in->npol()), 1442 AipsError); 1443 TableIterator iiter(outtab, "IFNO"); 1444 while ( !iiter.pastEnd() ) { 1445 Table itab = iiter.table(); 1446 TableIterator piter(outtab, "POLNO"); 1447 while ( !piter.pastEnd() ) { 1448 Table tab = piter.table(); 1449 ROScalarColumn<Float> elev(tab, "ELEVATION"); 1450 ArrayColumn<Float> specCol(tab, "SPECTRA"); 1451 ArrayColumn<uChar> flagCol(tab, "FLAGTRA"); 1452 ArrayColumn<Float> tsysCol(tab, "TSYS"); 1453 for ( uInt i=0; i<tab.nrow(); ++i) { 1454 Float zdist = Float(C::pi_2) - elev(i); 1455 Float factor = exp(*tauit/cos(zdist)); 1456 MaskedArray<Float> ma = maskedArray(specCol(i), flagCol(i)); 1457 ma *= factor; 1458 specCol.put(i, ma.getArray()); 1459 flagCol.put(i, flagsFromMA(ma)); 1460 Vector<Float> tsys; 1461 tsysCol.get(i, tsys); 1462 tsys *= factor; 1463 tsysCol.put(i, tsys); 1464 } 1465 if (ntau == in->nif()*in->npol() ) { 1466 tauit++; 1467 } 1468 piter++; 1469 } 1470 if (ntau >= in->nif() ) { 1471 tauit++; 1472 } 1473 iiter++; 1453 1474 } 1454 1475 return out; -
trunk/src/STMath.h
r1570 r1689 227 227 228 228 casa::CountedPtr<Scantable> opacity(const casa::CountedPtr<Scantable>& in, 229 floattau);229 const std::vector<float>& tau); 230 230 231 231 casa::CountedPtr<Scantable> -
trunk/src/STMathWrapper.h
r1570 r1689 149 149 150 150 ScantableWrapper opacity(const ScantableWrapper& in, 151 floattau)151 const std::vector<float>& tau) 152 152 { return ScantableWrapper(STMath::opacity(in.getCP(), tau)); } 153 153
Note:
See TracChangeset
for help on using the changeset viewer.