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
4f6b914c
Commit
4f6b914c
authored
May 20, 2019
by
Martin Reinecke
Browse files
adjust to gridder changes
parent
d4c14850
Pipeline
#49013
passed with stages
in 17 minutes and 20 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/library/gridder.py
View file @
4f6b914c
...
...
@@ -26,7 +26,7 @@ from ..sugar import from_global_data, makeDomain
class
GridderMaker
(
object
):
def
__init__
(
self
,
domain
,
eps
=
1
e-1
5
):
def
__init__
(
self
,
domain
,
eps
=
2
e-1
3
):
from
nifty_gridder
import
get_w
domain
=
makeDomain
(
domain
)
if
(
len
(
domain
)
!=
1
or
not
isinstance
(
domain
[
0
],
RGSpace
)
or
...
...
test/test_operators/test_nft.py
View file @
4f6b914c
...
...
@@ -25,11 +25,12 @@ np.random.seed(40)
pmp
=
pytest
.
mark
.
parametrize
def
_l2error
(
a
,
b
):
return
np
.
sqrt
(
np
.
sum
(
np
.
abs
(
a
-
b
)
**
2
)
/
np
.
sum
(
np
.
abs
(
a
)
**
2
))
@
pmp
(
'eps'
,
[
1e-2
,
1e-
6
,
1e-7
,
1e-1
5
])
@
pmp
(
'eps'
,
[
1e-2
,
1e-
4
,
1e-7
,
1e-1
0
,
1e-11
,
1e-12
,
2e-13
])
@
pmp
(
'nu'
,
[
12
,
128
])
@
pmp
(
'nv'
,
[
4
,
12
,
128
])
@
pmp
(
'N'
,
[
1
,
10
,
100
])
...
...
@@ -52,17 +53,17 @@ def test_gridding(nu, nv, N, eps):
dft
=
pynu
*
0.
for
i
in
range
(
N
):
dft
+=
(
vis
[
i
]
*
np
.
exp
(
2j
*
np
.
pi
*
(
x
*
uv
[
i
,
0
]
+
y
*
uv
[
i
,
1
]))).
real
assert
(
_l2error
(
dft
,
pynu
)
<
max
(
1e-13
,
10
*
eps
)
)
assert
(
_l2error
(
dft
,
pynu
)
<
eps
)
@
pmp
(
'eps'
,
[
1e-2
,
1e-6
,
1
e-1
5
])
@
pmp
(
'eps'
,
[
1e-2
,
1e-6
,
2
e-1
3
])
@
pmp
(
'nu'
,
[
12
,
128
])
@
pmp
(
'nv'
,
[
4
,
12
,
128
])
@
pmp
(
'N'
,
[
1
,
10
,
100
])
def
test_build
(
nu
,
nv
,
N
,
eps
):
dom
=
ift
.
RGSpace
([
nu
,
nv
])
uv
=
np
.
random
.
rand
(
N
,
2
)
-
0.5
GM
=
ift
.
GridderMaker
(
dom
)
GM
=
ift
.
GridderMaker
(
dom
,
eps
=
eps
)
# re-order for performance
idx
=
GM
.
getReordering
(
uv
)
uv
=
uv
[
idx
]
...
...
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