Ignore:
Timestamp:
08/01/11 15:08:42 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

gettimeofday_sec() is defined in MathUtil?.h instead to define
in each class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MSWriter.cpp

    r2244 r2258  
    3838#include "STMolecules.h"
    3939#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
    4345
    4446using namespace casa ;
     
    4648
    4749namespace 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// }
    5456
    5557MSWriter::MSWriter(CountedPtr<Scantable> stable)
     
    8183{
    8284  os_.origin( LogOrigin( "MSWriter", "write()", WHERE ) ) ;
    83 //   double startSec = gettimeofday_sec() ;
     85//   double startSec = mathutil::gettimeofday_sec() ;
    8486//   os_ << "start MSWriter::write() startSec=" << startSec << LogIO::POST ;
    8587
     
    473475  }
    474476
    475 //   double endSec = gettimeofday_sec() ;
     477//   double endSec = mathutil::gettimeofday_sec() ;
    476478//   os_ << "end MSWriter::write() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    477479
     
    482484{
    483485//   os_.origin( LogOrigin( "MSWriter", "init()", WHERE ) ) ;
    484 //   double startSec = gettimeofday_sec() ;
     486//   double startSec = mathutil::gettimeofday_sec() ;
    485487//   os_ << "start MSWriter::init() startSec=" << startSec << LogIO::POST ;
    486488 
     
    574576  }
    575577
    576 //   double endSec = gettimeofday_sec() ;
     578//   double endSec = mathutil::gettimeofday_sec() ;
    577579//   os_ << "end MSWriter::init() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    578580}
     
    581583{
    582584//   os_.origin( LogOrigin( "MSWriter", "setupMS()", WHERE ) ) ;
    583 //   double startSec = gettimeofday_sec() ;
     585//   double startSec = mathutil::gettimeofday_sec() ;
    584586//   os_ << "start MSWriter::setupMS() startSec=" << startSec << LogIO::POST ;
    585587 
     
    689691  mstable_->initRefs() ;
    690692
    691 //   double endSec = gettimeofday_sec() ;
     693//   double endSec = mathutil::gettimeofday_sec() ;
    692694//   os_ << "end MSWriter::setupMS() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    693695}
     
    695697void MSWriter::fillObservation()
    696698{
    697 //   double startSec = gettimeofday_sec() ;
     699//   double startSec = mathutil::gettimeofday_sec() ;
    698700//   os_ << "start MSWriter::fillObservation() startSec=" << startSec << LogIO::POST ;
    699701
     
    724726  msObsCols.timeRangeMeas().put( 0, trange ) ;
    725727
    726 //   double endSec = gettimeofday_sec() ;
     728//   double endSec = mathutil::gettimeofday_sec() ;
    727729//   os_ << "end MSWriter::fillObservation() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    728730}
     
    730732void MSWriter::fillAntenna()
    731733{
    732 //   double startSec = gettimeofday_sec() ;
     734//   double startSec = mathutil::gettimeofday_sec() ;
    733735//   os_ << "start MSWriter::fillAntenna() startSec=" << startSec << LogIO::POST ;
    734736
     
    769771  msAntCols.dishDiameterQuant().put( 0, Quantity( diameter, "m" ) ) ;
    770772
    771 //   double endSec = gettimeofday_sec() ;
     773//   double endSec = mathutil::gettimeofday_sec() ;
    772774//   os_ << "end MSWriter::fillAntenna() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    773775}
     
    775777void MSWriter::fillProcessor()
    776778{
    777 //   double startSec = gettimeofday_sec() ;
     779//   double startSec = mathutil::gettimeofday_sec() ;
    778780//   os_ << "start MSWriter::fillProcessor() startSec=" << startSec << LogIO::POST ;
    779781 
     
    782784  msProc.addRow( 1, True ) ;
    783785
    784 //   double endSec = gettimeofday_sec() ;
     786//   double endSec = mathutil::gettimeofday_sec() ;
    785787//   os_ << "end MSWriter::fillProcessor() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    786788}
     
    788790void MSWriter::fillSource()
    789791{
    790 //   double startSec = gettimeofday_sec() ;
     792//   double startSec = mathutil::gettimeofday_sec() ;
    791793//   os_ << "start MSWriter::fillSource() startSec=" << startSec << LogIO::POST ;
    792794 
     
    926928  }
    927929
    928 //   double endSec = gettimeofday_sec() ;
     930//   double endSec = mathutil::gettimeofday_sec() ;
    929931//   os_ << "end MSWriter::fillSource() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    930932}
     
    932934void MSWriter::fillWeather()
    933935{
    934 //   double startSec = gettimeofday_sec() ;
     936//   double startSec = mathutil::gettimeofday_sec() ;
    935937//   os_ << "start MSWriter::fillWeather() startSec=" << startSec << LogIO::POST ;
    936938
     
    984986  mswCols.interval().putColumn( intervalArr ) ;
    985987
    986 //   double endSec = gettimeofday_sec() ;
     988//   double endSec = mathutil::gettimeofday_sec() ;
    987989//   os_ << "end MSWriter::fillWeather() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    988990}
     
    990992void MSWriter::fillSysCal()
    991993{
    992 //   double startSec = gettimeofday_sec() ;
     994//   double startSec = mathutil::gettimeofday_sec() ;
    993995//   os_ << "start MSWriter::fillSysCal() startSec=" << startSec << LogIO::POST ;
    994996
     
    10511053  ROTableColumn ifnoCol( tab, "IFNO" ) ;
    10521054  for ( uInt irow = 0 ; irow < nrow ; irow++ ) {
    1053 //     double t1 = gettimeofday_sec() ;
     1055//     double t1 = mathutil::gettimeofday_sec() ;
    10541056    Vector<uInt> ids = tcalIdRec_.asArrayuInt( irow ) ;
    10551057//     os_ << "ids = " << ids << LogIO::POST ;
     
    11871189    row.put( mssc.nrow()-1 ) ;
    11881190
    1189 //     double t2 = gettimeofday_sec() ;
     1191//     double t2 = mathutil::gettimeofday_sec() ;
    11901192//     os_ << irow << "th loop elapsed time = " << t2-t1 << "sec" << LogIO::POST ;
    11911193  }
    11921194 
    1193 //   double endSec = gettimeofday_sec() ;
     1195//   double endSec = mathutil::gettimeofday_sec() ;
    11941196//   os_ << "end MSWriter::fillSysCal() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    11951197}
     
    11971199void MSWriter::addFeed( Int id )
    11981200{
    1199 //   double startSec = gettimeofday_sec() ;
     1201//   double startSec = mathutil::gettimeofday_sec() ;
    12001202//   os_ << "start MSWriter::addFeed() startSec=" << startSec << LogIO::POST ;
    12011203
     
    12351237  msFeedCols.polResponse().put( nrow-1, polResponse ) ;
    12361238
    1237 //   double endSec = gettimeofday_sec() ;
     1239//   double endSec = mathutil::gettimeofday_sec() ;
    12381240//   os_ << "end MSWriter::addFeed() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    12391241}
     
    12411243void MSWriter::addSpectralWindow( Int spwid, Int freqid )
    12421244{
    1243 //   double startSec = gettimeofday_sec() ;
     1245//   double startSec = mathutil::gettimeofday_sec() ;
    12441246//   os_ << "start MSWriter::addSpectralWindow() startSec=" << startSec << LogIO::POST ;
    12451247 
     
    12941296  msSpwCols.chanFreq().put( spwid, sharedDoubleArr ) ;
    12951297
    1296 //   double endSec = gettimeofday_sec() ;
     1298//   double endSec = mathutil::gettimeofday_sec() ;
    12971299//   os_ << "end MSWriter::addSpectralWindow() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    12981300}
     
    13001302void MSWriter::addField( Int fid, String fieldname, String srcname, Double t, Vector<Double> rate )
    13011303{
    1302 //   double startSec = gettimeofday_sec() ;
     1304//   double startSec = mathutil::gettimeofday_sec() ;
    13031305//   os_ << "start MSWriter::addField() startSec=" << startSec << LogIO::POST ;
    13041306 
     
    13401342  msFieldCols.sourceId().put( fid, srcId ) ;
    13411343
    1342 //   double endSec = gettimeofday_sec() ;
     1344//   double endSec = mathutil::gettimeofday_sec() ;
    13431345//   os_ << "end MSWriter::addField() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    13441346}
     
    13461348void MSWriter::addPointing( String &name, Double &me, Double &interval, Matrix<Double> &dir )
    13471349{
    1348 //   double startSec = gettimeofday_sec() ;
     1350//   double startSec = mathutil::gettimeofday_sec() ;
    13491351//   os_ << "start MSWriter::addPointing() startSec=" << startSec << LogIO::POST ;
    13501352 
     
    13791381  row.put( nrow ) ;
    13801382
    1381 //   double endSec = gettimeofday_sec() ;
     1383//   double endSec = mathutil::gettimeofday_sec() ;
    13821384//   os_ << "end MSWriter::addPointing() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    13831385}
     
    13851387Int MSWriter::addPolarization( Vector<Int> polnos )
    13861388{
    1387 //   double startSec = gettimeofday_sec() ;
     1389//   double startSec = mathutil::gettimeofday_sec() ;
    13881390//   os_ << "start MSWriter::addPolarization() startSec=" << startSec << LogIO::POST ;
    13891391
     
    14441446  }
    14451447
    1446 //   double endSec = gettimeofday_sec() ;
     1448//   double endSec = mathutil::gettimeofday_sec() ;
    14471449//   os_ << "end MSWriter::addPolarization() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    14481450
     
    14521454Int MSWriter::addDataDescription( Int polid, Int spwid )
    14531455{
    1454 //   double startSec = gettimeofday_sec() ;
     1456//   double startSec = mathutil::gettimeofday_sec() ;
    14551457//   os_ << "start MSWriter::addDataDescription() startSec=" << startSec << LogIO::POST ;
    14561458
     
    14821484  }
    14831485
    1484 //   double endSec = gettimeofday_sec() ;
     1486//   double endSec = mathutil::gettimeofday_sec() ;
    14851487//   os_ << "end MSWriter::addDataDescription() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    14861488
     
    14901492Int MSWriter::addState( Int st, Int &subscan )
    14911493{
    1492 //   double startSec = gettimeofday_sec() ;
     1494//   double startSec = mathutil::gettimeofday_sec() ;
    14931495//   os_ << "start MSWriter::addState() startSec=" << startSec << LogIO::POST ;
    14941496
     
    15371539  subscan++ ;
    15381540
    1539 //   double endSec = gettimeofday_sec() ;
     1541//   double endSec = mathutil::gettimeofday_sec() ;
    15401542//   os_ << "end MSWriter::addState() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    15411543
     
    15451547Vector<Int> MSWriter::toCorrType( Vector<Int> polnos )
    15461548{
    1547 //   double startSec = gettimeofday_sec() ;
     1549//   double startSec = mathutil::gettimeofday_sec() ;
    15481550//   os_ << "start MSWriter::toCorrType() startSec=" << startSec << LogIO::POST ;
    15491551
     
    16321634  }
    16331635
    1634 //   double endSec = gettimeofday_sec() ;
     1636//   double endSec = mathutil::gettimeofday_sec() ;
    16351637//   os_ << "end MSWriter::toCorrType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    16361638
     
    16401642void MSWriter::getValidTimeRange( Double &me, Double &interval, Table &tab )
    16411643{
    1642 //   double startSec = gettimeofday_sec() ;
     1644//   double startSec = mathutil::gettimeofday_sec() ;
    16431645//   os_ << "start MSWriter::getVaridTimeRange() startSec=" << startSec << LogIO::POST ;
    16441646
     
    16581660  interval = ( maxTime - minTime ) * 86400.0 ;
    16591661
    1660 //   double endSec = gettimeofday_sec() ;
     1662//   double endSec = mathutil::gettimeofday_sec() ;
    16611663//   os_ << "end MSWriter::getValidTimeRange() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    16621664}
     
    16641666void MSWriter::getValidTimeRange( Double &me, Double &interval, Vector<Double> &atime, Vector<Double> &ainterval )
    16651667{
    1666 //   double startSec = gettimeofday_sec() ;
     1668//   double startSec = mathutil::gettimeofday_sec() ;
    16671669//   os_ << "start MSWriter::getVaridTimeRange() startSec=" << startSec << LogIO::POST ;
    16681670
     
    16801682  interval = ( maxTime - minTime ) * 86400.0 + mean( ainterval ) ;
    16811683
    1682 //   double endSec = gettimeofday_sec() ;
     1684//   double endSec = mathutil::gettimeofday_sec() ;
    16831685//   os_ << "end MSWriter::getValidTimeRange() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    16841686}
     
    16871689void MSWriter::queryType( Int type, String &stype, Bool &b, Double &t, Double &l )
    16881690{
    1689 //   double startSec = gettimeofday_sec() ;
     1691//   double startSec = mathutil::gettimeofday_sec() ;
    16901692//   os_ << "start MSWriter::queryType() startSec=" << startSec << LogIO::POST ;
    16911693
     
    19161918  }
    19171919
    1918 //   double endSec = gettimeofday_sec() ;
     1920//   double endSec = mathutil::gettimeofday_sec() ;
    19191921//   os_ << "end MSWriter::queryType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    19201922}
Note: See TracChangeset for help on using the changeset viewer.