Changeset 1315
- Timestamp:
- 01/30/07 20:59:42 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STLineFinder.cpp
r1016 r1315 50 50 // 51 51 // RunningBox - a running box calculator. This class implements 52 // i nterations over the specified spectrum and calculates52 // iterations over the specified spectrum and calculates 53 53 // running box filter statistics. 54 54 // … … 399 399 if (last_sign && last_sign!=getAboveMeanSign()) 400 400 detect=False; 401 402 403 404 405 406 407 408 409 410 411 401 } 402 if (detect) { 403 last_sign=getAboveMeanSign(); 404 if (is_detected_before) 405 cur_line.second=running_box->getChannel()+1; 406 else { 407 is_detected_before=True; 408 cur_line.first=running_box->getChannel(); 409 cur_line.second=running_box->getChannel()+1; 410 } 411 } else processCurLine(mask); 412 412 } 413 413 catch (const AipsError &ae) { … … 426 426 try { 427 427 if (is_detected_before) { 428 if (cur_line.second-cur_line.first> min_nchan) {428 if (cur_line.second-cur_line.first>=min_nchan) { 429 429 // it was a detection. We need to change the list 430 430 Bool add_new_line=False; … … 517 517 signs[ch]=getAboveMeanSign(); 518 518 // os<<ch<<" "<<spectrum[ch]<<" "<<fabs(running_box->aboveMean())<<" "<< 519 // 519 // threshold*offline_variance<<endl; 520 520 521 521 const Float buf=running_box->aboveMean(); … … 523 523 else if (buf<0) signs[ch]=-1; 524 524 else if (buf==0) signs[ch]=0; 525 //os<<ch<<" "<<spectrum[ch]<<" "<<running_box->getLinMean()<<" "<<526 //threshold*offline_variance<<endl;525 //os<<ch<<" "<<spectrum[ch]<<" "<<running_box->getLinMean()<<" "<< 526 // threshold*offline_variance<<endl; 527 527 } 528 528 if (lines.size()) … … 768 768 // nothing new - proceed to the next step of averaging, if any 769 769 // (to search for broad lines) 770 if (avg_factor> avg_limit) break; // averaging up to avg_limit770 if (avg_factor>=avg_limit) break; // averaging up to avg_limit 771 771 // adjacent channels, 772 772 // stop after that … … 775 775 averageAdjacentChannels(temp_mask,avg_factor); 776 776 continue; 777 } 777 } 778 778 keepStrongestOnly(temp_mask,new_lines,max_box_nchan); 779 779 // update the list (lines) merging intervals, if necessary … … 951 951 // they will be find again at the next iteration. This approach 952 952 // increases the number of iterations required, but is able to remove 953 // the sidelobes likely to occur near strong lines.953 // spurious detections likely to occur near strong lines. 954 954 // Later a better criterion may be implemented, e.g. 955 955 // taking into consideration the brightness of different lines. Now
Note:
See TracChangeset
for help on using the changeset viewer.