Changeset 924
- Timestamp:
- 03/24/06 13:33:17 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STLineFinder.cpp
r907 r924 192 192 void processCurLine(const casa::Vector<casa::Bool> &mask) 193 193 throw(casa::AipsError); 194 194 195 195 // get the sign of runningBox->aboveMean(). The RunningBox pointer 196 196 // should be defined … … 519 519 // os<<ch<<" "<<spectrum[ch]<<" "<<fabs(running_box->aboveMean())<<" "<< 520 520 // threshold*offline_variance<<endl; 521 521 522 522 const Float buf=running_box->aboveMean(); 523 523 if (buf>0) signs[ch]=1; … … 670 670 scan=in_scan.getCP(); 671 671 AlwaysAssert(!scan.null(),AipsError); 672 672 673 673 } 674 674 … … 688 688 throw AipsError("STLineFinder::findLines - a scan should be set first," 689 689 " use set_scan"); 690 690 691 uInt nchan = scan->nchan(scan->getIF(whichRow)); 691 692 // set up mask and edge rejection 692 mask=in_mask; 693 if (mask.nelements()!=scan->nchan(whichRow)) 693 // no mask given... 694 if (in_mask.size() == 0) { 695 mask = Vector<Bool>(nchan,True); 696 } else { 697 // use provided mask 698 mask=Vector<Bool>(in_mask); 699 } 700 if (mask.nelements()!=nchan) 694 701 throw AipsError("STLineFinder::findLines - in_scan and in_mask have different" 695 702 "number of spectral channels."); 696 703 cout << mask.nelements() << endl; 697 704 // number of elements in in_edge 698 705 if (in_edge.size()>2) … … 702 709 // all spectra, no rejection 703 710 edge.first=0; 704 edge.second= scan->nchan(whichRow);711 edge.second=nchan; 705 712 } else { 706 713 edge.first=in_edge[0]; … … 708 715 throw AipsError("STLineFinder::findLines - the in_edge parameter has a negative" 709 716 "number of channels to drop"); 710 if (edge.first>= scan->nchan(whichRow))717 if (edge.first>=nchan) 711 718 throw AipsError("STLineFinder::findLines - all channels are rejected by the in_edge parameter"); 712 719 if (in_edge.size()==2) { … … 715 722 throw AipsError("STLineFinder::findLines - the in_edge parameter has a negative" 716 723 "number of channels to drop"); 717 edge.second= scan->nchan(whichRow)-edge.second;718 } else edge.second= scan->nchan(whichRow)-edge.first;724 edge.second=nchan-edge.second; 725 } else edge.second=nchan-edge.first; 719 726 if (edge.second<0 || (edge.first>=edge.second)) 720 727 throw AipsError("STLineFinder::findLines - all channels are rejected by the in_edge parameter"); 721 728 } 722 729 723 730 // 724 int max_box_nchan=int( scan->nchan(whichRow)*box_size); // number of channels in running731 int max_box_nchan=int(nchan*box_size); // number of channels in running 725 732 // box 726 733 if (max_box_nchan<2) … … 856 863 throw AipsError("STLineFinder::getMask - a scan should be set first," 857 864 " use set_scan followed by find_lines"); 858 DebugAssert(mask.nelements()==scan-> nchan(last_row_used), AipsError);865 DebugAssert(mask.nelements()==scan->getChannels(last_row_used), AipsError); 859 866 /* 860 867 if (!lines.size()) … … 915 922 throw AipsError("STLineFinder::getLineRangesInChannels - a scan should be set first," 916 923 " use set_scan followed by find_lines"); 917 DebugAssert(mask.nelements()==scan-> nchan(last_row_used), AipsError);924 DebugAssert(mask.nelements()==scan->getChannels(last_row_used), AipsError); 918 925 919 926 if (!lines.size())
Note:
See TracChangeset
for help on using the changeset viewer.