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
d2dcd64a
Commit
d2dcd64a
authored
Jun 19, 2020
by
Philipp Arras
Browse files
Formatting
parent
d99be923
Pipeline
#76981
passed with stages
in 12 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_complex_consistency.py
View file @
d2dcd64a
...
...
@@ -16,17 +16,13 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
import
numpy
as
np
import
pytest
import
nifty7
as
ift
from
..common
import
list2fixture
,
setup_function
,
teardown_function
from
scipy.stats
import
norm
Nsamp
=
20000
np
.
random
.
seed
(
42
)
def
_to_array
(
d
):
if
isinstance
(
d
,
np
.
ndarray
):
return
d
...
...
@@ -40,8 +36,8 @@ def test_GaussianEnergy():
samp
=
S
.
draw_sample_with_dtype
(
dtype
=
np
.
complex128
)
real_std
=
np
.
std
(
samp
.
val
.
real
)
imag_std
=
np
.
std
(
samp
.
val
.
imag
)
np
.
testing
.
assert_allclose
(
real_std
,
imag_std
,
atol
=
5.
/
np
.
sqrt
(
Nsamp
))
np
.
testing
.
assert_allclose
(
real_std
,
imag_std
,
atol
=
5.
/
np
.
sqrt
(
Nsamp
))
sp1
=
ift
.
UnstructuredDomain
(
1
)
mean
=
ift
.
full
(
sp1
,
0.
)
real_icov
=
ift
.
ScalingOperator
(
sp1
,
real_std
**
(
-
2
))
...
...
@@ -68,10 +64,12 @@ def test_WienerFilter():
d
=
R
(
s
)
+
N
.
draw_sample_with_dtype
(
dtype
=
np
.
complex128
)
j
=
R
.
adjoint_times
(
N
.
inverse_times
(
d
))
m
=
D
(
j
)
sr
=
s
.
real
# FIXME Redundant lines below
# sr = s.real
jr
=
j
.
real
mr
=
D
(
jr
)
si
=
s
.
imag
# FIXME Redundant lines below
# si = s.imag
ji
=
j
.
imag
mi
=
D
(
ji
)
np
.
testing
.
assert_allclose
((
mr
+
mi
*
1.j
).
val
,
m
.
val
,
rtol
=
1e-7
)
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