- Timestamp:
- 04/03/14 13:45:09 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/EdgeMarker.cpp
r2757 r2916 77 77 ROArrayColumn<uChar> flagCol( st_->table(), "FLAGTRA" ) ; 78 78 vector<string> cols( 1, "IFNO" ) ; 79 STIdxIter Acciter( st_, cols ) ;79 STIdxIter2 iter( st_, cols ) ; 80 80 while( !iter.pastEnd() ) { 81 uInt current = iter.current ()[0];81 uInt current = iter.currentValue().asuInt("IFNO") ; 82 82 uInt firstRow = iter.getRows()[0] ; 83 83 uInt nchan = flagCol( firstRow ).nelements() ; … … 110 110 cols[2] = "IFNO" ; 111 111 cols[3] = "SRCTYPE" ; 112 STIdxIter ExAcciter( st_, cols ) ;112 STIdxIter2 iter( st_, cols ) ; 113 113 ROScalarColumn<Double> timeCol( st_->table(), "TIME" ) ; 114 114 ROArrayColumn<Double> directionCol( st_->table(), "DIRECTION" ) ; 115 115 while( !iter.pastEnd() ) { 116 Vector<uInt> current = iter.current() ; 117 Int srcType = iter.getSrcType() ; 116 Record current = iter.currentValue() ; 117 Int srcType = current.asInt("SRCTYPE"); 118 uInt ifno = current.asuInt("IFNO"); 118 119 os_ << LogIO::DEBUGGING 119 << "BEAMNO=" << current [0]120 << " POLNO=" << current [1]121 << " IFNO=" << current[2]120 << "BEAMNO=" << current.asuInt("BEAMNO") 121 << " POLNO=" << current.asuInt("POLNO") 122 << " IFNO=" << ifno 122 123 << " SRCTYPE=" << srcType << LogIO::POST ; 123 124 // only process ON position and no WVR 124 125 Vector<uInt> rows = iter.getRows( SHARE ) ; 125 126 uInt nrow = rows.nelements() ; 126 if ( srcType == Int(SrcType::PSON) && allNE( wvr_, current[2]) && nrow > 0 ) {127 if ( srcType == Int(SrcType::PSON) && allNE( wvr_, ifno ) && nrow > 0 ) { 127 128 Vector<Double> t( nrow ) ; 128 129 Matrix<Double> d( 2, nrow ) ; -
trunk/src/STApplyCal.cpp
r2862 r2916 226 226 cols[1] = "POLNO" ; 227 227 cols[2] = "IFNO" ; 228 CountedPtr<STIdxIter > iter = new STIdxIterAcc(work_, cols) ;228 CountedPtr<STIdxIter2> iter = new STIdxIter2(work_, cols) ; 229 229 while (!iter->pastEnd()) { 230 Vector<uInt> ids = iter->current();230 Record ids = iter->currentValue(); 231 231 Vector<uInt> rows = iter->getRows(SHARE); 232 232 if (rows.nelements() > 0) 233 doapply(ids [0], ids[2], ids[1], rows, skycalList, filltsys);233 doapply(ids.asuInt("BEAMNO"), ids.asuInt("IFNO"), ids.asuInt("POLNO"), rows, skycalList, filltsys); 234 234 iter->next(); 235 235 } -
trunk/src/STCalibration.cpp
r2915 r2916 44 44 cols[1] = "POLNO"; 45 45 cols[2] = "BEAMNO"; 46 STIdxIter Acciter(scantable_, cols);46 STIdxIter2 iter(scantable_, cols); 47 47 48 48 ROScalarColumn<Double> *tcol = new ROScalarColumn<Double>(scantable_->table(), "TIME"); … … 69 69 while(!iter.pastEnd()) { 70 70 Vector<uInt> rows = iter.getRows(SHARE); 71 Vector<uInt> current = iter.current();71 Record current = iter.currentValue(); 72 72 //os_ << "current=" << current << LogIO::POST; 73 73 uInt len = rows.nelements(); … … 78 78 else if (len == 1) { 79 79 uInt irow = rows[0]; 80 appenddata(0, 0, current [2], current[0], current[1],80 appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), current.asuInt("POLNO"), 81 81 freqidCol(irow), timeSec[irow], elevation[irow], specCol(irow)); 82 82 iter.next(); … … 126 126 timeCen /= (Double)count * 86400.0; // sec->day 127 127 elCen /= (Float)count; 128 appenddata(0, 0, current [2], current[0], current[1],128 appenddata(0, 0, current.asuInt("BEAMNO"), current.asuInt("IFNO"), current.asuInt("POLNO"), 129 129 freqidCol(irow), timeCen, elCen, acc.getSpectrum()); 130 130 } -
trunk/src/STMath.cpp
r2911 r2916 3538 3538 cols[1] = "POLNO" ; 3539 3539 cols[2] = "IFNO" ; 3540 STIdxIter *iter = new STIdxIterAcc( out, cols );3541 while ( !iter ->pastEnd() ) {3542 Vector<uInt> ids = iter->current();3540 STIdxIter2 iter(out, cols); 3541 while ( !iter.pastEnd() ) { 3542 Record ids = iter.currentValue(); 3543 3543 stringstream ss ; 3544 3544 ss << "SELECT FROM $1 WHERE " 3545 << "BEAMNO==" << ids [0]<< "&&"3546 << "POLNO==" << ids [1]<< "&&"3547 << "IFNO==" << ids [2];3545 << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&" 3546 << "POLNO==" << ids.asuInt("POLNO") << "&&" 3547 << "IFNO==" << ids.asuInt("IFNO") ; 3548 3548 //cout << "TaQL string: " << ss.str() << endl ; 3549 3549 sel.setTaQL( ss.str() ) ; … … 3551 3551 ahot->setSelection( sel ) ; 3552 3552 asky->setSelection( sel ) ; 3553 Vector<uInt> rows = iter ->getRows( SHARE ) ;3553 Vector<uInt> rows = iter.getRows( SHARE ) ; 3554 3554 // out should be an exact copy of s except that SPECTRA column is empty 3555 3555 calibrateCW( out, s, aoff, asky, ahot, acold, rows, antname ) ; … … 3558 3558 asky->unsetSelection() ; 3559 3559 sel.reset() ; 3560 iter->next() ; 3561 } 3562 delete iter ; 3560 iter.next() ; 3561 } 3563 3562 s->table_ = torg ; 3564 3563 s->attach() ; … … 3616 3615 // t0 = mathutil::gettimeofday_sec() ; 3617 3616 3618 // using STIdxIter Acc3617 // using STIdxIter2 3619 3618 vector<string> cols( 3 ) ; 3620 3619 cols[0] = "BEAMNO" ; … … 3744 3743 3745 3744 if ( apexcalmode == 0 ) { 3746 // using STIdxIter Acc3745 // using STIdxIter2 3747 3746 vector<string> cols( 3 ) ; 3748 3747 cols[0] = "BEAMNO" ; 3749 3748 cols[1] = "POLNO" ; 3750 3749 cols[2] = "IFNO" ; 3751 STIdxIter *iter = new STIdxIterAcc( ssig, cols) ;3750 STIdxIter2 iter(ssig, cols) ; 3752 3751 STSelector sel ; 3753 3752 vector< CountedPtr<Scantable> > on( 2 ) ; … … 3761 3760 hot[1] = ahothi ; 3762 3761 vector< CountedPtr<Scantable> > cold( 2 ) ; 3763 while ( !iter ->pastEnd() ) {3764 Vector<uInt> ids = iter->current() ;3762 while ( !iter.pastEnd() ) { 3763 Record ids = iter.currentValue() ; 3765 3764 stringstream ss ; 3766 3765 ss << "SELECT FROM $1 WHERE " 3767 << "BEAMNO==" << ids [0]<< "&&"3768 << "POLNO==" << ids [1]<< "&&"3769 << "IFNO==" << ids [2];3766 << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&" 3767 << "POLNO==" << ids.asuInt("POLNO") << "&&" 3768 << "IFNO==" << ids.asuInt("IFNO") ; 3770 3769 //cout << "TaQL string: " << ss.str() << endl ; 3771 3770 sel.setTaQL( ss.str() ) ; … … 3774 3773 hot[0]->setSelection( sel ) ; 3775 3774 hot[1]->setSelection( sel ) ; 3776 Vector<uInt> rows = iter ->getRows( SHARE ) ;3775 Vector<uInt> rows = iter.getRows( SHARE ) ; 3777 3776 calibrateAPEXFS( ssig, sref, on, sky, hot, cold, rows ) ; 3778 3777 sky[0]->unsetSelection() ; … … 3781 3780 hot[1]->unsetSelection() ; 3782 3781 sel.reset() ; 3783 iter->next() ; 3784 } 3785 delete iter ; 3782 iter.next() ; 3783 } 3786 3784 3787 3785 } … … 3806 3804 cols[1] = "POLNO" ; 3807 3805 cols[2] = "IFNO" ; 3808 STIdxIter *iter = new STIdxIterAcc( ssig, cols );3806 STIdxIter2 iter(ssig, cols); 3809 3807 STSelector sel ; 3810 while ( !iter ->pastEnd() ) {3811 Vector<uInt> ids = iter->current() ;3808 while ( !iter.pastEnd() ) { 3809 Record ids = iter.currentValue() ; 3812 3810 stringstream ss ; 3813 3811 ss << "SELECT FROM $1 WHERE " 3814 << "BEAMNO==" << ids [0]<< "&&"3815 << "POLNO==" << ids [1]<< "&&"3816 << "IFNO==" << ids [2];3812 << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&" 3813 << "POLNO==" << ids.asuInt("POLNO") << "&&" 3814 << "IFNO==" << ids.asuInt("IFNO") ; 3817 3815 //cout << "TaQL string: " << ss.str() << endl ; 3818 3816 sel.setTaQL( ss.str() ) ; … … 3820 3818 ahotlo->setSelection( sel ) ; 3821 3819 askylo->setSelection( sel ) ; 3822 Vector<uInt> rows = iter ->getRows( SHARE ) ;3820 Vector<uInt> rows = iter.getRows( SHARE ) ; 3823 3821 calibrateCW( ssig, rsig, aofflo, askylo, ahotlo, acoldlo, rows, antname ) ; 3824 3822 aofflo->unsetSelection() ; … … 3826 3824 askylo->unsetSelection() ; 3827 3825 sel.reset() ; 3828 iter->next() ; 3829 } 3830 delete iter ; 3831 iter = new STIdxIterAcc( sref, cols ) ; 3832 while ( !iter->pastEnd() ) { 3833 Vector<uInt> ids = iter->current() ; 3826 iter.next() ; 3827 } 3828 iter = STIdxIter2(sref, cols); 3829 while ( !iter.pastEnd() ) { 3830 Record ids = iter.currentValue() ; 3834 3831 stringstream ss ; 3835 3832 ss << "SELECT FROM $1 WHERE " 3836 << "BEAMNO==" << ids [0]<< "&&"3837 << "POLNO==" << ids [1]<< "&&"3838 << "IFNO==" << ids [2];3833 << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&" 3834 << "POLNO==" << ids.asuInt("POLNO") << "&&" 3835 << "IFNO==" << ids.asuInt("IFNO") ; 3839 3836 //cout << "TaQL string: " << ss.str() << endl ; 3840 3837 sel.setTaQL( ss.str() ) ; … … 3842 3839 ahothi->setSelection( sel ) ; 3843 3840 askyhi->setSelection( sel ) ; 3844 Vector<uInt> rows = iter ->getRows( SHARE ) ;3841 Vector<uInt> rows = iter.getRows( SHARE ) ; 3845 3842 calibrateCW( sref, rref, aoffhi, askyhi, ahothi, acoldhi, rows, antname ) ; 3846 3843 aoffhi->unsetSelection() ; … … 3848 3845 askyhi->unsetSelection() ; 3849 3846 sel.reset() ; 3850 iter->next() ; 3851 } 3852 delete iter ; 3847 iter.next() ; 3848 } 3853 3849 } 3854 3850 } … … 3902 3898 cols[1] = "POLNO" ; 3903 3899 cols[2] = "IFNO" ; 3904 STIdxIter *iter = new STIdxIterAcc( ssig, cols );3905 while ( !iter ->pastEnd() ) {3906 Vector<uInt> ids = iter->current() ;3900 STIdxIter2 iter(ssig, cols); 3901 while ( !iter.pastEnd() ) { 3902 Record ids = iter.currentValue() ; 3907 3903 stringstream ss ; 3908 3904 ss << "SELECT FROM $1 WHERE " 3909 << "BEAMNO==" << ids [0]<< "&&"3910 << "POLNO==" << ids [1]<< "&&"3911 << "IFNO==" << ids [2];3905 << "BEAMNO==" << ids.asuInt("BEAMNO") << "&&" 3906 << "POLNO==" << ids.asuInt("POLNO") << "&&" 3907 << "IFNO==" << ids.asuInt("IFNO") ; 3912 3908 //cout << "TaQL string: " << ss.str() << endl ; 3913 3909 sel.setTaQL( ss.str() ) ; 3914 3910 ahot->setSelection( sel ) ; 3915 3911 asky->setSelection( sel ) ; 3916 Vector<uInt> rows = iter ->getRows( SHARE ) ;3912 Vector<uInt> rows = iter.getRows( SHARE ) ; 3917 3913 // out should be an exact copy of s except that SPECTRA column is empty 3918 3914 calibrateFS( ssig, sref, rsig, rref, asky, ahot, acold, rows ) ; … … 3920 3916 asky->unsetSelection() ; 3921 3917 sel.reset() ; 3922 iter->next() ; 3923 } 3924 delete iter ; 3918 iter.next() ; 3919 } 3925 3920 } 3926 3921 … … 4782 4777 cols[1] = "POLNO" ; 4783 4778 cols[2] = "BEAMNO" ; 4784 STIdxIter Acciter( s, cols ) ;4779 STIdxIter2 iter( s, cols ) ; 4785 4780 4786 4781 Table ttab = s->table() ; -
trunk/src/python_asap.cpp
r2832 r2916 88 88 asap::python::python_SrcType(); 89 89 asap::python::python_STGrid(); 90 asap::python::python_Iterator();90 //asap::python::python_Iterator(); 91 91 asap::python::python_EdgeMarker(); 92 92 asap::python::python_PlotHelper(); -
trunk/src/python_asap.h
r2832 r2916 55 55 void python_SrcType(); 56 56 void python_STGrid(); 57 void python_Iterator();57 //void python_Iterator(); 58 58 void python_EdgeMarker(); 59 59 void python_PlotHelper();
Note:
See TracChangeset
for help on using the changeset viewer.