Changeset 2916 for trunk/src/STMath.cpp
- Timestamp:
- 04/03/14 13:45:09 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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() ;
Note: See TracChangeset
for help on using the changeset viewer.