Changeset 2258 for trunk/src/MSFiller.cpp
- Timestamp:
- 08/01/11 15:08:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MSFiller.cpp
r2257 r2258 51 51 #include "STHeader.h" 52 52 53 #include <ctime> 54 #include <sys/time.h> 53 // #include <ctime> 54 // #include <sys/time.h> 55 56 #include "MathUtils.h" 55 57 56 58 using namespace casa ; … … 58 60 59 61 namespace asap { 60 double MSFiller::gettimeofday_sec()61 {62 struct timeval tv ;63 gettimeofday( &tv, NULL ) ;64 return tv.tv_sec + (double)tv.tv_usec*1.0e-6 ;65 }62 // double MSFiller::gettimeofday_sec() 63 // { 64 // struct timeval tv ; 65 // gettimeofday( &tv, NULL ) ; 66 // return tv.tv_sec + (double)tv.tv_usec*1.0e-6 ; 67 // } 66 68 67 69 MSFiller::MSFiller( casa::CountedPtr<Scantable> stable ) … … 95 97 { 96 98 os_.origin( LogOrigin( "MSFiller", "open()", WHERE ) ) ; 97 //double startSec = gettimeofday_sec() ;99 //double startSec = mathutil::gettimeofday_sec() ; 98 100 //os_ << "start MSFiller::open() startsec=" << startSec << LogIO::POST ; 99 101 //os_ << " filename = " << filename << endl ; … … 147 149 isData_ = mstable_.tableDesc().isColumn( "DATA" ) ; 148 150 149 //double endSec = gettimeofday_sec() ;151 //double endSec = mathutil::gettimeofday_sec() ; 150 152 //os_ << "end MSFiller::open() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 151 153 return true ; … … 155 157 { 156 158 os_.origin( LogOrigin( "MSFiller", "fill()", WHERE ) ) ; 157 //double startSec = gettimeofday_sec() ;159 //double startSec = mathutil::gettimeofday_sec() ; 158 160 //os_ << "start MSFiller::fill() startSec=" << startSec << LogIO::POST ; 159 161 160 //double time0 = gettimeofday_sec() ;162 //double time0 = mathutil::gettimeofday_sec() ; 161 163 //os_ << "start init fill: " << time0 << LogIO::POST ; 162 164 … … 280 282 String telescopeName = "" ; 281 283 282 //double time1 = gettimeofday_sec() ;284 //double time1 = mathutil::gettimeofday_sec() ; 283 285 //os_ << "end init fill: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 284 286 … … 331 333 TableIterator iter0( mstable_, "OBSERVATION_ID" ) ; 332 334 while( !iter0.pastEnd() ) { 333 //time0 = gettimeofday_sec() ;335 //time0 = mathutil::gettimeofday_sec() ; 334 336 //os_ << "start 0th iteration: " << time0 << LogIO::POST ; 335 337 Table t0 = iter0.table() ; … … 351 353 } 352 354 Int nbeam = 0 ; 353 //time1 = gettimeofday_sec() ;355 //time1 = mathutil::gettimeofday_sec() ; 354 356 //os_ << "end 0th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 355 357 // … … 358 360 TableIterator iter1( t0, "FEED1" ) ; 359 361 while( !iter1.pastEnd() ) { 360 //time0 = gettimeofday_sec() ;362 //time0 = mathutil::gettimeofday_sec() ; 361 363 //os_ << "start 1st iteration: " << time0 << LogIO::POST ; 362 364 Table t1 = iter1.table() ; … … 371 373 *focusidRF = 0 ; 372 374 373 //time1 = gettimeofday_sec() ;375 //time1 = mathutil::gettimeofday_sec() ; 374 376 //os_ << "end 1st iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 375 377 // … … 378 380 TableIterator iter2( t1, "FIELD_ID" ) ; 379 381 while( !iter2.pastEnd() ) { 380 //time0 = gettimeofday_sec() ;382 //time0 = mathutil::gettimeofday_sec() ; 381 383 //os_ << "start 2nd iteration: " << time0 << LogIO::POST ; 382 384 Table t2 = iter2.table() ; … … 393 395 394 396 395 //time1 = gettimeofday_sec() ;397 //time1 = mathutil::gettimeofday_sec() ; 396 398 //os_ << "end 2nd iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 397 399 // … … 400 402 TableIterator iter3( t2, "DATA_DESC_ID" ) ; 401 403 while( !iter3.pastEnd() ) { 402 //time0 = gettimeofday_sec() ;404 //time0 = mathutil::gettimeofday_sec() ; 403 405 //os_ << "start 3rd iteration: " << time0 << LogIO::POST ; 404 406 Table t3 = iter3.table() ; … … 514 516 if ( !iswvr && sdh.poltype == "" ) sdh.poltype = getPolType( corrtype[0] ) ; 515 517 516 //time1 = gettimeofday_sec() ;518 //time1 = mathutil::gettimeofday_sec() ; 517 519 //os_ << "end 3rd iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 518 520 // … … 521 523 TableIterator iter4( t3, "SCAN_NUMBER" ) ; 522 524 while( !iter4.pastEnd() ) { 523 //time0 = gettimeofday_sec() ;525 //time0 = mathutil::gettimeofday_sec() ; 524 526 //os_ << "start 4th iteration: " << time0 << LogIO::POST ; 525 527 Table t4 = iter4.table() ; … … 531 533 uInt cycle = 0 ; 532 534 533 //time1 = gettimeofday_sec() ;535 //time1 = mathutil::gettimeofday_sec() ; 534 536 //os_ << "end 4th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 535 537 // … … 538 540 TableIterator iter5( t4, "STATE_ID" ) ; 539 541 while( !iter5.pastEnd() ) { 540 //time0 = gettimeofday_sec() ;542 //time0 = mathutil::gettimeofday_sec() ; 541 543 //os_ << "start 5th iteration: " << time0 << LogIO::POST ; 542 544 Table t5 = iter5.table() ; … … 546 548 547 549 Int nrow = t5.nrow() ; 548 //time1 = gettimeofday_sec() ;550 //time1 = mathutil::gettimeofday_sec() ; 549 551 //os_ << "end 5th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 550 552 … … 680 682 } 681 683 682 //time1 = gettimeofday_sec() ;684 //time1 = mathutil::gettimeofday_sec() ; 683 685 //os_ << "end 5th iteration: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 684 686 … … 770 772 } 771 773 772 //double endSec = gettimeofday_sec() ;774 //double endSec = mathutil::gettimeofday_sec() ; 773 775 //os_ << "end MSFiller::fill() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 774 776 } … … 784 786 Int MSFiller::getSrcType( Int stateId, boost::object_pool<ROTableColumn> *tpool ) 785 787 { 786 //double startSec = gettimeofday_sec() ;788 //double startSec = mathutil::gettimeofday_sec() ; 787 789 //os_ << "start MSFiller::getSrcType() startSec=" << startSec << LogIO::POST ; 788 790 … … 940 942 941 943 //os_ << "srcType = " << srcType << LogIO::POST ; 942 //double endSec = gettimeofday_sec() ;944 //double endSec = mathutil::gettimeofday_sec() ; 943 945 //os_ << "end MSFiller::getSrcType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 944 946 return srcType ; … … 948 950 Block<uInt> MSFiller::getPolNo( Int corrType ) 949 951 { 950 //double startSec = gettimeofday_sec() ;952 //double startSec = mathutil::gettimeofday_sec() ; 951 953 //os_ << "start MSFiller::getPolNo() startSec=" << startSec << LogIO::POST ; 952 954 Block<uInt> polno( 1 ) ; … … 979 981 } 980 982 //os_ << "polno = " << polno << LogIO::POST ; 981 //double endSec = gettimeofday_sec() ;983 //double endSec = mathutil::gettimeofday_sec() ; 982 984 //os_ << "end MSFiller::getPolNo() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 983 985 … … 987 989 String MSFiller::getPolType( Int corrType ) 988 990 { 989 //double startSec = gettimeofday_sec() ;991 //double startSec = mathutil::gettimeofday_sec() ; 990 992 //os_ << "start MSFiller::getPolType() startSec=" << startSec << LogIO::POST ; 991 993 String poltype = "" ; … … 1000 1002 poltype = "linpol" ; 1001 1003 1002 //double endSec = gettimeofday_sec() ;1004 //double endSec = mathutil::gettimeofday_sec() ; 1003 1005 //os_ << "end MSFiller::getPolType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1004 1006 return poltype ; … … 1007 1009 void MSFiller::fillWeather() 1008 1010 { 1009 //double startSec = gettimeofday_sec() ;1011 //double startSec = mathutil::gettimeofday_sec() ; 1010 1012 //os_ << "start MSFiller::fillWeather() startSec=" << startSec << LogIO::POST ; 1011 1013 … … 1148 1150 } 1149 1151 //os_ << "mwTime[0] = " << mwTime_[0] << " mwInterval[0] = " << mwInterval_[0] << LogIO::POST ; 1150 //double endSec = gettimeofday_sec() ;1152 //double endSec = mathutil::gettimeofday_sec() ; 1151 1153 //os_ << "end MSFiller::fillWeather() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1152 1154 } … … 1154 1156 void MSFiller::fillFocus() 1155 1157 { 1156 //double startSec = gettimeofday_sec() ;1158 //double startSec = mathutil::gettimeofday_sec() ; 1157 1159 //os_ << "start MSFiller::fillFocus() startSec=" << startSec << LogIO::POST ; 1158 1160 // tentative 1159 1161 table_->focus().addEntry( 0.0, 0.0, 0.0, 0.0 ) ; 1160 //double endSec = gettimeofday_sec() ;1162 //double endSec = mathutil::gettimeofday_sec() ; 1161 1163 //os_ << "end MSFiller::fillFocus() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1162 1164 } … … 1164 1166 void MSFiller::fillTcal( boost::object_pool<ROTableColumn> *tpoolr ) 1165 1167 { 1166 //double startSec = gettimeofday_sec() ;1168 //double startSec = mathutil::gettimeofday_sec() ; 1167 1169 //os_ << "start MSFiller::fillTcal() startSec=" << startSec << LogIO::POST ; 1168 1170 … … 1268 1270 1269 1271 //tcalrec_.print( std::cout ) ; 1270 //double endSec = gettimeofday_sec() ;1272 //double endSec = mathutil::gettimeofday_sec() ; 1271 1273 //os_ << "end MSFiller::fillTcal() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1272 1274 } … … 1274 1276 uInt MSFiller::getWeatherId( uInt idx, Double wtime ) 1275 1277 { 1276 //double startSec = gettimeofday_sec() ;1278 //double startSec = mathutil::gettimeofday_sec() ; 1277 1279 //os_ << "start MSFiller::getWeatherId() startSec=" << startSec << LogIO::POST ; 1278 1280 uInt nrow = mwTime_.size() ; … … 1312 1314 //os_ << LogIO::WARN << "Couldn't find correct WEATHER_ID for time " << wtime << LogIO::POST ; 1313 1315 1314 //double endSec = gettimeofday_sec() ;1316 //double endSec = mathutil::gettimeofday_sec() ; 1315 1317 //os_ << "end MSFiller::getWeatherId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1316 1318 return wid ; … … 1319 1321 void MSFiller::getSysCalTime( Vector<MEpoch> &scTime, Vector<Double> &scInterval, Block<MEpoch> &tcol, Block<Int> &tidx ) 1320 1322 { 1321 //double startSec = gettimeofday_sec() ;1323 //double startSec = mathutil::gettimeofday_sec() ; 1322 1324 //os_ << "start MSFiller::getSysCalTime() startSec=" << startSec << LogIO::POST ; 1323 1325 … … 1366 1368 } 1367 1369 } 1368 //double endSec = gettimeofday_sec() ;1370 //double endSec = mathutil::gettimeofday_sec() ; 1369 1371 //os_ << "end MSFiller::getSysCalTime() endSec=" << endSec << " (" << endSec-startSec << "sec) scnrow = " << scnrow << " tcol.nelements = " << tcol.nelements() << LogIO::POST ; 1370 1372 return ; … … 1373 1375 Block<uInt> MSFiller::getTcalId( Int fid, Int spwid, MEpoch &t ) 1374 1376 { 1375 //double startSec = gettimeofday_sec() ;1377 //double startSec = mathutil::gettimeofday_sec() ; 1376 1378 //os_ << "start MSFiller::getTcalId() startSec=" << startSec << LogIO::POST ; 1377 1379 //if ( table_->tcal().table().nrow() == 0 ) { … … 1397 1399 tcalids[ipol] = ids[0] + ipol - 1 ; 1398 1400 1399 //double endSec = gettimeofday_sec() ;1401 //double endSec = mathutil::gettimeofday_sec() ; 1400 1402 //os_ << "end MSFiller::getTcalId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1401 1403 return tcalids ; … … 1410 1412 Double t ) 1411 1413 { 1412 //double startSec = gettimeofday_sec() ;1414 //double startSec = mathutil::gettimeofday_sec() ; 1413 1415 //os_ << "start MSFiller::getDirection1() startSec=" << startSec << LogIO::POST ; 1414 //double time0 = gettimeofday_sec() ;1416 //double time0 = mathutil::gettimeofday_sec() ; 1415 1417 //os_ << "start getDirection 1st stage startSec=" << time0 << LogIO::POST ; 1416 1418 // assume that cols is sorted by TIME … … 1445 1447 } 1446 1448 } 1447 //double time1 = gettimeofday_sec() ;1449 //double time1 = mathutil::gettimeofday_sec() ; 1448 1450 //os_ << "end getDirection 1st stage endSec=" << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 1449 1451 // ensure that tcol(idx) < t 1450 1452 //os_ << "tcol(idx) = " << tcol(idx).get("s").getValue() << " t = " << t << " diff = " << tcol(idx).get("s").getValue()-t << endl ; 1451 //time0 = gettimeofday_sec() ;1453 //time0 = mathutil::gettimeofday_sec() ; 1452 1454 //os_ << "start getDirection 2nd stage startSec=" << time0 << LogIO::POST ; 1453 1455 //while( tcol( idx ) * factor > t && idx > 0 ) … … 1477 1479 } 1478 1480 } 1479 //time1 = gettimeofday_sec() ;1481 //time1 = mathutil::gettimeofday_sec() ; 1480 1482 //os_ << "end getDirection 2nd stage endSec=" << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 1481 1483 //os_ << "searched idx = " << idx << LogIO::POST ; 1482 1484 1483 //time0 = gettimeofday_sec() ;1485 //time0 = mathutil::gettimeofday_sec() ; 1484 1486 //os_ << "start getDirection 3rd stage startSec=" << time0 << LogIO::POST ; 1485 1487 //os_ << "dmcol(idx).shape() = " << dmcol(idx).shape() << LogIO::POST ; … … 1522 1524 } 1523 1525 1524 //time1 = gettimeofday_sec() ;1526 //time1 = mathutil::gettimeofday_sec() ; 1525 1527 //os_ << "end getDirection 3rd stage endSec=" << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ; 1526 //double endSec = gettimeofday_sec() ;1528 //double endSec = mathutil::gettimeofday_sec() ; 1527 1529 //os_ << "end MSFiller::getDirection1() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1528 1530 return idx ; … … 1610 1612 Vector<Int> &corrtype ) 1611 1613 { 1612 //double startSec = gettimeofday_sec() ;1614 //double startSec = mathutil::gettimeofday_sec() ; 1613 1615 //os_ << "start MSFiller::reshapeSpectraAndFlagtra() startSec=" << startSec << LogIO::POST ; 1614 1616 if ( isFloatData_ ) { … … 1669 1671 } 1670 1672 } 1671 //double endSec = gettimeofday_sec() ;1673 //double endSec = mathutil::gettimeofday_sec() ; 1672 1674 //os_ << "end MSFiller::reshapeSpectraAndFlagtra() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1673 1675 } … … 1682 1684 MPosition &antpos ) 1683 1685 { 1684 //double startSec = gettimeofday_sec() ;1686 //double startSec = mathutil::gettimeofday_sec() ; 1685 1687 //os_ << "start MSFiller::getDirection2() startSec=" << startSec << LogIO::POST ; 1686 1688 String refString ; … … 1708 1710 srate = 0.0 ; 1709 1711 } 1710 //double endSec = gettimeofday_sec() ;1712 //double endSec = mathutil::gettimeofday_sec() ; 1711 1713 //os_ << "end MSFiller::getDirection2() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1712 1714 return diridx ; … … 1720 1722 Vector<MDirection> &srcdir ) 1721 1723 { 1722 //double startSec = gettimeofday_sec() ;1724 //double startSec = mathutil::gettimeofday_sec() ; 1723 1725 //os_ << "start MSFiller::getSourceDirection() startSec=" << startSec << LogIO::POST ; 1724 1726 Vector<Double> defaultDir = srcdir[0].getAngle( "rad" ).getValue() ; … … 1737 1739 MDirection::Convert toazel( dirType, MDirection::Ref( MDirection::AZELGEO, mf ) ) ; 1738 1740 azel = toazel( defaultDir ).getAngle("rad").getValue() ; 1739 //double endSec = gettimeofday_sec() ;1741 //double endSec = mathutil::gettimeofday_sec() ; 1740 1742 //os_ << "end MSFiller::getSourceDirection() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1741 1743 } … … 1838 1840 boost::object_pool<ROTableColumn> *tpoolr ) 1839 1841 { 1840 //double startSec = gettimeofday_sec() ;1842 //double startSec = mathutil::gettimeofday_sec() ; 1841 1843 //os_ << "start MSFiller::sourceInfo() startSec=" << startSec << LogIO::POST ; 1842 1844 … … 1892 1894 } 1893 1895 1894 //double endSec = gettimeofday_sec() ;1896 //double endSec = mathutil::gettimeofday_sec() ; 1895 1897 //os_ << "end MSFiller::sourceInfo() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1896 1898 } … … 1909 1911 boost::object_pool<ROTableColumn> *tpoolr ) 1910 1912 { 1911 //double startSec = gettimeofday_sec() ;1913 //double startSec = mathutil::gettimeofday_sec() ; 1912 1914 //os_ << "start MSFiller::spectralSetup() startSec=" << startSec << LogIO::POST ; 1913 1915 … … 1971 1973 } 1972 1974 1973 //double endSec = gettimeofday_sec() ;1975 //double endSec = mathutil::gettimeofday_sec() ; 1974 1976 //os_ << "end MSFiller::spectralSetup() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1975 1977 }
Note: See TracChangeset
for help on using the changeset viewer.