Ignore:
Timestamp:
01/31/05 15:48:36 (19 years ago)
Author:
vor010
Message:

Line searching algorithm is now in the separate
class LFRunningMean. It allows to run the same code several passes for different
masks, criteria, etc. In the future this interface may be more readily modified
to have multiple algorithms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDLineFinder.h

    r297 r331  
    8585   std::vector<int>   getLineRanges(bool defunits=true)
    8686                                const throw(casa::AipsError);
    87    
    8887protected:
    89    // supplementary function to control running mean calculations.
    90    // It adds a specified channel to the running mean box and
    91    // removes (ch-maxboxnchan+1)'th channel from there
    92    // Channels, for which the mask is false or index is beyond the
    93    // allowed range, are ignored
    94    void advanceRunningBox(int ch) throw(casa::AipsError);
    95    
    96 
    97    // test a channel against current running mean & rms
    98    // if channel specified is masked out or beyond the allowed indexes,
    99    // false is returned
    100    casa::Bool testChannel(int ch) throw(std::exception, casa::AipsError);
    101 
    102    // process a channel: update curline and is_detected before and
    103    // add a new line to the list, if necessary using processCurLine()
    104    void processChannel(int ch) throw(casa::AipsError);
    105 
    106    // process the interval of channels stored in curline
    107    // if it satisfies the criterion, add this interval as a new line
    108    void processCurLine() throw(casa::AipsError);
    109    
     88   // concatenate two lists preserving the order. If two lines appear to
     89   // be adjacent, they are joined into the new one
     90   void addNewSearchResult(const std::list<std::pair<int, int> > &newlines)
     91                           throw(casa::AipsError);
    11092private:
    11193   casa::CountedConstPtr<SDMemTable> scan; // the scan to work with
     
    124106   std::list<std::pair<int, int> > lines;  // container of start and stop+1
    125107                                           // channels of the spectral lines
    126    // statistics for running mean filtering
    127    casa::Float sum;       // sum of fluxes
    128    casa::Float sumsq;     // sum of squares of fluxes
    129    int box_chan_cntr;     // actual number of channels in the box
    130    int max_box_nchan;     // maximum allowed number of channels in the box
    131                           // (calculated from boxsize and actual spectrum size)
    132108   // a buffer for the spectrum
    133109   mutable casa::Vector<casa::Float>  spectrum;
    134110
    135    // temporary line edge channels and flag, which is True if the line
    136    // was detected in the previous channels.
    137    std::pair<int,int> cur_line;
    138    casa::Bool is_detected_before;
    139111};
    140112} // namespace asap
Note: See TracChangeset for help on using the changeset viewer.