Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
2a177442
Commit
2a177442
authored
Jan 23, 2018
by
Martin Reinecke
Browse files
cosmetics
parent
a4fbac5c
Pipeline
#23941
passed with stage
in 4 minutes and 39 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/operators/fft_smoothing_operator.py
deleted
100644 → 0
View file @
a4fbac5c
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
nifty4/operators/fft_smoothing_operator.py
View file @
2a177442
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment