Skip to content
GitLab
Menu
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
72899421
Commit
72899421
authored
Feb 27, 2019
by
Lukas Platz
Browse files
fix demo function `convtest`: use test_signal instead of signal
parent
a65cc4fa
Pipeline
#44308
passed with stages
in 9 minutes and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/misc/convolution.py
View file @
72899421
...
...
@@ -5,16 +5,15 @@ import nifty5 as ift
def
convtest
(
test_signal
,
delta
,
func
):
domain
=
test_signal
.
domain
codom
=
domain
[
0
].
get_default_codomain
()
# Create Convolution Operator
conv_op
=
ift
.
FuncConvolutionOperator
(
domain
,
func
)
# Convolve, Adjoint-Convolve
conv_signal
=
conv_op
(
signal
)
conv_signal
=
conv_op
(
test_
signal
)
cac_signal
=
conv_op
.
adjoint_times
(
conv_signal
)
print
(
signal
.
integrate
(),
conv_signal
.
integrate
(),
cac_signal
.
integrate
())
print
(
test_signal
.
integrate
(),
conv_signal
.
integrate
(),
cac_signal
.
integrate
())
# generate kernel image
conv_delta
=
conv_op
(
delta
)
...
...
@@ -37,7 +36,7 @@ domain = ift.HPSpace(nside)
# Define test signal (some point sources)
signal_vals
=
np
.
zeros
(
npix
,
dtype
=
np
.
float64
)
for
i
in
range
(
0
,
npix
,
npix
//
12
+
27
):
signal_vals
[
i
]
=
1
.
signal_vals
[
i
]
=
500
.
signal
=
ift
.
from_global_data
(
domain
,
signal_vals
)
...
...
@@ -57,8 +56,8 @@ convtest(signal, delta, func)
domain
=
ift
.
RGSpace
((
100
,
100
))
# Define test signal (some point sources)
signal_vals
=
np
.
zeros
(
domain
.
shape
,
dtype
=
np
.
float64
)
signal_vals
[
35
,
70
]
=
1
signal_vals
[
45
,
8
]
=
1
signal_vals
[
35
,
70
]
=
5000.
signal_vals
[
45
,
8
]
=
5000.
signal
=
ift
.
from_global_data
(
domain
,
signal_vals
)
# Define delta signal, generate kernel image
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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