Ignore:
Timestamp:
03/08/06 11:58:43 (18 years ago)
Author:
mar637
Message:

added linefinder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDLineFinder.h

    r370 r881  
    11//#---------------------------------------------------------------------------
    2 //# SDLineFinder.h: A class for automated spectral line search
     2//# STLineFinder.h: A class for automated spectral line search
    33//#---------------------------------------------------------------------------
    44//# Copyright (C) 2004
     
    2727//#                        AUSTRALIA
    2828//#
    29 //# $Id:
     29//# $Id:$
    3030//#---------------------------------------------------------------------------
    31 #ifndef SDLINEFINDER_H
    32 #define SDLINEFINDER_H
     31#ifndef STLINEFINDER_H
     32#define STLINEFINDER_H
    3333
    3434// STL
     
    4949
    5050// ASAP
    51 #include "SDMemTableWrapper.h"
    52 #include "SDMemTable.h"
     51#include "ScantableWrapper.h"
     52#include "Scantable.h"
    5353
    5454namespace asap {
     
    6060//
    6161
    62 struct  LFLineListOperations {
     62struct LFLineListOperations {
    6363   // concatenate two lists preserving the order. If two lines appear to
    64    // be adjacent or have a non-void intersection, they are joined into 
     64   // be adjacent or have a non-void intersection, they are joined into
    6565   // the new line
    6666   static void addNewSearchResult(const std::list<std::pair<int, int> >
     
    7979                           throw(casa::AipsError);
    8080protected:
    81            
     81
    8282   // An auxiliary object function to test whether two lines have a non-void
    8383   // intersection
     
    105105        const std::pair<int,int>& result() const throw();
    106106   };
    107    
     107
    108108   // An auxiliary object function to test whether a specified line
    109109   // is at lower spectral channels (to preserve the order in the line list)
     
    117117        // in the ordered list (so, it is at greater channel numbers)
    118118        bool operator()(const std::pair<int,int> &line2) const throw();
    119    }; 
    120    
    121    
     119   };
     120
     121
    122122};
    123123
     
    127127///////////////////////////////////////////////////////////////////////////////
    128128//
    129 // SDLineFinder  -  a class for automated spectral line search
    130 //
    131 //
    132 
    133 struct SDLineFinder : protected LFLineListOperations {
    134    SDLineFinder() throw();
    135    virtual ~SDLineFinder() throw(casa::AipsError);
     129// STLineFinder  -  a class for automated spectral line search
     130//
     131//
     132
     133struct STLineFinder : protected LFLineListOperations {
     134   STLineFinder() throw();
     135   virtual ~STLineFinder() throw(casa::AipsError);
    136136
    137137   // set the parameters controlling algorithm
     
    145145   // in_avg_limit perform the averaging of no more than in_avg_limit
    146146   //              adjacent channels to search for broad lines
    147    //              Default is 8, but for a bad baseline shape this 
     147   //              Default is 8, but for a bad baseline shape this
    148148   //              parameter should be decreased (may be even down to a
    149149   //              minimum of 1 to disable this option) to avoid
    150150   //              confusing of baseline undulations with a real line.
    151    //              Setting a very large value doesn't usually provide 
    152    //              valid detections. 
     151   //              Setting a very large value doesn't usually provide
     152   //              valid detections.
    153153   // in_box_size  the box size for running mean calculation. Default is
    154154   //              1./5. of the whole spectrum size
     
    164164   //      channels to drop from both sides of the spectrum
    165165   //   in_edge is introduced for convinience, although all functionality
    166    //   can be achieved using a spectrum mask only   
    167    void setScan(const SDMemTableWrapper &in_scan,
     166   //   can be achieved using a spectrum mask only
     167   void setScan(const ScantableWrapper &in_scan,
    168168                const std::vector<bool> &in_mask,
    169169                const boost::python::tuple &in_edge) throw(casa::AipsError);
     
    171171   // search for spectral lines for a row specified by whichRow and
    172172   // Beam/IF/Pol specified by current cursor set for the scantable
    173    // Number of lines found is returned   
     173   // Number of lines found is returned
    174174   int findLines(const casa::uInt &whichRow = 0) throw(casa::AipsError);
    175175
     
    182182
    183183   // get range for all lines found. The same units as used in the scan
    184    // will be returned (e.g. velocity instead of channels).   
     184   // will be returned (e.g. velocity instead of channels).
    185185   std::vector<double>   getLineRanges() const throw(casa::AipsError);
    186186   // The same as getLineRanges, but channels are always used to specify
     
    203203   void subtractBaseline(const casa::Vector<casa::Bool> &temp_mask,
    204204                         const casa::Int &order) throw(casa::AipsError);
    205    
     205
    206206   // an auxiliary function to remove all lines from the list, except the
    207207   // strongest one (by absolute value). If the lines removed are real,
    208    // they will be find again at the next iteration. This approach 
    209    // increases the number of iterations required, but is able to remove 
     208   // they will be find again at the next iteration. This approach
     209   // increases the number of iterations required, but is able to remove
    210210   // the sidelobes likely to occur near strong lines.
    211211   // Later a better criterion may be implemented, e.g.
    212212   // taking into consideration the brightness of different lines. Now
    213    // use the simplest solution     
     213   // use the simplest solution
    214214   // temp_mask - mask to work with (may be different from original mask as
    215215   // the lines previously found may be masked)
     
    222222                                      throw (casa::AipsError);
    223223private:
    224    casa::CountedConstPtr<SDMemTable> scan; // the scan to work with
     224   casa::CountedConstPtr<Scantable> scan; // the scan to work with
    225225   casa::Vector<casa::Bool> mask;          // associated mask
    226226   std::pair<int,int> edge;                // start and stop+1 channels
    227227                                           // to work with
    228    casa::Float threshold;                  // detection threshold - the 
     228   casa::Float threshold;                  // detection threshold - the
    229229                                           // minimal signal to noise ratio
    230230   casa::Double box_size;                  // size of the box for running
     
    251251
    252252} // namespace asap
    253 #endif // #ifndef SDLINEFINDER_H
     253#endif // #ifndef STLINEFINDER_H
Note: See TracChangeset for help on using the changeset viewer.