casacore
Loading...
Searching...
No Matches
VectorKernel.h
Go to the documentation of this file.
1// # VectorKernel.h: generate Vector kernels
2// # Copyright (C) 1996,1997,1998,1999,2000,2001
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: casa-feedback@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#ifndef SCIMATH_VECTORKERNEL_H
27#define SCIMATH_VECTORKERNEL_H
28
29// # Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/Arrays/Vector.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations
36class Regex;
37class String;
38
39// <summary>
40// Make a Vector smoothing kernel from a kernel specification
41// </summary>
42
43// <use visibility=export>
44
45// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
46// </reviewed>
47
48// <prerequisite>
49// <li> <linkto class="Vector">Vector</linkto>
50// </prerequisite>
51
52// <etymology>
53// Returns a vector from a smoothing kernel specification.
54// </etymology>
55
56// <synopsis>
57// This class takes a smoothing kernel type and a width, and
58// generates a Vector holding that kernel. It can be used
59// in conjunction with the separable image convolver,
60// SepImageConvolver
61//
62// The kernels can be normalized so that the peak of the
63// kernel is 1, or 1/area under the kernel. The latter ensures
64// conservation of integrated pixel value (the usual jargon
65// is conservation of flux for images) and is the default.
66// </synopsis>
67
68// <example>
69// <srcBlock>
70// </srcBlock>
71// </example>
72
73// <motivation>
74// </motivation>
75
76// <todo asof="1990/03/31">
77// <li>
78// </todo>
79
81 public:
83
84 // Box-car smoothing kernel
86
87 // Gaussian smoothing kernel
89
90 // Hanning smoothing kernel
92
94 };
95
96 // Create kernel vector for width in pixels. For Gaussian, width is FWHM,
97 // for Boxcar, width is full width. For Hanning width is ignored.
98 // If useShapeExactly is True, the provided shape is used exactly.
99 // If useShapeExactly is False,
100 // the kernel length will be the max of the provided shape and an
101 // autoestimate (e.g. from +/- 5sigma limits for a Gaussian).
102 // <group>
103 static Vector<Double> make(KernelTypes kernelType, Double width, uInt shape, Bool useShapeExactly,
104 Bool peakIsUnity = False);
105 static Vector<Float> make(KernelTypes kernelType, Float width, uInt shape, Bool useShapeExactly,
106 Bool peakIsUnity = False);
107 // </group>
108
109 // Helper function to convert a string containing a list of desired smoothed kernel types
110 // to the correct <src>Vector<Int></src> required for the <src>setSmooth</src> function.
111 // This may be usful if your user interface involves strings rather than integers.
112 // A new value is added to the output vector (which is resized appropriately) if any of the
113 // substrings "boxcar", "gaussian" or "hanning" (actually "box", "gauss", and "hann"
114 // will do) is present.
115 static Vector<Int> toKernelTypes(const String& kernels, const std::regex& delimiter);
119};
120
121} // namespace casacore
122
123#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
static Vector< Int > toKernelTypes(const Vector< String > &kernels)
@ HANNING
Hanning smoothing kernel.
@ GAUSSIAN
Gaussian smoothing kernel.
@ BOXCAR
Box-car smoothing kernel.
static Vector< Int > toKernelTypes(const String &kernels, const std::regex &delimiter)
Helper function to convert a string containing a list of desired smoothed kernel types to the correct...
static Vector< Double > make(KernelTypes kernelType, Double width, uInt shape, Bool useShapeExactly, Bool peakIsUnity=False)
Create kernel vector for width in pixels.
static VectorKernel::KernelTypes toKernelType(const String &kernel)
static Vector< Float > make(KernelTypes kernelType, Float width, uInt shape, Bool useShapeExactly, Bool peakIsUnity=False)
static String fromKernelType(KernelTypes kernelType)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.
float Float
Definition aipstype.h:52
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53