- Timestamp:
- 02/17/12 16:30:24 (13 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Scantable.cpp
r2410 r2411 2697 2697 } 2698 2698 2699 addAuxWaveNumbers( addNWaves, rejectNWaves, nWaves);2699 addAuxWaveNumbers(whichrow, addNWaves, rejectNWaves, nWaves); 2700 2700 } 2701 2701 … … 2779 2779 } 2780 2780 2781 void Scantable::addAuxWaveNumbers(const std::vector<int>& addNWaves, const std::vector<int>& rejectNWaves, std::vector<int>& nWaves) 2782 { 2781 void Scantable::addAuxWaveNumbers(const int whichrow, const std::vector<int>& addNWaves, const std::vector<int>& rejectNWaves, std::vector<int>& nWaves) 2782 { 2783 std::vector<int> tempAddNWaves, tempRejectNWaves; 2783 2784 for (uInt i = 0; i < addNWaves.size(); ++i) { 2785 tempAddNWaves.push_back(addNWaves[i]); 2786 } 2787 if ((tempAddNWaves.size() == 2) && (tempAddNWaves[1] == -999)) { 2788 setWaveNumberListUptoNyquistFreq(whichrow, tempAddNWaves); 2789 } 2790 2791 for (uInt i = 0; i < rejectNWaves.size(); ++i) { 2792 tempRejectNWaves.push_back(rejectNWaves[i]); 2793 } 2794 if ((tempRejectNWaves.size() == 2) && (tempRejectNWaves[1] == -999)) { 2795 setWaveNumberListUptoNyquistFreq(whichrow, tempRejectNWaves); 2796 } 2797 2798 for (uInt i = 0; i < tempAddNWaves.size(); ++i) { 2784 2799 bool found = false; 2785 2800 for (uInt j = 0; j < nWaves.size(); ++j) { 2786 if (nWaves[j] == addNWaves[i]) {2801 if (nWaves[j] == tempAddNWaves[i]) { 2787 2802 found = true; 2788 2803 break; 2789 2804 } 2790 2805 } 2791 if (!found) nWaves.push_back( addNWaves[i]);2792 } 2793 2794 for (uInt i = 0; i < rejectNWaves.size(); ++i) {2806 if (!found) nWaves.push_back(tempAddNWaves[i]); 2807 } 2808 2809 for (uInt i = 0; i < tempRejectNWaves.size(); ++i) { 2795 2810 for (std::vector<int>::iterator j = nWaves.begin(); j != nWaves.end(); ) { 2796 if (*j == rejectNWaves[i]) {2811 if (*j == tempRejectNWaves[i]) { 2797 2812 j = nWaves.erase(j); 2798 2813 } else { … … 2805 2820 sort(nWaves.begin(), nWaves.end()); 2806 2821 unique(nWaves.begin(), nWaves.end()); 2822 } 2823 } 2824 2825 void Scantable::setWaveNumberListUptoNyquistFreq(const int whichrow, std::vector<int>& nWaves) 2826 { 2827 if ((nWaves.size() == 2)&&(nWaves[1] == -999)) { 2828 int val = nWaves[0]; 2829 int nyquistFreq = nchan(getIF(whichrow))/2+1; 2830 nWaves.clear(); 2831 if (val > nyquistFreq) { // for safety, at least nWaves contains a constant; CAS-3759 2832 nWaves.push_back(0); 2833 } 2834 while (val <= nyquistFreq) { 2835 nWaves.push_back(val); 2836 val++; 2837 } 2807 2838 } 2808 2839 } … … 2844 2875 2845 2876 //FOR DEBUGGING------------ 2877 /* 2846 2878 if (whichrow < 0) {// == nRow -1) { 2847 2879 cout << "+++ i=" << setw(3) << whichrow << ", IF=" << setw(2) << getIF(whichrow); … … 2855 2887 cout << flush; 2856 2888 } 2889 */ 2857 2890 //------------------------- 2858 2891 -
trunk/src/Scantable.h
r2357 r2411 739 739 const std::string& fftThAttr, 740 740 std::vector<int>& nWaves); 741 void addAuxWaveNumbers(const std::vector<int>& addNWaves, 741 void addAuxWaveNumbers(const int whichrow, 742 const std::vector<int>& addNWaves, 742 743 const std::vector<int>& rejectNWaves, 743 744 std::vector<int>& nWaves); 745 void setWaveNumberListUptoNyquistFreq(const int whichrow, 746 std::vector<int>& nWaves); 744 747 bool hasSameNchanOverIFs(); 745 748 std::string getMaskRangeList(const std::vector<bool>& mask,
Note:
See TracChangeset
for help on using the changeset viewer.