Changeset 2920
- Timestamp:
- 04/07/14 10:04:18 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STIdxIter.h
r2918 r2920 15 15 using namespace std ; 16 16 using namespace casa ; 17 18 namespace { 19 vector<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 17 32 18 33 namespace asap { … … 160 175 { 161 176 public: 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 } 162 194 STIdxIter2() ; 163 195 STIdxIter2( const string &name, -
trunk/src/STMath.cpp
r2919 r2920 58 58 59 59 #include "CalibrationHelper.h" 60 #include "IterationHelper.h"61 60 62 61 using namespace casa; … … 3534 3533 copyRows( out->table(), s->table(), 0, 0, s->nrow(), False, True, False ) ; 3535 3534 3536 // iterate throgh IterationHelper3535 // iterate throgh STIdxIter2 3537 3536 ChopperWheelCalibrator cal(out, s, aoff, asky, ahot, acold); 3538 IterationHelper<ChopperWheelCalibrator>::Iterate(cal, "BEAMNO,POLNO,IFNO");3537 STIdxIter2::Iterate<ChopperWheelCalibrator>(cal, "BEAMNO,POLNO,IFNO"); 3539 3538 3540 3539 s->table_ = torg ; … … 3593 3592 // t0 = mathutil::gettimeofday_sec() ; 3594 3593 3595 // iterate throgh IterationHelper3594 // iterate throgh STIdxIter2 3596 3595 AlmaCalibrator cal(out, s, aoff); 3597 IterationHelper<AlmaCalibrator>::Iterate(cal, "BEAMNO,POLNO,IFNO");3596 STIdxIter2::Iterate<AlmaCalibrator>(cal, "BEAMNO,POLNO,IFNO"); 3598 3597 3599 3598 // finalize … … 3758 3757 3759 3758 // process each sig and ref scan 3760 // iterate throgh IterationHelper3759 // iterate throgh STIdxIter2 3761 3760 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"); 3763 3762 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"); 3765 3764 } 3766 3765 }
Note:
See TracChangeset
for help on using the changeset viewer.