- Timestamp:
- 03/10/05 13:54:16 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDLineFinder.cc
r516 r551 147 147 // (pair: start and stop+1 channel) 148 148 RunningBox *running_box; // running box filter 149 casa::Vector<Int> signs; // An array to store the signs of 150 // the value - current mean 151 // (used to search wings) 149 152 public: 150 153 … … 157 160 // replace the detection criterion 158 161 void setCriterion(int in_min_nchan, casa::Float in_threshold) throw(); 162 163 // return the array with signs of the value-current mean 164 // An element is +1 if value>mean, -1 if less, 0 if equal. 165 // This array is updated each time the findLines method is called and 166 // is used to search the line wings 167 const casa::Vector<Int>& getSigns() const throw(); 159 168 160 169 // find spectral lines and add them into list … … 417 426 throw AipsError(String("LFAboveThreshold::processCurLine - STL error: ")+ex.what()); 418 427 } 428 } 429 430 // return the array with signs of the value-current mean 431 // An element is +1 if value>mean, -1 if less, 0 if equal. 432 // This array is updated each time the findLines method is called and 433 // is used to search the line wings 434 const casa::Vector<Int>& LFAboveThreshold::getSigns() const throw() 435 { 436 return signs; 419 437 } 420 438 … … 459 477 // actual search algorithm 460 478 is_detected_before=False; 461 Vector<Int> signs(spectrum.nelements(),0); 479 480 // initiate the signs array 481 signs.resize(spectrum.nelements()); 482 signs=Vector<Int>(spectrum.nelements(),0); 462 483 463 484 //ofstream os("dbg.dat"); … … 694 715 // instead, min_nchan is also scaled 695 716 // it helps to search for broad lines 717 Vector<Int> signs; // a buffer for signs of the value - mean quantity 718 // see LFAboveThreshold for details 719 // We need only signs resulted from last iteration 720 // because all previous values may be corrupted by the 721 // presence of spectral lines 696 722 while (true) { 697 723 // a buffer for new lines found at this iteration … … 702 728 LFAboveThreshold lfalg(new_lines,avg_factor*min_nchan, threshold); 703 729 lfalg.findLines(spectrum,temp_mask,edge,max_box_nchan); 730 signs.resize(lfalg.getSigns().nelements()); 731 signs=lfalg.getSigns(); 704 732 first_pass=False; 705 733 if (!new_lines.size()) … … 725 753 temp_mask=getMask(); 726 754 } 755 756 // an additional search for wings because in the presence of very strong 757 // lines temporary mean used at each iteration will be higher than 758 // the true mean 759 760 if (lines.size()) 761 LFLineListOperations::searchForWings(lines,signs,mask,edge); 762 727 763 return int(lines.size()); 728 764 }
Note:
See TracChangeset
for help on using the changeset viewer.