casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImageSourceFinder.h
Go to the documentation of this file.
1 //# ImageSourceFinder.h: find sources in image
2 //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id: ImageSourceFinder.h 20299 2008-04-03 05:56:44Z gervandiepen $
28 
29 #ifndef IMAGES_IMAGESOURCEFINDER_H
30 #define IMAGES_IMAGESOURCEFINDER_H
31 
32 #include <casa/aips.h>
36 
37 namespace casacore{
38 
39 template <class T> class ImageInterface;
40 template <class T> class Vector;
41 class LogIO;
42 }
43 
44 namespace casa { //# NAMESPACE CASA - BEGIN
45 
46 //# Forward Declarations
47 class ComponentList;
48 class SkyComponent;
49 
50 
51 // <summary>
52 // Provides functionality to find sources in an image
53 // </summary>
54 
55 // <use visibility=export>
56 
57 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
58 // </reviewed>
59 
60 // <prerequisite>
61 // <li> <linkto class=casacore::ImageInterface>ImageInterface</linkto>
62 // <li> <linkto module=Coordinates>Coordinates</linkto>
63 // </prerequisite>
64 
65 // <etymology>
66 // It finds sources.
67 // </etymology>
68 
69 
70 // <synopsis>
71 // This class provides methods to find sources in an image.
72 //
73 // The finding procedes in two stages. First, strong point sources
74 // are found via an efficient algorithm producing POINT components.
75 // If you wish, you can further request a Gaussian fit to these
76 // found point sources and then return the parameters of the
77 // fit (as a GAUSIAN component).
78 // </synopsis>
79 
80 // <example>
81 // <srcBlock>
82 // </srcBlock>
83 // </example>
84 
85 // <motivation>
86 // This complements source fitting by providing an initial estimate
87 // </motivation>
88 
89 // <todo asof="2000/11/08">
90 // </todo>
91 
92 
93 template <class T> class ImageSourceFinder : public ImageTask<T> {
94 public:
95 
96  ImageSourceFinder() = delete;
97 
98  ImageSourceFinder(SPCIIT image, const casacore::Record *const region, const casacore::String& mask);
99 
100  ImageSourceFinder (const ImageSourceFinder<T> &other) = delete;
101 
103 
104  ImageSourceFinder<T> &operator=(const ImageSourceFinder<T> &other) = delete;
105 
106  // Find strong sources. nMax specifies the maximum number of sources to find.
107  // cutoff is the fractional cutoff (of peak) and soiurces below this limit
108  // will not be found. If absFind is true, only positive sources are found, else
109  // positive and negative are found. If doPoint=true, the returned components
110  // are of type POINT. If doPoint=false, the position and shape information is
111  // returned via a Gaussian fit (and components will be of
112  // type GAUSSIAN) to the point sources initially found. The parameter width
113  // specifies the half-width of a square grid of pixels centered on the initial
114  // point source location to be used in the fit. If you set doPoint=false and width=0,
115  // a default width of 3 and position angle 0 is returned in the GAUSSIAN component.
116  // Because the flux of the component is integrated, this rough shape influences the
117  // flux values as well.
119 
120  // Find one source in sky plane. Exception if no sky
122 
123  void setCutoff(casacore::Double cutoff) { _cutoff = cutoff; }
124 
126 
127  void setDoPoint(casacore::Bool dp) { _doPoint = dp; }
128 
129  void setWidth(casacore::Int w) { _width = w; }
130 
132  const static casacore::String x = "ImageSourceFinder";
133  return x;
134  }
135 
136 protected:
137 
140  }
141 
142  // Represents the minimum set of coordinates necessary for the
143  // task to function.
144  std::vector<casacore::Coordinate::Type> _getNecessaryCoordinates() const {
145  return std::vector<casacore::Coordinate::Type>(1, casacore::Coordinate::DIRECTION);
146  }
147 
148  inline casacore::Bool _supportsMultipleRegions() const {return true;}
149 
150  inline casacore::Bool _supportsMultipleBeams() const {return false;}
151 
152 
153 private:
158 
159  // Find strong (point) sources
161 };
162 
163 
164 }
165 
166 #ifndef CASACORE_NO_AUTO_TEMPLATES
167 #include <imageanalysis/ImageAnalysis/ImageSourceFinder.tcc>
168 #endif
169 #endif
A 1-D Specialization of the Array class.
int Int
Definition: aipstype.h:50
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
ostream-like interface to creating log messages.
Definition: LogIO.h:167
casacore::String getClass() const
ImageSourceFinder< T > & operator=(const ImageSourceFinder< T > &other)=delete
std::vector< casacore::Coordinate::Type > _getNecessaryCoordinates() const
Represents the minimum set of coordinates necessary for the task to function.
std::vector< double > af(const casacore::Vector< t > &other)
Definition: Conversion.h:56
A base class for astronomical images.
double Double
Definition: aipstype.h:55
void setAbsFind(casacore::Bool af)
SkyComponent findSourceInSky(casacore::Vector< casacore::Double > &absPixel)
Find one source in sky plane.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ComponentList findSources(casacore::Int nMax)
Find strong sources.
#define SPCIIT
Definition: ImageTypedefs.h:35
ComponentList _findSources(casacore::Int nMax)
Find strong (point) sources.
casacore::Bool _supportsMultipleRegions() const
casacore::Bool _supportsMultipleBeams() const
does this task support images with multiple beams? false means it never does.
Provides functionality to find sources in an image.
CasacRegionManager::StokesControl _getStokesControl() const
void setDoPoint(casacore::Bool dp)
void setWidth(casacore::Int w)
A class for manipulating groups of components.
A component of a model of the sky.
Definition: SkyComponent.h:130
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void setCutoff(casacore::Double cutoff)
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42