- Timestamp:
- 08/01/11 15:08:42 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 6 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 } -
trunk/src/MSFiller.h
r2246 r2258 117 117 118 118 // tool for HPC 119 double gettimeofday_sec() ;119 // double gettimeofday_sec() ; 120 120 121 121 // get frequency frame -
trunk/src/MSWriter.cpp
r2244 r2258 38 38 #include "STMolecules.h" 39 39 #include "STTcal.h" 40 41 #include <ctime> 42 #include <sys/time.h> 40 #include "MathUtils.h" 41 42 // #include <ctime> 43 // #include <sys/time.h> 44 43 45 44 46 using namespace casa ; … … 46 48 47 49 namespace asap { 48 double MSWriter::gettimeofday_sec()49 {50 struct timeval tv ;51 gettimeofday( &tv, NULL ) ;52 return tv.tv_sec + (double)tv.tv_usec*1.0e-6 ;53 }50 // double MSWriter::gettimeofday_sec() 51 // { 52 // struct timeval tv ; 53 // gettimeofday( &tv, NULL ) ; 54 // return tv.tv_sec + (double)tv.tv_usec*1.0e-6 ; 55 // } 54 56 55 57 MSWriter::MSWriter(CountedPtr<Scantable> stable) … … 81 83 { 82 84 os_.origin( LogOrigin( "MSWriter", "write()", WHERE ) ) ; 83 // double startSec = gettimeofday_sec() ;85 // double startSec = mathutil::gettimeofday_sec() ; 84 86 // os_ << "start MSWriter::write() startSec=" << startSec << LogIO::POST ; 85 87 … … 473 475 } 474 476 475 // double endSec = gettimeofday_sec() ;477 // double endSec = mathutil::gettimeofday_sec() ; 476 478 // os_ << "end MSWriter::write() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 477 479 … … 482 484 { 483 485 // os_.origin( LogOrigin( "MSWriter", "init()", WHERE ) ) ; 484 // double startSec = gettimeofday_sec() ;486 // double startSec = mathutil::gettimeofday_sec() ; 485 487 // os_ << "start MSWriter::init() startSec=" << startSec << LogIO::POST ; 486 488 … … 574 576 } 575 577 576 // double endSec = gettimeofday_sec() ;578 // double endSec = mathutil::gettimeofday_sec() ; 577 579 // os_ << "end MSWriter::init() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 578 580 } … … 581 583 { 582 584 // os_.origin( LogOrigin( "MSWriter", "setupMS()", WHERE ) ) ; 583 // double startSec = gettimeofday_sec() ;585 // double startSec = mathutil::gettimeofday_sec() ; 584 586 // os_ << "start MSWriter::setupMS() startSec=" << startSec << LogIO::POST ; 585 587 … … 689 691 mstable_->initRefs() ; 690 692 691 // double endSec = gettimeofday_sec() ;693 // double endSec = mathutil::gettimeofday_sec() ; 692 694 // os_ << "end MSWriter::setupMS() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 693 695 } … … 695 697 void MSWriter::fillObservation() 696 698 { 697 // double startSec = gettimeofday_sec() ;699 // double startSec = mathutil::gettimeofday_sec() ; 698 700 // os_ << "start MSWriter::fillObservation() startSec=" << startSec << LogIO::POST ; 699 701 … … 724 726 msObsCols.timeRangeMeas().put( 0, trange ) ; 725 727 726 // double endSec = gettimeofday_sec() ;728 // double endSec = mathutil::gettimeofday_sec() ; 727 729 // os_ << "end MSWriter::fillObservation() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 728 730 } … … 730 732 void MSWriter::fillAntenna() 731 733 { 732 // double startSec = gettimeofday_sec() ;734 // double startSec = mathutil::gettimeofday_sec() ; 733 735 // os_ << "start MSWriter::fillAntenna() startSec=" << startSec << LogIO::POST ; 734 736 … … 769 771 msAntCols.dishDiameterQuant().put( 0, Quantity( diameter, "m" ) ) ; 770 772 771 // double endSec = gettimeofday_sec() ;773 // double endSec = mathutil::gettimeofday_sec() ; 772 774 // os_ << "end MSWriter::fillAntenna() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 773 775 } … … 775 777 void MSWriter::fillProcessor() 776 778 { 777 // double startSec = gettimeofday_sec() ;779 // double startSec = mathutil::gettimeofday_sec() ; 778 780 // os_ << "start MSWriter::fillProcessor() startSec=" << startSec << LogIO::POST ; 779 781 … … 782 784 msProc.addRow( 1, True ) ; 783 785 784 // double endSec = gettimeofday_sec() ;786 // double endSec = mathutil::gettimeofday_sec() ; 785 787 // os_ << "end MSWriter::fillProcessor() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 786 788 } … … 788 790 void MSWriter::fillSource() 789 791 { 790 // double startSec = gettimeofday_sec() ;792 // double startSec = mathutil::gettimeofday_sec() ; 791 793 // os_ << "start MSWriter::fillSource() startSec=" << startSec << LogIO::POST ; 792 794 … … 926 928 } 927 929 928 // double endSec = gettimeofday_sec() ;930 // double endSec = mathutil::gettimeofday_sec() ; 929 931 // os_ << "end MSWriter::fillSource() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 930 932 } … … 932 934 void MSWriter::fillWeather() 933 935 { 934 // double startSec = gettimeofday_sec() ;936 // double startSec = mathutil::gettimeofday_sec() ; 935 937 // os_ << "start MSWriter::fillWeather() startSec=" << startSec << LogIO::POST ; 936 938 … … 984 986 mswCols.interval().putColumn( intervalArr ) ; 985 987 986 // double endSec = gettimeofday_sec() ;988 // double endSec = mathutil::gettimeofday_sec() ; 987 989 // os_ << "end MSWriter::fillWeather() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 988 990 } … … 990 992 void MSWriter::fillSysCal() 991 993 { 992 // double startSec = gettimeofday_sec() ;994 // double startSec = mathutil::gettimeofday_sec() ; 993 995 // os_ << "start MSWriter::fillSysCal() startSec=" << startSec << LogIO::POST ; 994 996 … … 1051 1053 ROTableColumn ifnoCol( tab, "IFNO" ) ; 1052 1054 for ( uInt irow = 0 ; irow < nrow ; irow++ ) { 1053 // double t1 = gettimeofday_sec() ;1055 // double t1 = mathutil::gettimeofday_sec() ; 1054 1056 Vector<uInt> ids = tcalIdRec_.asArrayuInt( irow ) ; 1055 1057 // os_ << "ids = " << ids << LogIO::POST ; … … 1187 1189 row.put( mssc.nrow()-1 ) ; 1188 1190 1189 // double t2 = gettimeofday_sec() ;1191 // double t2 = mathutil::gettimeofday_sec() ; 1190 1192 // os_ << irow << "th loop elapsed time = " << t2-t1 << "sec" << LogIO::POST ; 1191 1193 } 1192 1194 1193 // double endSec = gettimeofday_sec() ;1195 // double endSec = mathutil::gettimeofday_sec() ; 1194 1196 // os_ << "end MSWriter::fillSysCal() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1195 1197 } … … 1197 1199 void MSWriter::addFeed( Int id ) 1198 1200 { 1199 // double startSec = gettimeofday_sec() ;1201 // double startSec = mathutil::gettimeofday_sec() ; 1200 1202 // os_ << "start MSWriter::addFeed() startSec=" << startSec << LogIO::POST ; 1201 1203 … … 1235 1237 msFeedCols.polResponse().put( nrow-1, polResponse ) ; 1236 1238 1237 // double endSec = gettimeofday_sec() ;1239 // double endSec = mathutil::gettimeofday_sec() ; 1238 1240 // os_ << "end MSWriter::addFeed() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1239 1241 } … … 1241 1243 void MSWriter::addSpectralWindow( Int spwid, Int freqid ) 1242 1244 { 1243 // double startSec = gettimeofday_sec() ;1245 // double startSec = mathutil::gettimeofday_sec() ; 1244 1246 // os_ << "start MSWriter::addSpectralWindow() startSec=" << startSec << LogIO::POST ; 1245 1247 … … 1294 1296 msSpwCols.chanFreq().put( spwid, sharedDoubleArr ) ; 1295 1297 1296 // double endSec = gettimeofday_sec() ;1298 // double endSec = mathutil::gettimeofday_sec() ; 1297 1299 // os_ << "end MSWriter::addSpectralWindow() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1298 1300 } … … 1300 1302 void MSWriter::addField( Int fid, String fieldname, String srcname, Double t, Vector<Double> rate ) 1301 1303 { 1302 // double startSec = gettimeofday_sec() ;1304 // double startSec = mathutil::gettimeofday_sec() ; 1303 1305 // os_ << "start MSWriter::addField() startSec=" << startSec << LogIO::POST ; 1304 1306 … … 1340 1342 msFieldCols.sourceId().put( fid, srcId ) ; 1341 1343 1342 // double endSec = gettimeofday_sec() ;1344 // double endSec = mathutil::gettimeofday_sec() ; 1343 1345 // os_ << "end MSWriter::addField() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1344 1346 } … … 1346 1348 void MSWriter::addPointing( String &name, Double &me, Double &interval, Matrix<Double> &dir ) 1347 1349 { 1348 // double startSec = gettimeofday_sec() ;1350 // double startSec = mathutil::gettimeofday_sec() ; 1349 1351 // os_ << "start MSWriter::addPointing() startSec=" << startSec << LogIO::POST ; 1350 1352 … … 1379 1381 row.put( nrow ) ; 1380 1382 1381 // double endSec = gettimeofday_sec() ;1383 // double endSec = mathutil::gettimeofday_sec() ; 1382 1384 // os_ << "end MSWriter::addPointing() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1383 1385 } … … 1385 1387 Int MSWriter::addPolarization( Vector<Int> polnos ) 1386 1388 { 1387 // double startSec = gettimeofday_sec() ;1389 // double startSec = mathutil::gettimeofday_sec() ; 1388 1390 // os_ << "start MSWriter::addPolarization() startSec=" << startSec << LogIO::POST ; 1389 1391 … … 1444 1446 } 1445 1447 1446 // double endSec = gettimeofday_sec() ;1448 // double endSec = mathutil::gettimeofday_sec() ; 1447 1449 // os_ << "end MSWriter::addPolarization() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1448 1450 … … 1452 1454 Int MSWriter::addDataDescription( Int polid, Int spwid ) 1453 1455 { 1454 // double startSec = gettimeofday_sec() ;1456 // double startSec = mathutil::gettimeofday_sec() ; 1455 1457 // os_ << "start MSWriter::addDataDescription() startSec=" << startSec << LogIO::POST ; 1456 1458 … … 1482 1484 } 1483 1485 1484 // double endSec = gettimeofday_sec() ;1486 // double endSec = mathutil::gettimeofday_sec() ; 1485 1487 // os_ << "end MSWriter::addDataDescription() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1486 1488 … … 1490 1492 Int MSWriter::addState( Int st, Int &subscan ) 1491 1493 { 1492 // double startSec = gettimeofday_sec() ;1494 // double startSec = mathutil::gettimeofday_sec() ; 1493 1495 // os_ << "start MSWriter::addState() startSec=" << startSec << LogIO::POST ; 1494 1496 … … 1537 1539 subscan++ ; 1538 1540 1539 // double endSec = gettimeofday_sec() ;1541 // double endSec = mathutil::gettimeofday_sec() ; 1540 1542 // os_ << "end MSWriter::addState() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1541 1543 … … 1545 1547 Vector<Int> MSWriter::toCorrType( Vector<Int> polnos ) 1546 1548 { 1547 // double startSec = gettimeofday_sec() ;1549 // double startSec = mathutil::gettimeofday_sec() ; 1548 1550 // os_ << "start MSWriter::toCorrType() startSec=" << startSec << LogIO::POST ; 1549 1551 … … 1632 1634 } 1633 1635 1634 // double endSec = gettimeofday_sec() ;1636 // double endSec = mathutil::gettimeofday_sec() ; 1635 1637 // os_ << "end MSWriter::toCorrType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1636 1638 … … 1640 1642 void MSWriter::getValidTimeRange( Double &me, Double &interval, Table &tab ) 1641 1643 { 1642 // double startSec = gettimeofday_sec() ;1644 // double startSec = mathutil::gettimeofday_sec() ; 1643 1645 // os_ << "start MSWriter::getVaridTimeRange() startSec=" << startSec << LogIO::POST ; 1644 1646 … … 1658 1660 interval = ( maxTime - minTime ) * 86400.0 ; 1659 1661 1660 // double endSec = gettimeofday_sec() ;1662 // double endSec = mathutil::gettimeofday_sec() ; 1661 1663 // os_ << "end MSWriter::getValidTimeRange() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1662 1664 } … … 1664 1666 void MSWriter::getValidTimeRange( Double &me, Double &interval, Vector<Double> &atime, Vector<Double> &ainterval ) 1665 1667 { 1666 // double startSec = gettimeofday_sec() ;1668 // double startSec = mathutil::gettimeofday_sec() ; 1667 1669 // os_ << "start MSWriter::getVaridTimeRange() startSec=" << startSec << LogIO::POST ; 1668 1670 … … 1680 1682 interval = ( maxTime - minTime ) * 86400.0 + mean( ainterval ) ; 1681 1683 1682 // double endSec = gettimeofday_sec() ;1684 // double endSec = mathutil::gettimeofday_sec() ; 1683 1685 // os_ << "end MSWriter::getValidTimeRange() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1684 1686 } … … 1687 1689 void MSWriter::queryType( Int type, String &stype, Bool &b, Double &t, Double &l ) 1688 1690 { 1689 // double startSec = gettimeofday_sec() ;1691 // double startSec = mathutil::gettimeofday_sec() ; 1690 1692 // os_ << "start MSWriter::queryType() startSec=" << startSec << LogIO::POST ; 1691 1693 … … 1916 1918 } 1917 1919 1918 // double endSec = gettimeofday_sec() ;1920 // double endSec = mathutil::gettimeofday_sec() ; 1919 1921 // os_ << "end MSWriter::queryType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ; 1920 1922 } -
trunk/src/MSWriter.h
r2104 r2258 88 88 89 89 // tool for HPC 90 double gettimeofday_sec() ;90 // double gettimeofday_sec() ; 91 91 92 92 casa::CountedPtr<Scantable> table_ ; -
trunk/src/MathUtils.cpp
r2186 r2258 44 44 #include <scimath/Mathematics/AutoDiff.h> 45 45 46 #include <ctime> 47 #include <sys/time.h> 46 48 47 49 #include "MathUtils.h" … … 287 289 fend = -1; 288 290 } 289 } 291 292 } 293 294 double mathutil::gettimeofday_sec() 295 { 296 struct timeval tv ; 297 gettimeofday( &tv, NULL ) ; 298 return tv.tv_sec + (double)tv.tv_usec*1.0e-6 ; 299 } -
trunk/src/MathUtils.h
r2186 r2258 109 109 std::vector<bool>& mask); 110 110 111 /** 112 * tool to record current time stamp 113 **/ 114 double gettimeofday_sec() ; 115 111 116 } 112 117
Note:
See TracChangeset
for help on using the changeset viewer.