Commit 2a177442 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

cosmetics

parent a4fbac5c
Pipeline #23941 passed with stage
in 4 minutes and 39 seconds
from .scaling_operator import ScalingOperator
from .fft_operator import FFTOperator
from ..utilities import infer_space
from .diagonal_operator import DiagonalOperator
from .. import DomainTuple
def FFTSmoothingOperator(domain, sigma, space=None):
sigma = float(sigma)
if sigma < 0.:
raise ValueError("sigma must be nonnegative")
if sigma == 0.:
return ScalingOperator(1., domain)
domain = DomainTuple.make(domain)
space = infer_space(domain, space)
if domain[space].harmonic:
raise TypeError("domain must not be harmonic")
FFT = FFTOperator(domain, space=space)
codomain = FFT.domain[space].get_default_codomain()
kernel = codomain.get_k_length_array()
smoother = codomain.get_fft_smoothing_kernel_function(sigma)
kernel = smoother(kernel)
ddom = list(domain)
ddom[space] = codomain
diag = DiagonalOperator(kernel, ddom, space)
return FFT.inverse*diag*FFT
......@@ -32,9 +32,9 @@ def FFTSmoothingOperator(domain, sigma, space=None):
domain = DomainTuple.make(domain)
space = infer_space(domain, space)
FFT = FFTOperator(domain, space=space)
if domain[space].harmonic:
raise TypeError("domain must not be harmonic")
FFT = FFTOperator(domain, space=space)
codomain = FFT.domain[space].get_default_codomain()
kernel = codomain.get_k_length_array()
smoother = codomain.get_fft_smoothing_kernel_function(sigma)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment