- Timestamp:
- 02/16/11 13:05:11 (14 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MSFiller.cpp
r1990 r1993 77 77 isProcessor_( False ), 78 78 isSysCal_( False ), 79 isWeather_( False ) 79 isWeather_( False ), 80 colTsys_( "TSYS_SPECTRUM" ), 81 colTcal_( "TCAL_SPECTRUM" ) 80 82 { 81 83 os_ = LogIO() ; … … 189 191 if ( caltab.nrow() == 0 ) 190 192 isSysCal_ = False ; 193 else { 194 if ( !caltab.tableDesc().isColumn( colTcal_ ) ) 195 colTcal_ = "TCAL" ; 196 if ( !caltab.tableDesc().isColumn( colTsys_ ) ) 197 colTsys_ = "TSYS" ; 198 } 191 199 MSPointing pointtab = mstable_.pointing() ; 192 200 if ( mstable_.weather().nrow() == 0 ) … … 384 392 //os_ << "npol = " << npol << LogIO::POST ; 385 393 //os_ << "corrtype = " << corrtype << LogIO::POST ; 386 if ( sdh.npol < npol ) sdh.npol = npol;394 sdh.npol = max( sdh.npol, npol ) ; 387 395 if ( sdh.poltype == "" ) sdh.poltype = getPolType( corrtype[0] ) ; 388 396 // source information … … 453 461 Bool even = False ; 454 462 if ( (nchan/2)*2 == nchan ) even = True ; 455 if ( sdh.nchan < nchan ) sdh.nchan = nchan;463 sdh.nchan = max( sdh.nchan, nchan ) ; 456 464 ROScalarQuantColumn<Double> *tmpQuantCol = new ROScalarQuantColumn<Double>( spwtab, "TOTAL_BANDWIDTH" ) ; 457 465 Double totbw = (*tmpQuantCol)( spwId ).getValue( "Hz" ) ; 458 466 delete tmpQuantCol ; 459 if ( sdh.bandwidth < totbw ) sdh.bandwidth = totbw;467 sdh.bandwidth = max( sdh.bandwidth, totbw ) ; 460 468 if ( sdh.freqref == "" ) 461 469 //sdh.freqref = MFrequency::showType( freqRef ) ; … … 562 570 os_ << "start fill SPECTRA and FLAG: " << time0 << LogIO::POST ; 563 571 ROArrayColumn<Bool> mFlagCol( t5, "FLAG" ) ; 572 //Cube<Bool> mFlagArr = mFlagCol.getColumn() ; 564 573 if ( isFloatData_ ) { 565 574 //os_ << "FLOAT_DATA exists" << LogIO::POST ; 566 575 ROArrayColumn<Float> mFloatDataCol( t5, "FLOAT_DATA" ) ; 576 //Cube<Float> mFloatDataArr = mFloatDataCol.getColumn() ; 567 577 addednr = nrow*npol ; 568 578 oldnr += addednr ; … … 571 581 for ( Int irow = 0 ; irow < nrow ; irow++ ) { 572 582 Matrix<Float> sp = mFloatDataCol( irow ) ; 583 //Matrix<Float> sp = mFloatDataArr.xyPlane( irow ) ; 573 584 for ( Int ipol = 0 ; ipol < npol ; ipol++ ) { 574 585 spCol->put( prevnr+ipol*nrow+irow, sp.row(ipol) ) ; … … 577 588 for ( Int irow = 0 ; irow < nrow ; irow++ ) { 578 589 Matrix<Bool> flb = mFlagCol( irow ) ; 590 //Matrix<Bool> flb = mFlagArr.xyPlane( irow ) ; 579 591 Matrix<uChar> fl( flb.shape() ) ; 580 592 convertArray( fl, flb ) ; … … 592 604 //os_ << "DATA exists" << LogIO::POST ; 593 605 ROArrayColumn<Complex> mDataCol( t5, "DATA" ) ; 606 //Cube<Complex> mDataArr = mDataCol.getColumn() ; 594 607 addednr = nrow*npol ; 595 608 oldnr += addednr ; … … 599 612 Bool crossOK = False ; 600 613 Matrix<Complex> sp = mDataCol( irow ) ; 614 //Matrix<Complex> sp = mDataArr.xyPlane( irow ) ; 601 615 for ( Int ipol = 0 ; ipol < npol ; ipol++ ) { 602 616 if ( corrtype[ipol] == Stokes::XY || corrtype[ipol] == Stokes::YX … … 620 634 Bool crossOK = False ; 621 635 Matrix<Bool> flb = mFlagCol( irow ) ; 636 //Matrix<Bool> flb = mFlagArr.xyPlane( irow ) ; 622 637 Matrix<uChar> fl( flb.shape() ) ; 623 638 convertArray( fl, flb ) ; … … 667 682 time0 = gettimeofday_sec() ; 668 683 os_ << "start fill TSYS: " << time0 << LogIO::POST ; 669 Vector<Double> sysCalTime ; 684 Vector<Double> sysCalTime( nrow, -1.0 ) ; 685 //Vector<Double> sysCalTime ; 670 686 if ( isSysCal_ ) { 671 sysCalTime = getSysCalTime( caltabsel, *mTimeCol ) ; 687 //sysCalTime = getSysCalTime( caltabsel, *mTimeCol ) ; 688 getSysCalTime( caltabsel, *mTimeCol, sysCalTime ) ; 672 689 tidx = prevnr ; 673 690 uInt calidx = 0 ; … … 1455 1472 return ; 1456 1473 } 1457 Bool isSp = sctab.tableDesc().isColumn( "TCAL_SPECTRUM" ) ;1458 //Table sctabsel = sctab( sctab.col("ANTENNA_ID") == antenna_ ) ;1459 1474 Table sctabsel( sctab( sctab.col("ANTENNA_ID") == antenna_ ) ) ; 1460 1475 if ( sctabsel.nrow() == 0 ) { … … 1496 1511 //os_ << "fillTcal::t2.nrow = " << nrow << LogIO::POST ; 1497 1512 ROScalarQuantColumn<Double> scTimeCol( t2, "TIME" ) ; 1498 IPosition newShape( 2, 1, nrow ) ; 1499 if ( isSp ) { 1500 scTcalCol.attach( t2, "TCAL_SPECTRUM" ) ; 1501 newShape[0] = scTcalCol.shape(0)(1) ; 1502 } 1503 else { 1504 scTcalCol.attach( t1, "TCAL" ) ; 1505 } 1513 scTcalCol.attach( t2, colTcal_ ) ; 1506 1514 tab.addRow( nrow*npol ) ; 1507 1515 newnr += nrow*npol ; … … 1580 1588 } 1581 1589 1582 Vector<Double> MSFiller::getSysCalTime( MSSysCal &tab, MEpoch::ROScalarColumn &tcol ) 1590 //Vector<Double> MSFiller::getSysCalTime( MSSysCal &tab, MEpoch::ROScalarColumn &tcol ) 1591 void MSFiller::getSysCalTime( MSSysCal &tab, MEpoch::ROScalarColumn &tcol, Vector<Double> &tstr ) 1583 1592 { 1584 1593 double startSec = gettimeofday_sec() ; 1585 1594 os_ << "start MSFiller::getSysCalTime() startSec=" << startSec << LogIO::POST ; 1586 uInt nrow = tcol.table().nrow() ; 1587 Vector<Double> tstr( nrow, -1.0 ) ; 1595 //uInt nrow = tcol.table().nrow() ; 1596 uInt nrow = tstr.nelements() ; 1597 //Vector<Double> tstr( nrow, -1.0 ) ; 1588 1598 if ( tab.nrow() == 0 ) 1589 return tstr ; 1599 //return tstr ; 1600 return ; 1590 1601 uInt scnrow = tab.nrow() ; 1591 1602 ROScalarMeasColumn<MEpoch> scTimeCol( tab, "TIME" ) ; … … 1615 1626 double endSec = gettimeofday_sec() ; 1616 1627 os_ << "end MSFiller::getSysCalTime() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1617 return tstr ; 1628 //return tstr ; 1629 return ; 1618 1630 } 1619 1631 … … 1628 1640 return 0 ; 1629 1641 } 1630 Bool isSp = tab.tableDesc().isColumn( "TSYS_SPECTRUM" ) ;1631 1642 ROScalarMeasColumn<MEpoch> scTimeCol( tab, "TIME" ) ; 1632 1643 ROArrayColumn<Float> mTsysCol ; 1633 if ( isSp ) { 1634 mTsysCol.attach( tab, "TSYS_SPECTRUM" ) ; 1635 } 1636 else { 1637 mTsysCol.attach( tab, "TSYS" ) ; 1638 } 1644 mTsysCol.attach( tab, colTsys_ ) ; 1639 1645 for ( uInt i = idx ; i < nrow ; i++ ) { 1640 1646 Double tref = scTimeCol( i ).get( "s" ).getValue() ; -
trunk/src/MSFiller.h
r1990 r1993 25 25 #include <casa/Arrays/Vector.h> 26 26 #include <casa/Arrays/Matrix.h> 27 #include <casa/Arrays/Cube.h> 27 28 #include <casa/Logging/LogIO.h> 28 29 … … 84 85 // assume that tab is selected by ANTENNA_ID, FEED_ID, SPECTRAL_WINDOW_ID 85 86 // and sorted by TIME 86 casa::Vector<casa::Double> getSysCalTime( casa::MSSysCal &tab, casa::MEpoch::ROScalarColumn &tcol ) ; 87 //casa::Vector<casa::Double> getSysCalTime( casa::MSSysCal &tab, casa::MEpoch::ROScalarColumn &tcol ) ; 88 void getSysCalTime( casa::MSSysCal &tab, casa::MEpoch::ROScalarColumn &tcal, casa::Vector<casa::Double> &scTime ) ; 87 89 88 90 // get tsys by time stamp … … 117 119 casa::Bool isWeather_ ; 118 120 121 casa::String colTsys_ ; 122 casa::String colTcal_ ; 123 119 124 casa::LogIO os_ ; 120 125
Note:
See TracChangeset
for help on using the changeset viewer.