Changeset 2542 for branches/hpc33/src/STMath.cpp
- Timestamp:
- 05/22/12 10:17:06 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/hpc33/src/STMath.cpp
r2540 r2542 164 164 // use STIdxIterExAcc instead of TableIterator 165 165 STIdxIterExAcc iter( in[0], cols ) ; 166 // double t2 = 0 ; 167 // double t3 = 0 ; 166 168 // TableIterator iter(baset, cols); 167 169 // int count = 0 ; … … 229 231 230 232 // in[0] is already selected by TableItertor 231 // specCol.attach(subt,"SPECTRA");232 // flagCol.attach(subt,"FLAGTRA");233 // tsysCol.attach(subt,"TSYS");234 // intCol.attach(subt,"INTERVAL");235 // mjdCol.attach(subt,"TIME");236 233 specCol.attach(baset,"SPECTRA"); 237 234 flagCol.attach(baset,"FLAGTRA"); … … 258 255 mjdCol.get(k, time); 259 256 // spectrum has to be added last to enable weighting by the other values 257 // t2 = mathutil::gettimeofday_sec() ; 260 258 acc.add(spec, !bflag, tsys, inter, time); 261 } 262 263 // If there exists a channel at which all the input spectra are masked, 264 // spec has 'nan' values for that channel and it may affect the following 265 // processes. To avoid this, replacing 'nan' values in spec with 266 // weighted-mean of all spectra in the following line. 267 // (done for CAS-2776, 2011/04/07 by Wataru Kawasaki) 268 acc.replaceNaN(); 259 // t3 += mathutil::gettimeofday_sec() - t2 ; 260 261 } 262 269 263 270 264 // in[0] is already selected by TableIterator so that index is … … 337 331 intCol.attach(subt,"INTERVAL"); 338 332 mjdCol.attach(subt,"TIME"); 339 // Vector<Float> spec,tsys;340 // Vector<uChar> flag;341 // Double inter,time;342 333 for (uInt k = 0; k < subt.nrow(); ++k ) { 343 334 flagCol.get(k, flag); … … 354 345 mjdCol.get(k, time); 355 346 // spectrum has to be added last to enable weighting by the other values 347 // t2 = mathutil::gettimeofday_sec() ; 356 348 acc.add(spec, !bflag, tsys, inter, time); 357 } 358 349 // t3 += mathutil::gettimeofday_sec() - t2 ; 350 } 351 352 } 353 const Vector<Bool>& msk = acc.getMask(); 354 if ( allEQ(msk, False) ) { 355 uint n = rowstodelete.nelements(); 356 rowstodelete.resize(n+1, True); 357 rowstodelete[n] = i; 358 continue; 359 } 360 //write out 361 if (acc.state()) { 359 362 // If there exists a channel at which all the input spectra are masked, 360 363 // spec has 'nan' values for that channel and it may affect the following … … 363 366 // (done for CAS-2776, 2011/04/07 by Wataru Kawasaki) 364 367 acc.replaceNaN(); 365 } 366 const Vector<Bool>& msk = acc.getMask(); 367 if ( allEQ(msk, False) ) { 368 uint n = rowstodelete.nelements(); 369 rowstodelete.resize(n+1, True); 370 rowstodelete[n] = i; 371 continue; 372 } 373 //write out 374 if (acc.state()) { 368 375 369 Vector<uChar> flg(msk.shape()); 376 370 convertArray(flg, !msk); … … 413 407 // t1 = mathutil::gettimeofday_sec() ; 414 408 // cout << "elapsed time for average(): " << t1-t0 << " sec" << endl ; 409 // cout << " elapsed time for acc.add(): " << t3 << " sec" << endl ; 415 410 416 411 return out;
Note: See TracChangeset
for help on using the changeset viewer.