Changeset 2920


Ignore:
Timestamp:
04/07/14 10:04:18 (11 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..

Merged IterationHelper into STIdxIter2.


Location:
trunk/src
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STIdxIter.h

    r2918 r2920  
    1515using namespace std ;
    1616using namespace casa ;
     17
     18namespace {
     19vector<string> split(const string &str, char delim)
     20{
     21  vector<string> result;
     22  size_t current = 0;
     23  size_t found;
     24  while ((found = str.find_first_of(delim, current)) != string::npos) {
     25    result.push_back(string(str, current, found - current));
     26    current = found + 1;
     27  }
     28  result.push_back(string(str, current, str.size() - current));
     29  return result;
     30}
     31} // anonymous namespace
    1732
    1833namespace asap {
     
    160175{
    161176public:
     177  template<class T>
     178  static void Iterate(T &processor, const string cols_list)
     179  {
     180    vector<string> cols = split(cols_list, ',');
     181    // for (vector<string>::iterator i = cols.begin(); i != cols.end(); ++i)
     182    //   cout << *i << endl;
     183    STIdxIter2 iter(processor.target(), cols);
     184    STSelector sel ;
     185    while ( !iter.pastEnd() ) {
     186      const Record current = iter.currentValue() ;
     187      Vector<uInt> rows = iter.getRows( SHARE ) ;
     188      // any process
     189      processor.Process(cols, current, rows);
     190      // go next
     191      iter.next() ;
     192    }   
     193  }
    162194  STIdxIter2() ;
    163195  STIdxIter2( const string &name,
  • trunk/src/STMath.cpp

    r2919 r2920  
    5858
    5959#include "CalibrationHelper.h"
    60 #include "IterationHelper.h"
    6160
    6261using namespace casa;
     
    35343533    copyRows( out->table(), s->table(), 0, 0, s->nrow(), False, True, False ) ;
    35353534   
    3536     // iterate throgh IterationHelper
     3535    // iterate throgh STIdxIter2
    35373536    ChopperWheelCalibrator cal(out, s, aoff, asky, ahot, acold);
    3538     IterationHelper<ChopperWheelCalibrator>::Iterate(cal, "BEAMNO,POLNO,IFNO");
     3537    STIdxIter2::Iterate<ChopperWheelCalibrator>(cal, "BEAMNO,POLNO,IFNO");
    35393538
    35403539    s->table_ = torg ;
     
    35933592//     t0 = mathutil::gettimeofday_sec() ;
    35943593
    3595     // iterate throgh IterationHelper
     3594    // iterate throgh STIdxIter2
    35963595    AlmaCalibrator cal(out, s, aoff);
    3597     IterationHelper<AlmaCalibrator>::Iterate(cal, "BEAMNO,POLNO,IFNO");
     3596    STIdxIter2::Iterate<AlmaCalibrator>(cal, "BEAMNO,POLNO,IFNO");
    35983597
    35993598    // finalize
     
    37583757     
    37593758      // process each sig and ref scan
    3760       // iterate throgh IterationHelper
     3759      // iterate throgh STIdxIter2
    37613760      ChopperWheelCalibrator cal_sig(ssig, rsig, aofflo, askylo, ahotlo, acoldlo);
    3762       IterationHelper<ChopperWheelCalibrator>::Iterate(cal_sig, "BEAMNO,POLNO,IFNO");
     3761      STIdxIter2::Iterate<ChopperWheelCalibrator>(cal_sig, "BEAMNO,POLNO,IFNO");
    37633762      ChopperWheelCalibrator cal_ref(sref, rref, aoffhi, askyhi, ahothi, acoldhi);
    3764       IterationHelper<ChopperWheelCalibrator>::Iterate(cal_ref, "BEAMNO,POLNO,IFNO");
     3763      STIdxIter2::Iterate<ChopperWheelCalibrator>(cal_ref, "BEAMNO,POLNO,IFNO");
    37653764    }
    37663765  }
Note: See TracChangeset for help on using the changeset viewer.