VectorKernel.h

Go to the documentation of this file.
00001 //# VectorKernel.h: generate Vector kernels
00002 //# Copyright (C) 1996,1997,1998,1999,2000,2001
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id$
00027 
00028 #ifndef SCIMATH_VECTORKERNEL_H
00029 #define SCIMATH_VECTORKERNEL_H
00030 
00031 
00032 //# Includes
00033 #include <casacore/casa/aips.h>
00034 #include <casacore/casa/Arrays/Vector.h>
00035 
00036 namespace casacore { //# NAMESPACE CASACORE - BEGIN
00037 
00038 //# Forward Declarations
00039 class Regex;
00040 class String;
00041 
00042 // <summary>
00043 // Make a Vector smoothing kernel from a kernel specification
00044 // </summary>
00045 
00046 // <use visibility=export>
00047 
00048 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00049 // </reviewed>
00050 
00051 // <prerequisite>
00052 //   <li> <linkto class="Vector">Vector</linkto>
00053 // </prerequisite>
00054 
00055 // <etymology>
00056 // Returns a vector from a smoothing kernel specification.
00057 // </etymology>
00058 
00059 // <synopsis>
00060 // This class takes a smoothing kernel type and a width, and
00061 // generates  a Vector holding that kernel.  It can be used
00062 // in conjunction with the separable image convolver,
00063 // SepImageConvolver
00064 //
00065 // The kernels can be normalized so that the peak of the
00066 // kernel is 1, or 1/area under the kernel. The latter ensures
00067 // conservation of integrated pixel value (the usual jargon
00068 // is conservation of flux for images) and is the default.
00069 // </synopsis>
00070 
00071 // <example>
00072 // <srcBlock>
00073 // </srcBlock>
00074 // </example>
00075 
00076 // <motivation>
00077 // </motivation>
00078 
00079 // <todo asof="1990/03/31">
00080 //   <li> 
00081 // </todo>
00082  
00083 
00084 class VectorKernel
00085 {
00086 public:
00087 
00088 enum KernelTypes {
00089 
00090 // Box-car smoothing kernel
00091    BOXCAR,
00092 
00093 // Gaussian smoothing kernel
00094    GAUSSIAN,
00095 
00096 // Hanning smoothing kernel
00097    HANNING,
00098 
00099    NKERNELS};
00100 
00101 // Create kernel vector for width in pixels.  For Gaussian, width is FWHM,
00102 // for Boxcar, width is full width.  For Hanning width is ignored.
00103 // If useShapeExactly is True, the provided shape is used exactly. 
00104 // If useShapeExactly is False,
00105 // the kernel length will be the max of the provided shape and an
00106 // autoestimate (e.g. from +/- 5sigma limits for a Gaussian).  
00107 // <group>   
00108    static Vector<Double> make(KernelTypes kernelType, Double width, 
00109                               uInt shape, Bool useShapeExactly, Bool peakIsUnity=False);
00110    static Vector<Float> make(KernelTypes kernelType, Float width, 
00111                              uInt shape, Bool useShapeExactly, Bool peakIsUnity=False);
00112 // </group>   
00113 
00114 
00115 // Helper function to convert a string containing a list of desired smoothed kernel types
00116 // to the correct <src>Vector<Int></src> required for the <src>setSmooth</src> function.
00117 // This may be usful if your user interface involves strings rather than integers.
00118 // A new value is added to the output vector (which is resized appropriately) if any of the 
00119 // substrings "boxcar", "gaussian" or "hanning" (actually "box", "gauss", and "hann"
00120 // will do) is present.
00121    static Vector<Int> toKernelTypes (const String& kernels,
00122                                      const Regex& delimiter);
00123    static Vector<Int> toKernelTypes (const Vector<String>& kernels);
00124    static VectorKernel::KernelTypes toKernelType (const String& kernel);
00125    static String fromKernelType (KernelTypes kernelType);
00126 };
00127 
00128 
00129 } //# NAMESPACE CASACORE - END
00130 
00131 #endif
00132 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1