Changeset 2017
- Timestamp:
- 02/28/11 18:51:18 (14 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MSFiller.cpp
r2004 r2017 20 20 #include <tables/Tables/ScalarColumn.h> 21 21 #include <tables/Tables/ArrayColumn.h> 22 #include <tables/Tables/RefRows.h>23 22 #include <tables/Tables/TableParse.h> 24 #include <tables/Tables/RefRows.h>25 23 #include <tables/Tables/TableRow.h> 26 24 … … 54 52 #include <sys/time.h> 55 53 56 double gettimeofday_sec() 54 using namespace casa ; 55 using namespace std ; 56 57 namespace asap { 58 double MSFiller::gettimeofday_sec() 57 59 { 58 60 struct timeval tv ; … … 61 63 } 62 64 63 using namespace casa ;64 using namespace std ;65 66 namespace asap {67 65 MSFiller::MSFiller( casa::CountedPtr<Scantable> stable ) 68 66 : table_( stable ), … … 715 713 ROTableColumn *mIntervalCol = tpoolr->construct( t5, "INTERVAL" ) ; 716 714 ROTableColumn *mFlagRowCol = tpoolr->construct( t5, "FLAG_ROW" ) ; 717 Block<Double> sysCalTime( nrow, -1.0 ) ;718 715 Block<Int> sysCalIdx( nrow, -1 ) ; 719 716 if ( isSysCal_ ) { 720 getSysCalTime( scTime, scInterval, mTimeB, sysCal Time, sysCalIdx ) ;717 getSysCalTime( scTime, scInterval, mTimeB, sysCalIdx ) ; 721 718 } 722 719 delete mTimeCol ; … … 1354 1351 } 1355 1352 1356 void MSFiller::getSysCalTime( Vector<MEpoch> &scTime, Vector<Double> &scInterval, Block<MEpoch> &tcol, Block< Double> &tstr, Block<Int> &tidx )1353 void MSFiller::getSysCalTime( Vector<MEpoch> &scTime, Vector<Double> &scInterval, Block<MEpoch> &tcol, Block<Int> &tidx ) 1357 1354 { 1358 1355 // double startSec = gettimeofday_sec() ; … … 1362 1359 return ; 1363 1360 1364 uInt nrow = t str.nelements() ;1361 uInt nrow = tidx.nelements() ; 1365 1362 if ( scTime.nelements() == 0 ) 1366 1363 return ; … … 1374 1371 for ( uInt i = 0 ; i < nrow ; i++ ) { 1375 1372 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 } 1376 1378 for ( uInt j = idx ; j < scnrow-1 ; j++ ) { 1377 1379 Double tsc1 = scTime[j].get( "s" ).getValue() ; … … 1380 1382 Double dt2 = scInterval[j+1] ; 1381 1383 if ( t > tsc1-half*dt1 && t <= tsc2-half*dt2 ) { 1382 tstr[i] = tsc1 ;1383 1384 tidx[i] = j ; 1384 1385 idx = j ; … … 1386 1387 } 1387 1388 } 1388 if ( t str[i] == -1.0) {1389 if ( tidx[i] == -1 ) { 1389 1390 Double tsc = scTime[scnrow-1].get( "s" ).getValue() ; 1390 1391 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 ; 1395 1396 } 1396 1397 } -
trunk/src/MSFiller.h
r2004 r2017 84 84 // assume that tab is selected by ANTENNA_ID, FEED_ID, SPECTRAL_WINDOW_ID 85 85 // 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 ) ; 87 87 88 88 // get TCAL_ID … … 97 97 // binary search 98 98 casa::uInt binarySearch( casa::Vector<casa::MEpoch> &timeList, casa::Double target ) ; 99 100 // tool for HPC 101 double gettimeofday_sec() ; 99 102 100 103 casa::CountedPtr<Scantable> table_ ;
Note:
See TracChangeset
for help on using the changeset viewer.