Changeset 1990


Ignore:
Timestamp:
02/15/11 14:38:44 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2718

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...

Test version of MSFiller that contains benchmark codes.


Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MSFiller.cpp

    r1988 r1990  
    9191{
    9292  os_.origin( LogOrigin( "MSFiller", "open()", WHERE ) ) ;
    93   //double startSec = gettimeofday_sec() ;
    94   //os_ << "start MSFiller::open() startsec=" << startSec << LogIO::POST ;
     93  double startSec = gettimeofday_sec() ;
     94  os_ << "start MSFiller::open() startsec=" << startSec << LogIO::POST ;
    9595  //os_ << "   filename = " << filename << endl ;
    9696
     
    134134  isData_ = mstable_.tableDesc().isColumn( "DATA" ) ;
    135135
    136   //double endSec = gettimeofday_sec() ;
    137   //os_ << "end MSFiller::open() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     136  double endSec = gettimeofday_sec() ;
     137  os_ << "end MSFiller::open() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    138138  return true ;
    139139}
     
    142142{
    143143  os_.origin( LogOrigin( "MSFiller", "fill()", WHERE ) ) ;
    144   //double startSec = gettimeofday_sec() ;
    145   //os_ << "start MSFiller::fill() startSec=" << startSec << LogIO::POST ;
     144  double startSec = gettimeofday_sec() ;
     145  os_ << "start MSFiller::fill() startSec=" << startSec << LogIO::POST ;
     146
     147  double time0 = gettimeofday_sec() ;
     148  os_ << "start init fill: " << time0 << LogIO::POST ;
    146149
    147150  // Initialize header
     
    260263  delete sharedQDArrCol ;
    261264  MPosition mp( MVPosition( antpos ), MPosition::ITRF ) ;
    262   //pointtab = pointtab( pointtab.col("ANTENNA_ID")==antenna_ ).sort("TIME") ;
    263   pointtab = MSPointing( pointtab( pointtab.col("ANTENNA_ID")==antenna_ ).sort("TIME") ) ;
     265  if ( getPt_ ) {
     266    //pointtab = pointtab( pointtab.col("ANTENNA_ID")==antenna_ ).sort("TIME") ;
     267    pointtab = MSPointing( pointtab( pointtab.col("ANTENNA_ID")==antenna_ ).sort("TIME") ) ;
     268  }
    264269  tcolr = tpoolr->construct( anttab, "STATION" ) ;
    265270  String stationName = tcolr->asString( antenna_ ) ;
     
    273278  String telescopeName = "" ;
    274279
     280  double time1 = gettimeofday_sec() ;
     281  os_ << "end fill init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     282
    275283  //
    276284  // ITERATION: OBSERVATION_ID
     
    280288  TableIterator iter0( mstable_, "OBSERVATION_ID" ) ;
    281289  while( !iter0.pastEnd() ) {
     290    time0 = gettimeofday_sec() ;
     291    os_ << "start 0th iteration: " << time0 << LogIO::POST ;
    282292    Table t0 = iter0.table() ;
    283293    tcolr = tpoolr->construct( t0, "OBSERVATION_ID" ) ;
     
    306316    }
    307317    Int nbeam = 0 ;
     318    time1 = gettimeofday_sec() ;
     319    os_ << "end 0th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    308320    //
    309321    // ITERATION: FEED1
     
    313325    TableIterator iter1( t0, "FEED1" ) ;
    314326    while( !iter1.pastEnd() ) {
     327      time0 = gettimeofday_sec() ;
     328      os_ << "start 1st iteration: " << time0 << LogIO::POST ;
    315329      Table t1 = iter1.table() ;
    316330      // assume FEED1 == FEED2
     
    319333      tpoolr->destroy( tcolr ) ;
    320334      nbeam++ ;
     335      time1 = gettimeofday_sec() ;
     336      os_ << "end 1st iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    321337      //
    322338      // ITERATION: FIELD_ID
     
    326342      TableIterator iter2( t1, "FIELD_ID" ) ;
    327343      while( !iter2.pastEnd() ) {
     344        time0 = gettimeofday_sec() ;
     345        os_ << "start 2nd iteration: " << time0 << LogIO::POST ;
    328346        Table t2 = iter2.table() ;
    329347        tcolr = tpoolr->construct( t2, "FIELD_ID" ) ;
     
    336354        String fieldName = tcolr->asString( fieldId ) + "__" + String::toString(fieldId) ;
    337355        tpoolr->destroy( tcolr ) ;
     356        time1 = gettimeofday_sec() ;
     357        os_ << "end 2nd iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    338358        //
    339359        // ITERATION: DATA_DESC_ID
     
    343363        TableIterator iter3( t2, "DATA_DESC_ID" ) ;
    344364        while( !iter3.pastEnd() ) {
     365          time0 = gettimeofday_sec() ;
     366          os_ << "start 3rd iteration: " << time0 << LogIO::POST ;
    345367          Table t3 = iter3.table() ;
    346368          tcolr = tpoolr->construct( t3, "DATA_DESC_ID" ) ;
     
    493515          // for TSYS and TCAL
    494516          MSSysCal caltabsel( caltab( caltab.col("ANTENNA_ID") == antenna_ && caltab.col("FEED_ID") == feedId && caltab.col("SPECTRAL_WINDOW_ID") == spwId ).sort("TIME") ) ;
     517          time1 = gettimeofday_sec() ;
     518          os_ << "end 3rd iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    495519          //
    496520          // ITERATION: SCAN_NUMBER
     
    500524          TableIterator iter4( t3, "SCAN_NUMBER" ) ;
    501525          while( !iter4.pastEnd() ) {
     526            time0 = gettimeofday_sec() ;
     527            os_ << "start 4th iteration: " << time0 << LogIO::POST ;
    502528            Table t4 = iter4.table() ;
    503529            tcolr = tpoolr->construct( t4, "SCAN_NUMBER" ) ;
     
    505531            tpoolr->destroy( tcolr ) ;
    506532            uInt cycle = 0 ;
     533            time1 = gettimeofday_sec() ;
     534            os_ << "end 4th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    507535            //
    508536            // ITERATION: STATE_ID
     
    512540            TableIterator iter5( t4, "STATE_ID" ) ;
    513541            while( !iter5.pastEnd() ) {
     542              time0 = gettimeofday_sec() ;
     543              os_ << "start 5th iteration: " << time0 << LogIO::POST ;
    514544              Table t5 = iter5.table() ;
    515545              tcolr = tpoolr->construct( t5, "STATE_ID" ) ;
     
    525555              Int addednr = 0 ;
    526556              Int nloop = 0 ;
     557              time1 = gettimeofday_sec() ;
     558              os_ << "end 5th iteration init: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    527559           
    528560              // SPECTRA, FLAG
     561              time0 = gettimeofday_sec() ;
     562              os_ << "start fill SPECTRA and FLAG: " << time0 << LogIO::POST ;
    529563              ROArrayColumn<Bool> mFlagCol( t5, "FLAG" ) ;
    530564              if ( isFloatData_ ) {
     
    533567                addednr = nrow*npol ;
    534568                oldnr += addednr ;
    535                 table_->table().addRow( addednr ) ;
     569                stab.addRow( addednr ) ;
    536570                nloop = npol ;
    537571                for ( Int irow = 0 ; irow < nrow ; irow++ ) {
     
    560594                addednr = nrow*npol ;
    561595                oldnr += addednr ;
    562                 table_->table().addRow( addednr ) ;
     596                stab.addRow( addednr ) ;
    563597                nloop = npol ;
    564598                for ( Int irow = 0 ; irow < nrow ; irow++ ) {
     
    609643                }
    610644              }
     645              time1 = gettimeofday_sec() ;
     646              os_ << "end fill SPECTRA and FLAGTRA: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    611647
    612648              // number of rows added in this cycle
     
    616652
    617653              // TIME
     654              time0 = gettimeofday_sec() ;
     655              os_ << "start fill TIME: " << time0 << LogIO::POST ;
    618656              ROScalarMeasColumn<MEpoch> *mTimeCol = new ROScalarMeasColumn<MEpoch>( t5, "TIME" ) ;
    619657              Int tidx = prevnr ;
     
    623661                }
    624662              }
     663              time1 = gettimeofday_sec() ;
     664              os_ << "end fill TIME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    625665           
    626666              // TSYS
     667              time0 = gettimeofday_sec() ;
     668              os_ << "start fill TSYS: " << time0 << LogIO::POST ;
    627669              Vector<Double> sysCalTime ;
    628670              if ( isSysCal_ ) {
     
    651693                  tsysCol->put( i, tsys ) ;
    652694              }
     695              time1 = gettimeofday_sec() ;
     696              os_ << "end fill TSYS: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    653697
    654698
    655699              // INTERVAL
     700              time0 = gettimeofday_sec() ;
     701              os_ << "start fill INTERVAL: " << time0 << LogIO::POST ;
    656702              tcolr = tpoolr->construct( t5, "INTERVAL" ) ;
    657703              //Vector<Double> integ = mIntervalCol->getColumn() ;
     
    666712              }
    667713              tpoolr->destroy( tcolr ) ;
     714              time1 = gettimeofday_sec() ;
     715              os_ << "end fill INTERVAL: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    668716
    669717              // SRCTYPE
     718              time0 = gettimeofday_sec() ;
     719              os_ << "start fill SRCTYPE: " << time0 << LogIO::POST ;
    670720              Int srcType = getSrcType( stateId, tpoolr ) ;
    671721              for ( int i = 0 ; i < addednr ; i++ ) {
     
    674724              //Vector<Int> *srcType = new Vector<Int>( addednr, getSrcType( stateId ) ) ;
    675725              //srcTypeCol->putColumnCells( rows, *srcType ) ;
     726              time1 = gettimeofday_sec() ;
     727              os_ << "end fill SRCTYPE: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    676728
    677729              // DIRECTION, AZIMUTH, ELEVATION, SCANRATE
     730              time0 = gettimeofday_sec() ;
     731              os_ << "start fill DIRECTION, AZIMUTH, ELEVATION, SCANRATE: " << time0 << LogIO::POST ;
    678732              Vector<Double> defaultScanrate( 2, 0.0 ) ;
    679733              uInt diridx = 0 ;
     
    745799              else {
    746800                // All directions are set to source direction
    747                 ROArrayMeasColumn<MDirection> dmcol( pointtab, "DIRECTION" ) ;
    748                 ROArrayColumn<Double> dcol( pointtab, "DIRECTION" ) ;
    749                 IPosition ip( dmcol(0).shape().nelements(), 0 ) ;
    750                 IPosition outp( 1, 2 ) ;
    751                 String ref = dmcol(0)(ip).getRefString() ;
    752                 Slice ds( 0, 2, 1 ) ;
    753                 Slice ds0( 0, 1, 1 ) ;
    754                 Slicer dslice0( ds, ds0 ) ;
    755                 Vector<Double> defaultDir = dcol(0)(dslice0).reform(outp) ;
     801                //ROArrayMeasColumn<MDirection> dmcol( pointtab, "DIRECTION" ) ;
     802                //ROArrayColumn<Double> dcol( pointtab, "DIRECTION" ) ;
     803                //IPosition ip( dmcol(0).shape().nelements(), 0 ) ;
     804                //IPosition outp( 1, 2 ) ;
     805                //String ref = dmcol(0)(ip).getRefString() ;
     806                String ref = md.getRefString() ;
     807                //Slice ds( 0, 2, 1 ) ;
     808                //Slice ds0( 0, 1, 1 ) ;
     809                //Slicer dslice0( ds, ds0 ) ;
     810                //Vector<Double> defaultDir = dcol(0)(dslice0).reform(outp) ;
     811                Vector<Double> defaultDir = srcDir ;
    756812                MDirection::getType( dirType, "J2000" ) ;
    757                 mf.resetDirection( MDirection( MVDirection(srcDir), dirType ) ) ;
     813                //mf.resetDirection( MDirection( MVDirection(srcDir), dirType ) ) ;
    758814                if ( ref != "J2000" ) {
    759815                  ROScalarMeasColumn<MEpoch> tmCol( pointtab, "TIME" ) ;
     
    775831                }
    776832              }
     833              time1 = gettimeofday_sec() ;
     834              os_ << "end fill DIRECTION, AZIMUTH, ELEVATION, SCANRATE: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    777835
    778836              // CYCLENO
     837              time0 = gettimeofday_sec() ;
     838              os_ << "start fill CYCLENO: " << time0 << LogIO::POST ;
    779839              for ( int i = 0 ; i < nloop ; i++ ) {
    780840                for ( int j = 0 ; j < nrow ; j++ ) {
     
    783843              }
    784844              cycle += nrow ;
     845              time1 = gettimeofday_sec() ;
     846              os_ << "end fill CYCLENO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    785847
    786848              // POLNO
     849              time0 = gettimeofday_sec() ;
     850              os_ << "start fill POLNO: " << time0 << LogIO::POST ;
    787851              Int pidx = 0 ;
    788852              Bool crossOK = False ;
     
    800864                }
    801865              }
     866              time1 = gettimeofday_sec() ;
     867              os_ << "end fill POLNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    802868
    803869              // FLAGROW
     870              time0 = gettimeofday_sec() ;
     871              os_ << "start fill FLAGROW: " << time0 << LogIO::POST ;
    804872              tcolr = tpoolr->construct( t5, "FLAG_ROW" ) ;
    805873              for ( int i = 0 ; i < nloop ; i++ ) {
     
    809877              }
    810878              tpoolr->destroy( tcolr ) ;
     879              time1 = gettimeofday_sec() ;
     880              os_ << "end fill FLAGROW: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    811881
    812882              // TCAL_ID
     883              time0 = gettimeofday_sec() ;
     884              os_ << "start fill TCAL_ID: " << time0 << LogIO::POST ;
    813885              if ( isSysCal_ ) {
    814886                for( Int irow = 0 ; irow < nrow ; irow++ ) {
     
    830902                  tcalidCol->putScalar( prevnr+irow, tcalid ) ;
    831903              }
     904              time1 = gettimeofday_sec() ;
     905              os_ << "end fill TCAL_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    832906
    833907              // WEATHER_ID
     908              time0 = gettimeofday_sec() ;
     909              os_ << "start fill WEATHER_ID: " << time0 << LogIO::POST ;
    834910              if ( isWeather_ ) {
    835911                uInt wid = 0 ;
     
    841917                }
    842918              }
     919              time1 = gettimeofday_sec() ;
     920              os_ << "end fill WEATHER_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    843921
    844922              delete mTimeCol ;
     
    853931            // MS: 1-base
    854932            // Scantable: 0-base
     933            time0 = gettimeofday_sec() ;
     934            os_ << "start fill SCANNO: " << time0 << LogIO::POST ;
    855935            Int dest5 = current5 + added5 ;
    856936            scanNum -= 1 ;
    857937            for ( Int irow = current5 ; irow < dest5 ; irow++ )
    858938              scannoCol->putScalar( irow, (uInt)scanNum ) ;
     939            time1 = gettimeofday_sec() ;
     940            os_ << "end fill SCANNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    859941
    860942            os_ << "added5 = " << added5 << endl ;
     
    864946
    865947          // IFNO
     948          time0 = gettimeofday_sec() ;
     949          os_ << "start fill IFNO: " << time0 << LogIO::POST ;
    866950          Int dest4 = current4 + added4 ;
    867951          for ( Int irow = current4 ; irow < dest4 ; irow++ )
    868952            ifnoCol->putScalar( irow, (uInt)spwId ) ;
     953          time1 = gettimeofday_sec() ;
     954          os_ << "end fill IFNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    869955
    870956          // FREQ_ID
     957          time0 = gettimeofday_sec() ;
     958          os_ << "start fill FREQ_ID: " << time0 << LogIO::POST ;
    871959          uInt fid = ifmap[spwId] ;
    872960          for ( Int irow = current4 ; irow < dest4 ; irow++ )
    873961            freqidCol->putScalar( irow, fid ) ;
     962          time1 = gettimeofday_sec() ;
     963          os_ << "end fill FREQ_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    874964
    875965          // MOLECULE_ID
     966          time0 = gettimeofday_sec() ;
     967          os_ << "start fill MOLECULE_ID: " << time0 << LogIO::POST ;
    876968          for ( Int irow = current4 ; irow < dest4 ; irow++ )
    877969            molidCol->putScalar( irow, molId ) ;
     970          time1 = gettimeofday_sec() ;
     971          os_ << "end fill MOLECULE_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    878972
    879973          // SRCNAME
     974          time0 = gettimeofday_sec() ;
     975          os_ << "start fill SRCNAME: " << time0 << LogIO::POST ;
    880976          for ( Int irow = current4 ; irow < dest4 ; irow++ )
    881977            srcnameCol->putScalar( irow, srcName ) ;
     978          time1 = gettimeofday_sec() ;
     979          os_ << "end fill SRCNAME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    882980
    883981          // SRCVELOCITY, SRCPROPERMOTION and SRCDIRECTION
    884982          // no reference conversion for direction at the moment (assume J2000)
    885983          // no reference conversion for velocity at the moment (assume LSRK)
     984          time0 = gettimeofday_sec() ;
     985          os_ << "start fill SRCPROPERMOTION: " << time0 << LogIO::POST ;
    886986          for ( Int irow = current4 ; irow < dest4 ; irow++ )
    887987            srcpmCol->put( irow, srcPM ) ;
     988          time1 = gettimeofday_sec() ;
     989          os_ << "end fill SRCPROPERMOTION: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     990          time0 = gettimeofday_sec() ;
     991          os_ << "start fill SRCDIRECTION: " << time0 << LogIO::POST ;
    888992          for ( Int irow = current4 ; irow < dest4 ; irow++ )
    889993            srcdirCol->put( irow, srcDir ) ;
     994          time1 = gettimeofday_sec() ;
     995          os_ << "end fill SRCDIRECTION: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     996          time0 = gettimeofday_sec() ;
     997          os_ << "start fill SRCVELOCITY: " << time0 << LogIO::POST ;
    890998          for ( Int irow = current4 ; irow < dest4 ; irow++ )
    891999            srcvelCol->putScalar( irow, sysVel ) ;
     1000          time1 = gettimeofday_sec() ;
     1001          os_ << "end fill SRCVELOCITY: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    8921002
    8931003          os_ << "added4 = " << added4 << endl ;
     
    8971007
    8981008        // FIELDNAME
     1009        time0 = gettimeofday_sec() ;
     1010        os_ << "start fill FIELDNAME: " << time0 << LogIO::POST ;
    8991011        Int dest3 = current3 + added3 ;
    9001012        for ( Int irow = current3 ; irow < dest3 ; irow++ )
    9011013          fieldnameCol->putScalar( irow, fieldName ) ;
    902 
     1014        time1 = gettimeofday_sec() ;
     1015        os_ << "end fill FIELDNAME: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     1016             
    9031017        os_ << "added3 = " << added3 << endl ;
    9041018        added2 += added3 ;
     
    9071021
    9081022      // BEAMNO
     1023      time0 = gettimeofday_sec() ;
     1024      os_ << "start fill BEAMNO: " << time0 << LogIO::POST ;
    9091025      Int dest2 = current2 + added2 ;
    9101026      for ( Int irow = current2 ; irow < dest2 ; irow++ )
    9111027        beamnoCol->putScalar( irow, (uInt)feedId ) ;
     1028      time1 = gettimeofday_sec() ;
     1029      os_ << "end fill BEAMNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    9121030
    9131031      // FOCUS_ID
    9141032      // tentative
     1033      time0 = gettimeofday_sec() ;
     1034      os_ << "start fill FOCUS_ID: " << time0 << LogIO::POST ;
    9151035      uInt focusId = 0 ;
    9161036      for ( Int irow = current2 ; irow < dest2 ; irow++ )
    9171037        focusidCol->putScalar( irow, focusId ) ;
    918      
     1038      time1 = gettimeofday_sec() ;
     1039      os_ << "end fill FOCUS_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
     1040
    9191041      os_ << "added2 = " << added2 << endl ;
    9201042      added1 += added2 ;
     
    9321054  // REFBEAMNO
    9331055  // set 0 at the moment
    934   tcolw = tpoolw->construct( table_->table(), "REFBEAMNO" ) ;
     1056  time0 = gettimeofday_sec() ;
     1057  os_ << "start fill REFBEAMNO: " << time0 << LogIO::POST ;
     1058  tcolw = tpoolw->construct( stab, "REFBEAMNO" ) ;
    9351059  for ( Int irow = current0 ; irow < added0 ; irow++ )
    9361060    tcolw->putScalar( irow, 0 ) ;
    9371061  tpoolw->destroy( tcolw ) ;
     1062  time1 = gettimeofday_sec() ;
     1063  os_ << "end fill REFBEAMNO: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    9381064
    9391065  // FIT_ID
    9401066  // nothing to do
    941   tcolw = tpoolw->construct( table_->table(), "FIT_ID" ) ;
     1067  time0 = gettimeofday_sec() ;
     1068  os_ << "start fill FIT_ID: " << time0 << LogIO::POST ;
     1069  tcolw = tpoolw->construct( stab, "FIT_ID" ) ;
    9421070  for ( Int irow = current0 ; irow < added0 ; irow++ )
    9431071    tcolw->putScalar( irow, -1 ) ;
    9441072  tpoolw->destroy( tcolw ) ;
     1073  time1 = gettimeofday_sec() ;
     1074  os_ << "end fill FIT_ID: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    9451075
    9461076  // OPACITY
    9471077  // not used?
    948   tcolw = tpoolw->construct( table_->table(), "OPACITY" ) ;
     1078  time0 = gettimeofday_sec() ;
     1079  os_ << "start fill OPACITY: " << time0 << LogIO::POST ;
     1080  tcolw = tpoolw->construct( stab, "OPACITY" ) ;
    9491081  for ( Int irow = current0 ; irow < added0 ; irow++ )
    9501082    tcolw->putScalar( irow, 0.0 ) ;
    9511083  tpoolw->destroy( tcolw ) ;
     1084  time1 = gettimeofday_sec() ;
     1085  os_ << "end fill OPACITY: " << time1 << " (" << time1-time0 << "sec)" << LogIO::POST ;
    9521086
    9531087  // delete Scantable columns
     
    10221156  Path datapath( tablename_ ) ;
    10231157  String pTabName = datapath.absoluteName() + "/POINTING" ;
    1024   table_->table().rwKeywordSet().define( "POINTING", pTabName ) ;
     1158  stab.rwKeywordSet().define( "POINTING", pTabName ) ;
    10251159
    10261160  // for GBT
    10271161  if ( antennaName == "GBT" ) {
    10281162    String goTabName = datapath.absoluteName() + "/GBT_GO" ;
    1029     table_->table().rwKeywordSet().define( "GBT_GO", goTabName ) ;
    1030   }
    1031   //double endSec = gettimeofday_sec() ;
    1032   //os_ << "end MSFiller::fill() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1163    stab.rwKeywordSet().define( "GBT_GO", goTabName ) ;
     1164  }
     1165  double endSec = gettimeofday_sec() ;
     1166  os_ << "end MSFiller::fill() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    10331167}
    10341168
     
    10431177Int MSFiller::getSrcType( Int stateId, boost::object_pool<ROTableColumn> *tpool )
    10441178{
    1045   //double startSec = gettimeofday_sec() ;
    1046   //os_ << "start MSFiller::getSrcType() startSec=" << startSec << LogIO::POST ;
     1179  double startSec = gettimeofday_sec() ;
     1180  os_ << "start MSFiller::getSrcType() startSec=" << startSec << LogIO::POST ;
    10471181
    10481182  MSState statetab = mstable_.state() ;
     
    11501284   
    11511285  //os_ << "srcType = " << srcType << LogIO::POST ;
    1152   //double endSec = gettimeofday_sec() ;
    1153   //os_ << "end MSFiller::getSrcType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1286  double endSec = gettimeofday_sec() ;
     1287  os_ << "end MSFiller::getSrcType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    11541288  return srcType ;
    11551289}
     
    11571291Vector<uInt> MSFiller::getPolNo( Int corrType )
    11581292{
    1159   //double startSec = gettimeofday_sec() ;
    1160   //os_ << "start MSFiller::getPolNo() startSec=" << startSec << LogIO::POST ;
     1293  double startSec = gettimeofday_sec() ;
     1294  os_ << "start MSFiller::getPolNo() startSec=" << startSec << LogIO::POST ;
    11611295  Vector<uInt> polno( 1 ) ;
    11621296
     
    11881322  }
    11891323  //os_ << "polno = " << polno << LogIO::POST ;
    1190   //double endSec = gettimeofday_sec() ;
    1191   //os_ << "end MSFiller::getPolNo() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1324  double endSec = gettimeofday_sec() ;
     1325  os_ << "end MSFiller::getPolNo() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    11921326 
    11931327  return polno ;
     
    11961330String MSFiller::getPolType( Int corrType )
    11971331{
    1198   //double startSec = gettimeofday_sec() ;
    1199   //os_ << "start MSFiller::getPolType() startSec=" << startSec << LogIO::POST ;
     1332  double startSec = gettimeofday_sec() ;
     1333  os_ << "start MSFiller::getPolType() startSec=" << startSec << LogIO::POST ;
    12001334  String poltype = "" ;
    12011335
     
    12091343    poltype = "linpol" ;
    12101344
    1211   //double endSec = gettimeofday_sec() ;
    1212   //os_ << "end MSFiller::getPolType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1345  double endSec = gettimeofday_sec() ;
     1346  os_ << "end MSFiller::getPolType() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    12131347  return poltype ;
    12141348}
     
    12161350void MSFiller::fillWeather()
    12171351{
    1218   //double startSec = gettimeofday_sec() ;
    1219   //os_ << "start MSFiller::fillWeather() startSec=" << startSec << LogIO::POST ;
     1352  double startSec = gettimeofday_sec() ;
     1353  os_ << "start MSFiller::fillWeather() startSec=" << startSec << LogIO::POST ;
    12201354  Table mWeather = mstable_.weather()  ;
    12211355  //Table mWeatherSel = mWeather( mWeather.col("ANTENNA_ID") == antenna_ ).sort("TIME") ;
     
    12921426    mwInterval_ *= 86400.0 ;
    12931427  //os_ << "mwTime[0] = " << mwTime_[0] << " mwInterval[0] = " << mwInterval_[0] << LogIO::POST ;
    1294   //double endSec = gettimeofday_sec() ;
    1295   //os_ << "end MSFiller::fillWeather() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1428  double endSec = gettimeofday_sec() ;
     1429  os_ << "end MSFiller::fillWeather() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    12961430}
    12971431
    12981432void MSFiller::fillFocus()
    12991433{
    1300   //double startSec = gettimeofday_sec() ;
    1301   //os_ << "start MSFiller::fillFocus() startSec=" << startSec << LogIO::POST ;
     1434  double startSec = gettimeofday_sec() ;
     1435  os_ << "start MSFiller::fillFocus() startSec=" << startSec << LogIO::POST ;
    13021436  // tentative
    13031437  Table tab = table_->focus().table() ;
     
    13051439  ScalarColumn<uInt> idCol( tab, "ID" ) ;
    13061440  idCol.put( 0, 0 ) ;
    1307   //double endSec = gettimeofday_sec() ;
    1308   //os_ << "end MSFiller::fillFocus() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1441  double endSec = gettimeofday_sec() ;
     1442  os_ << "end MSFiller::fillFocus() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    13091443}
    13101444
     
    13121446                         boost::object_pool<TableColumn> *tpoolw )
    13131447{
    1314   //double startSec = gettimeofday_sec() ;
    1315   //os_ << "start MSFiller::fillTcal() startSec=" << startSec << LogIO::POST ;
     1448  double startSec = gettimeofday_sec() ;
     1449  os_ << "start MSFiller::fillTcal() startSec=" << startSec << LogIO::POST ;
    13161450
    13171451  //MSSysCal sctab = mstable_.sysCal() ;
     
    13461480    Int feedId = sharedCol->asInt( 0 ) ;
    13471481    tpoolr->destroy( sharedCol ) ;
    1348     String ffield = "FEED" + String::toString( feedId ) ;
     1482    //String ffield = "FEED" + String::toString( feedId ) ;
    13491483    //Record rec0 ;
    13501484    TableIterator iter1( t0, "SPECTRAL_WINDOW_ID" ) ;
     
    13541488      Int spwId = sharedCol->asInt( 0 ) ;
    13551489      tpoolr->destroy( sharedCol ) ;
    1356       String spwfield = "SPW" + String::toString( spwId ) ;
     1490      //String spwfield = "SPW" + String::toString( spwId ) ;
    13571491      //Record rec1 ;
    13581492      TableIterator iter2( t1, "TIME" ) ;
     
    13881522        oldnr = newnr ;
    13891523
    1390         String key = ffield+":"+spwfield+":"+sTime ;
     1524        //String key = ffield+":"+spwfield+":"+sTime ;
     1525        String key = keyTcal( feedId, spwId, sTime ) ;
    13911526        tcalrec_.define( key, idminmax ) ;
    13921527        //rec1.define( sTime, idminmax ) ;
     
    14041539
    14051540  //tcalrec_.print( std::cout ) ;
    1406   //double endSec = gettimeofday_sec() ;
    1407   //os_ << "end MSFiller::fillTcal() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1541  double endSec = gettimeofday_sec() ;
     1542  os_ << "end MSFiller::fillTcal() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    14081543}
    14091544
    14101545uInt MSFiller::getWeatherId( uInt idx, Double wtime )
    14111546{
    1412   //double startSec = gettimeofday_sec() ;
    1413   //os_ << "start MSFiller::getWeatherId() startSec=" << startSec << LogIO::POST ;
     1547  double startSec = gettimeofday_sec() ;
     1548  os_ << "start MSFiller::getWeatherId() startSec=" << startSec << LogIO::POST ;
    14141549  uInt nrow = mwTime_.size() ;
    14151550  if ( nrow == 0 )
     
    14401575  //os_ << LogIO::WARN << "Couldn't find correct WEATHER_ID for time " << wtime << LogIO::POST ;
    14411576
    1442   //double endSec = gettimeofday_sec() ;
    1443   //os_ << "end MSFiller::getWeatherId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1577  double endSec = gettimeofday_sec() ;
     1578  os_ << "end MSFiller::getWeatherId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    14441579  return wid ;
    14451580}
     
    14471582Vector<Double> MSFiller::getSysCalTime( MSSysCal &tab, MEpoch::ROScalarColumn &tcol )
    14481583{
    1449   //double startSec = gettimeofday_sec() ;
    1450   //os_ << "start MSFiller::getSysCalTime() startSec=" << startSec << LogIO::POST ;
     1584  double startSec = gettimeofday_sec() ;
     1585  os_ << "start MSFiller::getSysCalTime() startSec=" << startSec << LogIO::POST ;
    14511586  uInt nrow = tcol.table().nrow() ;
    14521587  Vector<Double> tstr( nrow, -1.0 ) ;
     
    14781613    }
    14791614  }
    1480   //double endSec = gettimeofday_sec() ;
    1481   //os_ << "end MSFiller::getSysCalTime() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1615  double endSec = gettimeofday_sec() ;
     1616  os_ << "end MSFiller::getSysCalTime() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    14821617  return tstr ;
    14831618}
     
    14851620uInt MSFiller::getTsys( uInt idx, Matrix<Float> &tsys, MSSysCal &tab, Double t )
    14861621{
    1487   //double startSec = gettimeofday_sec() ;
    1488   //os_ << "start MSFiller::getTsys() startSec=" << startSec << LogIO::POST ;
     1622  double startSec = gettimeofday_sec() ;
     1623  os_ << "start MSFiller::getTsys() startSec=" << startSec << LogIO::POST ;
    14891624  uInt nrow = tab.nrow() ;
    14901625  if ( nrow == 0 ) {
     
    15111646  }
    15121647  //os_ << "MSFiller::getTsys() idx = " << idx << " tsys = " << tsys << LogIO::POST ;
    1513   //double endSec = gettimeofday_sec() ;
    1514   //os_ << "end MSFiller::getTsys() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1648  double endSec = gettimeofday_sec() ;
     1649  os_ << "end MSFiller::getTsys() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    15151650  return idx ;
    15161651}
     
    15181653Vector<uInt> MSFiller::getTcalId( Int fid, Int spwid, Double t )
    15191654{
    1520   //double startSec = gettimeofday_sec() ;
    1521   //os_ << "start MSFiller::getTcalId() startSec=" << startSec << LogIO::POST ;
     1655  double startSec = gettimeofday_sec() ;
     1656  os_ << "start MSFiller::getTcalId() startSec=" << startSec << LogIO::POST ;
    15221657  if ( table_->tcal().table().nrow() == 0 ) {
    15231658    os_ << "No TCAL rows" << LogIO::POST ;
     
    15251660    return  tcalids ;
    15261661  }   
    1527   String feed = "FEED" + String::toString(fid) ;
    1528   String spw = "SPW" + String::toString(spwid) ;
     1662  //String feed = "FEED" + String::toString(fid) ;
     1663  //String spw = "SPW" + String::toString(spwid) ;
    15291664  String sctime = MVTime( Quantum<Double>(t,"s") ).string(MVTime::YMD) ;
    1530   String key = feed + ":" + spw + ":" + sctime ;
     1665  //String key = feed + ":" + spw + ":" + sctime ;
     1666  String key = keyTcal( fid, spwid, sctime ) ;
    15311667  //Record rec = tcalrec_.asRecord(feed).asRecord(spw) ;
    15321668  //if ( !rec.isDefined( sctime ) ) {
     
    15451681    tcalids[ipol] = ids[0] + ipol - 1 ;
    15461682
    1547   //double endSec = gettimeofday_sec() ;
    1548   //os_ << "end MSFiller::getTcalId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1683  double endSec = gettimeofday_sec() ;
     1684  os_ << "end MSFiller::getTcalId() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    15491685  return tcalids ;
    15501686}
     
    15521688uInt MSFiller::getDirection( uInt idx, Vector<Double> &dir, Vector<Double> &srate, String &ref, MSPointing &tab, Double t )
    15531689{
    1554   //double startSec = gettimeofday_sec() ;
    1555   //os_ << "start MSFiller::getDirection() startSec=" << startSec << LogIO::POST ;
     1690  double startSec = gettimeofday_sec() ;
     1691  os_ << "start MSFiller::getDirection() startSec=" << startSec << LogIO::POST ;
    15561692  // assume that cols is sorted by TIME
    15571693  Bool doInterp = False ;
     
    16271763  }
    16281764
    1629   //double endSec = gettimeofday_sec() ;
    1630   //os_ << "end MSFiller::getDirection() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     1765  double endSec = gettimeofday_sec() ;
     1766  os_ << "end MSFiller::getDirection() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
    16311767  return idx ;
    16321768}
    16331769
     1770String MSFiller::keyTcal( Int feedid, Int spwid, String stime )
     1771{
     1772  String sfeed = "FEED" + String::toString( feedid ) ;
     1773  String sspw = "SPW" + String::toString( spwid ) ;
     1774  return sfeed+":"+sspw+":"+stime ;
     1775}
     1776
    16341777} ;
    16351778
  • trunk/src/MSFiller.h

    r1988 r1990  
    9696  // get direction for DIRECTION, AZIMUTH, and ELEVATION columns
    9797  casa::uInt getDirection( casa::uInt idx, casa::Vector<casa::Double> &dir, casa::Vector<casa::Double> &srate, casa::String &ref, casa::MSPointing &tab, casa::Double t ) ;
     98
     99  // create key for TCAL table
     100  casa::String keyTcal( casa::Int feedid, casa::Int spwid, casa::String stime ) ;
    98101 
    99102  casa::CountedPtr<Scantable> table_ ;
Note: See TracChangeset for help on using the changeset viewer.