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
8e9c5244
Commit
8e9c5244
authored
May 28, 2019
by
Philipp Arras
Browse files
Add test of channel_facts
parent
2bc1bff1
Pipeline
#50125
passed with stages
in 7 minutes and 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/test_operators/test_nft.py
View file @
8e9c5244
...
...
@@ -34,13 +34,14 @@ def _l2error(a, b):
@
pmp
(
'nu'
,
[
12
,
128
])
@
pmp
(
'nv'
,
[
4
,
12
,
128
])
@
pmp
(
'N'
,
[
1
,
10
,
100
])
def
test_gridding
(
nu
,
nv
,
N
,
eps
):
@
pmp
(
'channel_fact'
,
[
1
,
1.2
])
def
test_gridding
(
nu
,
nv
,
N
,
eps
,
channel_fact
):
uvw
=
np
.
random
.
rand
(
N
,
3
)
-
0.5
vis
=
(
np
.
random
.
randn
(
N
)
+
1j
*
np
.
random
.
randn
(
N
))
# Nifty
GM
=
ift
.
GridderMaker
(
ift
.
RGSpace
((
nu
,
nv
)),
uvw
=
uvw
,
channel_fact
=
np
.
array
([
1.
]),
eps
=
eps
,
channel_fact
=
np
.
array
([
channel_fact
]),
eps
=
eps
,
flags
=
np
.
zeros
((
N
,
1
),
dtype
=
np
.
bool
))
vis2
=
ift
.
from_global_data
(
ift
.
UnstructuredDomain
(
vis
.
shape
),
vis
)
...
...
@@ -51,7 +52,7 @@ def test_gridding(nu, nv, N, eps):
*
[
-
ss
/
2
+
np
.
arange
(
ss
)
for
ss
in
[
nu
,
nv
]],
indexing
=
'ij'
)
dft
=
pynu
*
0.
for
i
in
range
(
N
):
dft
+=
(
vis
[
i
]
*
np
.
exp
(
2j
*
np
.
pi
*
(
x
*
uvw
[
i
,
0
]
+
y
*
uvw
[
i
,
1
]))).
real
dft
+=
(
vis
[
i
]
*
np
.
exp
(
2j
*
np
.
pi
*
(
x
*
uvw
[
i
,
0
]
+
y
*
uvw
[
i
,
1
])
*
channel_fact
)).
real
assert_
(
_l2error
(
dft
,
pynu
)
<
eps
)
...
...
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