Changeset 881 for trunk/src/SDLineFinder.h
- Timestamp:
- 03/08/06 11:58:43 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDLineFinder.h
r370 r881 1 1 //#--------------------------------------------------------------------------- 2 //# S DLineFinder.h: A class for automated spectral line search2 //# STLineFinder.h: A class for automated spectral line search 3 3 //#--------------------------------------------------------------------------- 4 4 //# Copyright (C) 2004 … … 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id: 29 //# $Id:$ 30 30 //#--------------------------------------------------------------------------- 31 #ifndef S DLINEFINDER_H32 #define S DLINEFINDER_H31 #ifndef STLINEFINDER_H 32 #define STLINEFINDER_H 33 33 34 34 // STL … … 49 49 50 50 // ASAP 51 #include "S DMemTableWrapper.h"52 #include "S DMemTable.h"51 #include "ScantableWrapper.h" 52 #include "Scantable.h" 53 53 54 54 namespace asap { … … 60 60 // 61 61 62 struct 62 struct LFLineListOperations { 63 63 // 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 65 65 // the new line 66 66 static void addNewSearchResult(const std::list<std::pair<int, int> > … … 79 79 throw(casa::AipsError); 80 80 protected: 81 81 82 82 // An auxiliary object function to test whether two lines have a non-void 83 83 // intersection … … 105 105 const std::pair<int,int>& result() const throw(); 106 106 }; 107 107 108 108 // An auxiliary object function to test whether a specified line 109 109 // is at lower spectral channels (to preserve the order in the line list) … … 117 117 // in the ordered list (so, it is at greater channel numbers) 118 118 bool operator()(const std::pair<int,int> &line2) const throw(); 119 }; 120 121 119 }; 120 121 122 122 }; 123 123 … … 127 127 /////////////////////////////////////////////////////////////////////////////// 128 128 // 129 // S DLineFinder - a class for automated spectral line search130 // 131 // 132 133 struct S DLineFinder : protected LFLineListOperations {134 S DLineFinder() throw();135 virtual ~S DLineFinder() throw(casa::AipsError);129 // STLineFinder - a class for automated spectral line search 130 // 131 // 132 133 struct STLineFinder : protected LFLineListOperations { 134 STLineFinder() throw(); 135 virtual ~STLineFinder() throw(casa::AipsError); 136 136 137 137 // set the parameters controlling algorithm … … 145 145 // in_avg_limit perform the averaging of no more than in_avg_limit 146 146 // 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 148 148 // parameter should be decreased (may be even down to a 149 149 // minimum of 1 to disable this option) to avoid 150 150 // 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. 153 153 // in_box_size the box size for running mean calculation. Default is 154 154 // 1./5. of the whole spectrum size … … 164 164 // channels to drop from both sides of the spectrum 165 165 // in_edge is introduced for convinience, although all functionality 166 // can be achieved using a spectrum mask only 167 void setScan(const S DMemTableWrapper &in_scan,166 // can be achieved using a spectrum mask only 167 void setScan(const ScantableWrapper &in_scan, 168 168 const std::vector<bool> &in_mask, 169 169 const boost::python::tuple &in_edge) throw(casa::AipsError); … … 171 171 // search for spectral lines for a row specified by whichRow and 172 172 // 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 174 174 int findLines(const casa::uInt &whichRow = 0) throw(casa::AipsError); 175 175 … … 182 182 183 183 // 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). 185 185 std::vector<double> getLineRanges() const throw(casa::AipsError); 186 186 // The same as getLineRanges, but channels are always used to specify … … 203 203 void subtractBaseline(const casa::Vector<casa::Bool> &temp_mask, 204 204 const casa::Int &order) throw(casa::AipsError); 205 205 206 206 // an auxiliary function to remove all lines from the list, except the 207 207 // 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 210 210 // the sidelobes likely to occur near strong lines. 211 211 // Later a better criterion may be implemented, e.g. 212 212 // taking into consideration the brightness of different lines. Now 213 // use the simplest solution 213 // use the simplest solution 214 214 // temp_mask - mask to work with (may be different from original mask as 215 215 // the lines previously found may be masked) … … 222 222 throw (casa::AipsError); 223 223 private: 224 casa::CountedConstPtr<S DMemTable> scan; // the scan to work with224 casa::CountedConstPtr<Scantable> scan; // the scan to work with 225 225 casa::Vector<casa::Bool> mask; // associated mask 226 226 std::pair<int,int> edge; // start and stop+1 channels 227 227 // to work with 228 casa::Float threshold; // detection threshold - the 228 casa::Float threshold; // detection threshold - the 229 229 // minimal signal to noise ratio 230 230 casa::Double box_size; // size of the box for running … … 251 251 252 252 } // namespace asap 253 #endif // #ifndef S DLINEFINDER_H253 #endif // #ifndef STLINEFINDER_H
Note: See TracChangeset
for help on using the changeset viewer.