Changeset 2258 for trunk/src/MSWriter.cpp
- Timestamp:
- 08/01/11 15:08:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.