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
30//# Includes
31#include <casacore/casa/aips.h>
32#include <casacore/casa/Arrays/Vector.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36//# Forward Declarations
37class Regex;
38class String;
39
40// <summary>
41// Make a Vector smoothing kernel from a kernel specification
42// </summary>
43
44// <use visibility=export>
45
46// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
47// </reviewed>
48
49// <prerequisite>
50// <li> <linkto class="Vector">Vector</linkto>
51// </prerequisite>
52
53// <etymology>
54// Returns a vector from a smoothing kernel specification.
55// </etymology>
56
57// <synopsis>
58// This class takes a smoothing kernel type and a width, and
59// generates a Vector holding that kernel. It can be used
60// in conjunction with the separable image convolver,
61// SepImageConvolver
62//
63// The kernels can be normalized so that the peak of the
64// kernel is 1, or 1/area under the kernel. The latter ensures
65// conservation of integrated pixel value (the usual jargon
66// is conservation of flux for images) and is the default.
67// </synopsis>
68
69// <example>
70// <srcBlock>
71// </srcBlock>
72// </example>
73
74// <motivation>
75// </motivation>
76
77// <todo asof="1990/03/31">
78// <li>
79// </todo>
80
81
83{
84public:
85
87
88// Box-car smoothing kernel
90
91// Gaussian smoothing kernel
93
94// Hanning smoothing kernel
96
98
99// Create kernel vector for width in pixels. For Gaussian, width is FWHM,
100// for Boxcar, width is full width. For Hanning width is ignored.
101// If useShapeExactly is True, the provided shape is used exactly.
102// If useShapeExactly is False,
103// the kernel length will be the max of the provided shape and an
104// autoestimate (e.g. from +/- 5sigma limits for a Gaussian).
105// <group>
106 static Vector<Double> make(KernelTypes kernelType, Double width,
107 uInt shape, Bool useShapeExactly, Bool peakIsUnity=False);
108 static Vector<Float> make(KernelTypes kernelType, Float width,
109 uInt shape, Bool useShapeExactly, Bool peakIsUnity=False);
110// </group>
111
112
113// Helper function to convert a string containing a list of desired smoothed kernel types
114// to the correct <src>Vector<Int></src> required for the <src>setSmooth</src> function.
115// This may be usful if your user interface involves strings rather than integers.
116// A new value is added to the output vector (which is resized appropriately) if any of the
117// substrings "boxcar", "gaussian" or "hanning" (actually "box", "gauss", and "hann"
118// will do) is present.
119 static Vector<Int> toKernelTypes (const String& kernels,
120 const std::regex& delimiter);
121 static Vector<Int> toKernelTypes (const Vector<String>& kernels);
123 static String fromKernelType (KernelTypes kernelType);
124};
125
126
127} //# NAMESPACE CASACORE - END
128
129#endif
130
String: the storage and methods of handling collections of characters.
Definition String.h:223
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)
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
unsigned int uInt
Definition aipstype.h:49
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
Definition ExprNode.h:1991
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