Ignore:
Timestamp:
02/02/05 16:31:38 (19 years ago)
Author:
vor010
Message:

SDLineFinder - further interface changes to achieve a better structure of the program

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDLineFinder.h

    r344 r352  
    5454namespace asap {
    5555
    56 // SDLineFinder  -  a class for automated spectral line search
    57 struct SDLineFinder {
    58    SDLineFinder() throw();
    59    virtual ~SDLineFinder() throw(casa::AipsError);
     56///////////////////////////////////////////////////////////////////////////////
     57//
     58// LFLineListOperations - a class incapsulating  operations with line lists
     59//                        The LF prefix stands for Line Finder
     60//
    6061
    61    // set the scan to work with (in_scan parameter), associated mask (in_mask
    62    // parameter) and the edge channel rejection (in_edge parameter)
    63    //   if in_edge has zero length, all channels chosen by mask will be used
    64    //   if in_edge has one element only, it represents the number of
    65    //      channels to drop from both sides of the spectrum
    66    //   in_edge is introduced for convinience, although all functionality
    67    //   can be achieved using a spectrum mask only   
    68    void setScan(const SDMemTableWrapper &in_scan,
    69                 const std::vector<bool> &in_mask,
    70                 const boost::python::tuple &in_edge) throw(casa::AipsError);
    71 
    72    // search for spectral lines. Number of lines found is returned
    73    int findLines() throw(casa::AipsError);
    74 
    75    // get the mask to mask out all lines that have been found (default)
    76    // if invert=true, only channels belong to lines will be unmasked
    77    // Note: all channels originally masked by the input mask (in_mask
    78    //       in setScan) or dropped out by the edge parameter (in_edge
    79    //       in setScan) are still excluded regardless on the invert option
    80    std::vector<bool> getMask(bool invert=false) const throw(casa::AipsError);
    81 
    82    // get range for all lines found. If defunits is true (default), the
    83    // same units as used in the scan will be returned (e.g. velocity
    84    // instead of channels). If defunits is false, channels will be returned
    85    std::vector<int>   getLineRanges(bool defunits=true)
    86                                 const throw(casa::AipsError);
    87 protected:
     62struct  LFLineListOperations {
    8863   // concatenate two lists preserving the order. If two lines appear to
    8964   // be adjacent or have a non-void intersection, they are joined into
     
    9873   // the detection threshold. If lines becomes adjacent, they are
    9974   // merged together. Any masked channel stops the extension
    100    void searchForWings(std::list<std::pair<int, int> > &newlines,
    101                            const casa::Vector<casa::Int> &signs)
     75   static void searchForWings(std::list<std::pair<int, int> > &newlines,
     76                       const casa::Vector<casa::Int> &signs,
     77                       const casa::Vector<casa::Bool> &mask,
     78                       const std::pair<int,int> &edge)
    10279                           throw(casa::AipsError);
    103                            
     80protected:
     81           
    10482   // An auxiliary object function to test whether two lines have a non-void
    10583   // intersection
     
    141119   };
    142120   
     121   
     122};
     123
     124//
     125///////////////////////////////////////////////////////////////////////////////
     126
     127///////////////////////////////////////////////////////////////////////////////
     128//
     129// SDLineFinder  -  a class for automated spectral line search
     130//
     131//
     132
     133struct SDLineFinder : protected LFLineListOperations {
     134   SDLineFinder() throw();
     135   virtual ~SDLineFinder() throw(casa::AipsError);
     136
     137   // set the scan to work with (in_scan parameter), associated mask (in_mask
     138   // parameter) and the edge channel rejection (in_edge parameter)
     139   //   if in_edge has zero length, all channels chosen by mask will be used
     140   //   if in_edge has one element only, it represents the number of
     141   //      channels to drop from both sides of the spectrum
     142   //   in_edge is introduced for convinience, although all functionality
     143   //   can be achieved using a spectrum mask only   
     144   void setScan(const SDMemTableWrapper &in_scan,
     145                const std::vector<bool> &in_mask,
     146                const boost::python::tuple &in_edge) throw(casa::AipsError);
     147
     148   // search for spectral lines. Number of lines found is returned
     149   int findLines() throw(casa::AipsError);
     150
     151   // get the mask to mask out all lines that have been found (default)
     152   // if invert=true, only channels belong to lines will be unmasked
     153   // Note: all channels originally masked by the input mask (in_mask
     154   //       in setScan) or dropped out by the edge parameter (in_edge
     155   //       in setScan) are still excluded regardless on the invert option
     156   std::vector<bool> getMask(bool invert=false) const throw(casa::AipsError);
     157
     158   // get range for all lines found. If defunits is true (default), the
     159   // same units as used in the scan will be returned (e.g. velocity
     160   // instead of channels). If defunits is false, channels will be returned
     161   std::vector<int>   getLineRanges(bool defunits=true)
     162                                const throw(casa::AipsError);
    143163private:
    144164   casa::CountedConstPtr<SDMemTable> scan; // the scan to work with
     
    159179   // a buffer for the spectrum
    160180   mutable casa::Vector<casa::Float>  spectrum;
     181};
    161182
    162 };
     183//
     184///////////////////////////////////////////////////////////////////////////////
     185
    163186} // namespace asap
    164187#endif // #ifndef SDLINEFINDER_H
Note: See TracChangeset for help on using the changeset viewer.