Changeset 2017


Ignore:
Timestamp:
02/28/11 18:51:18 (14 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2718

Ready for Test: Yes/No

Interface Changes: Yes/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...

Defined gettimeofday_sec() as private method of the class.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MSFiller.cpp

    r2004 r2017  
    2020#include <tables/Tables/ScalarColumn.h>
    2121#include <tables/Tables/ArrayColumn.h>
    22 #include <tables/Tables/RefRows.h>
    2322#include <tables/Tables/TableParse.h>
    24 #include <tables/Tables/RefRows.h>
    2523#include <tables/Tables/TableRow.h>
    2624
     
    5452#include <sys/time.h>
    5553
    56 double gettimeofday_sec()
     54using namespace casa ;
     55using namespace std ;
     56
     57namespace asap {
     58double MSFiller::gettimeofday_sec()
    5759{
    5860  struct timeval tv ;
     
    6163}
    6264
    63 using namespace casa ;
    64 using namespace std ;
    65 
    66 namespace asap {
    6765MSFiller::MSFiller( casa::CountedPtr<Scantable> stable )
    6866  : table_( stable ),
     
    715713              ROTableColumn *mIntervalCol = tpoolr->construct( t5, "INTERVAL" ) ;
    716714              ROTableColumn *mFlagRowCol = tpoolr->construct( t5, "FLAG_ROW" ) ;
    717               Block<Double> sysCalTime( nrow, -1.0 ) ;
    718715              Block<Int> sysCalIdx( nrow, -1 ) ;
    719716              if ( isSysCal_ ) {
    720                 getSysCalTime( scTime, scInterval, mTimeB, sysCalTime, sysCalIdx ) ;
     717                getSysCalTime( scTime, scInterval, mTimeB, sysCalIdx ) ;
    721718              }
    722719              delete mTimeCol ;
     
    13541351}
    13551352
    1356 void MSFiller::getSysCalTime( Vector<MEpoch> &scTime, Vector<Double> &scInterval, Block<MEpoch> &tcol, Block<Double> &tstr, Block<Int> &tidx )
     1353void MSFiller::getSysCalTime( Vector<MEpoch> &scTime, Vector<Double> &scInterval, Block<MEpoch> &tcol, Block<Int> &tidx )
    13571354{
    13581355//   double startSec = gettimeofday_sec() ;
     
    13621359    return ;
    13631360
    1364   uInt nrow = tstr.nelements() ;
     1361  uInt nrow = tidx.nelements() ;
    13651362  if ( scTime.nelements() == 0 )
    13661363    return ;
     
    13741371  for ( uInt i = 0 ; i < nrow ; i++ ) {
    13751372    Double t = tcol[i].get( "s" ).getValue() ;
     1373    Double tsc = scTime[0].get( "s" ).getValue() ;
     1374    if ( t < tsc ) {
     1375      tidx[i] = 0 ;
     1376      continue ;
     1377    }
    13761378    for ( uInt j = idx ; j < scnrow-1 ; j++ ) {
    13771379      Double tsc1 = scTime[j].get( "s" ).getValue() ;
     
    13801382      Double dt2 = scInterval[j+1] ;
    13811383      if ( t > tsc1-half*dt1 && t <= tsc2-half*dt2 ) {
    1382         tstr[i] = tsc1 ;
    13831384        tidx[i] = j ;
    13841385        idx = j ;
     
    13861387      }
    13871388    }
    1388     if ( tstr[i] == -1.0 ) {
     1389    if ( tidx[i] == -1 ) {
    13891390      Double tsc = scTime[scnrow-1].get( "s" ).getValue() ;
    13901391      Double dt = scInterval[scnrow-1] ;
    1391       if ( t <= tsc+0.5*dt ) {
    1392         tstr[i] = tsc ;
    1393         tidx[i] = scnrow-1 ;
    1394       }
     1392//       if ( t <= tsc+0.5*dt ) {
     1393//         tidx[i] = scnrow-1 ;
     1394//       }
     1395      tidx[i] = scnrow-1 ;
    13951396    }
    13961397  }
  • trunk/src/MSFiller.h

    r2004 r2017  
    8484  // assume that tab is selected by ANTENNA_ID, FEED_ID, SPECTRAL_WINDOW_ID
    8585  // and sorted by TIME
    86   void getSysCalTime( casa::Vector<casa::MEpoch> &scTimeIn, casa::Vector<casa::Double> &scInterval, casa::Block<casa::MEpoch> &tcol, casa::Block<casa::Double> &scTimeOut, casa::Block<casa::Int> &tidx ) ;
     86  void getSysCalTime( casa::Vector<casa::MEpoch> &scTimeIn, casa::Vector<casa::Double> &scInterval, casa::Block<casa::MEpoch> &tcol, casa::Block<casa::Int> &tidx ) ;
    8787
    8888  // get TCAL_ID
     
    9797  // binary search
    9898  casa::uInt binarySearch( casa::Vector<casa::MEpoch> &timeList, casa::Double target ) ;
     99
     100  // tool for HPC
     101  double gettimeofday_sec() ;
    99102 
    100103  casa::CountedPtr<Scantable> table_ ;
Note: See TracChangeset for help on using the changeset viewer.