Contents
Mẹo về Filter 2D list Python 2022
You đang tìm kiếm từ khóa Filter 2D list Python được Cập Nhật vào lúc : 2022-02-07 13:11:56 . Với phương châm chia sẻ Thủ Thuật Hướng dẫn trong nội dung bài viết một cách Chi Tiết Mới Nhất. Nếu sau khi tìm hiểu thêm tài liệu vẫn ko hiểu thì hoàn toàn có thể lại Comments ở cuối bài để Admin lý giải và hướng dẫn lại nha.
Filter2D 2-dimensional spectral filtering.¶
This module defines the 2D filter methods.
class admit.util.filter.Filter2D.Filter2D(data, method, **keyval)[source]¶
This class defines and runs 2D spectral filters. The currently available filters are Gaussian, Hanning, Triangle, Welch, Boxcar, and Savitzky Golay. The output spectrum will be of the same length as the input spectrum, however some edge channels may be zeroed by some methods, depending on the input parameters.
Parameters:
spec : numpy array
2D numpy array of the input spectrum (just the amplitudes).
method : str
The smoothing filter to apply: boxcar, gaussian, welch, hanning, triangle, or savgol. No default. Minimum matching is enabled with a minimum of 3 characters, i.e. box = boxcar.
keyval : various
Any keyword value pairs for the specific method chosen, see the notes for specific keywords.
Notes
Details of the different filter keywords and defaults:
FilterKeywordDef.Descriptionboxcarwidth3Number of channels to average togethergaussianwidth7Number of channels to span with the gaussianhanningwidth5Number of channels to include in the costrianglewidth5Number of channels to span with the trianglewelchwidth5Number of channels to use in the functionsavgolwindow_size7Number of channels to use in the calculationorder3Order of the poynomial fit (must be odd)deriv0The number of the derivative to compute (0 = just smooth)
Attributes
spec(numpy array) The spectrum.len(int) The length of the spectrum.methods(list) A list of the available filters.[method]_args(dict) A dictionary for each method giving its keywords and defaults (e.g. boxcar_args).method(str) The method being used.
Methods
boxcar(width)Method to apply a boxcar filter to a spectrum.checkmethod(method)Method to interpret the input method and determine the full methodgaussian(width)Method to apply a Gaussian filter to a spectrum.hanning(width)Method to apply a Hanning filter to a spectrum.radius(x,y,width)Method to calculate the radius of a point in the kernelrun()Method to run the selected filter on the datasavgol(window_size,order[,deriv])Method to apply a Savitzky-Golay filter to a 2D image.triangle(width)Method to apply a Triangular filter to a spectrum.welch(width)Method to apply a Welch filter to a spectrum.boxcar(width)[source]¶
Method to apply a boxcar filter to a spectrum. The filter for point x[i] is defined as:
[x[i] = frac1N sum_n=0^N x[i + n – fracN – 12]]
where N is the width of the filter.
Parameters:
width : int
The width of the box to use in channels, must be odd
Returns:
numpy array
The smoothed image, (width – 1)/2 edge channels will be zeroed
checkmethod(method)[source]¶
Method to interpret the input method and determine the full method name
Parameters:
method : str
The method to use, minimal matching is possible, with a minimum of 3 characters (e.g. box will be interpreted to be boxcar)
Returns:
None
gaussian(width)[source]¶
Method to apply a Gaussian filter to a spectrum. The filter for point x[i] is defined as:
[x[i] = frac3N sum_n=0^N x[i + n – fracN – 12] e^-frac12left(fracn-(N-1)/2sigma(N-1)/2right)^2]
where N is the width of the filter.
Parameters:
width : int
The number of channels to span with the gaussian for each iteration, must be odd
Returns:
numpy array
The smoothed image, (width – 1)/2 edge channels will be zeroed
hanning(width)[source]¶
Method to apply a Hanning filter to a spectrum. The filter for point x[i] is defined as:
[x[i] = frac2N-1 sum_n=0^N x[i + n – fracN – 12] 0.5 left(1 – cosleft(frac2pi nN-1right)right)]
where N is the width of the filter.
Parameters:
width : int
The number of channels to span with the function for each iteration, must be odd
Returns:
numpy array
The smoothed image, (width – 1)/2 edge channels will be zeroed
radius(x, y, width)[source]¶
Method to calculate the radius of a point in the kernel
Parameters:
x : float
The x coordinate
y : float
The y coordinate
width : int
The width of the Gaussian being used
Returns:
Float containing the radius to the point
run()[source]¶
Method to run the selected filter on the data
Parameters:NoneReturns:The smoothed imagesavgol(window_size, order, deriv=None)[source]¶
Method to apply a Savitzky-Golay filter to a 2D image.
Parameters:
window_size : int
the size of the window. Must be an odd integer number.
order : int
the order of the polynomial used in the filtering. Must be less then window_size – 1.
deriv: int
the order of the derivative to compute (default = None means only smoothing)
Returns:
numpy array
The smoothed image, (width – 1)/2 edge channels will be zeroed
triangle(width)[source]¶
Method to apply a Triangular filter to a spectrum. The filter for point x[i] is defined as:
[x[i] = sum_n=0^N x[i + n – fracN – 12] left(1 – left|fracn-fracN-12fracN2right|right)]
where N is the width of the filter.
Parameters:
width : int
The number of channels to span with the function for each iteration, must be odd
Returns:
numpy array
The smoothed image, (width – 1)/2 edge channels will be zeroed
welch(width)[source]¶
Method to apply a Welch filter to a spectrum. The filter for point x[i] is defined as:
[x[i] = frac32(N-1) sum_n=0^N x[i + n – fracN – 12] left(1 – left(fracn – fracN-12fracN-12right)^2right)]
where N is the width of the filter.
Parameters:
width : int
The number of channels to span with the function for each iteration, must be odd
Returns:
numpy array
The smoothed image, (width – 1)/2 edge channels will be zeroed
://.youtube/watch?v=ccoGXm9JL6Y
Reply
7
0
Chia sẻ
Review Filter 2D list Python ?
Bạn vừa Read nội dung bài viết Với Một số hướng dẫn một cách rõ ràng hơn về Review Filter 2D list Python tiên tiến và phát triển nhất
Chia Sẻ Link Down Filter 2D list Python miễn phí
You đang tìm một số trong những Chia Sẻ Link Down Filter 2D list Python Free.
Giải đáp vướng mắc về Filter 2D list Python
Nếu sau khi đọc nội dung bài viết Filter 2D list Python vẫn chưa hiểu thì hoàn toàn có thể lại Comment ở cuối bài để Admin lý giải và hướng dẫn lại nha
#Filter #list #Python