Changeset 1641


Ignore:
Timestamp:
10/02/09 15:34:14 (15 years ago)
Author:
Max Voronkov
Message:

fixed ticket:174 - flagging information is now taken into account

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STLineFinder.cpp

    r1497 r1641  
    474474      running_box=new RunningBox(spectrum,mask,edge,max_box_nchan);
    475475
    476 
    477476      // determine the off-line variance first
    478477      // an assumption made: lines occupy a small part of the spectrum
     
    516515
    517516           signs[ch]=getAboveMeanSign();
    518            // os<<ch<<" "<<spectrum[ch]<<" "<<fabs(running_box->aboveMean())<<" "<<
    519            // threshold*offline_variance<<endl;
    520 
    521            const Float buf=running_box->aboveMean();
    522            if (buf>0) signs[ch]=1;
    523            else if (buf<0) signs[ch]=-1;
    524            else if (buf==0) signs[ch]=0;
    525            //os<<ch<<" "<<spectrum[ch]<<" "<<running_box->getLinMean()<<" "<<
    526            //             threshold*offline_variance<<endl;
     517            //os<<ch<<" "<<spectrum[ch]<<" "<<fabs(running_box->aboveMean())<<" "<<
     518            //threshold*offline_variance<<endl;
    527519      }
    528520      if (lines.size())
     
    700692      throw AipsError("STLineFinder::findLines - in_scan and in_mask have different"
    701693            "number of spectral channels.");
     694
     695  // taking flagged channels into account
     696  vector<bool> flaggedChannels = scan->getMask(whichRow);
     697  if (flaggedChannels.size()) {
     698      // there is a mask set for this row
     699      if (flaggedChannels.size() != mask.nelements()) {
     700          throw AipsError("STLineFinder::findLines - internal inconsistency: number of mask elements do not match the number of channels");
     701      }
     702      for (size_t ch = 0; ch<mask.nelements(); ++ch) {
     703           mask[ch] &= flaggedChannels[ch];
     704      }
     705  }
     706
    702707  // number of elements in in_edge
    703708  if (in_edge.size()>2)
Note: See TracChangeset for help on using the changeset viewer.