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_gridder
Commits
4e97d7e2
Commit
4e97d7e2
authored
Aug 21, 2019
by
Philipp Arras
Browse files
Merge branch 'better_wscreen' into tests
parents
2a78a9ef
75c0ccbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
nifty_gridder.cc
View file @
4e97d7e2
...
...
@@ -594,8 +594,11 @@ template<typename T> class GridderConfig
complex
<
T
>
wscreen
(
double
x
,
double
y
,
double
w
,
bool
adjoint
)
const
{
constexpr
double
pi
=
3.141592653589793238462643383279502884197
;
double
n
=
cos
(
sqrt
(
x
+
y
)),
xn
=
1.
/
n
;
double
phase
=
2
*
pi
*
w
*
(
n
-
1
);
double
eps
=
sqrt
(
x
+
y
);
double
s
=
sin
(
eps
);
double
nm1
=
-
s
*
s
/
(
1.
+
cos
(
eps
));
double
n
=
nm1
+
1.
,
xn
=
1.
/
n
;
double
phase
=
2
*
pi
*
w
*
nm1
;
if
(
adjoint
)
phase
*=
-
1
;
return
complex
<
T
>
(
cos
(
phase
)
*
xn
,
sin
(
phase
)
*
xn
);
}
...
...
test.py
View file @
4e97d7e2
...
...
@@ -171,10 +171,11 @@ def test_pickling():
@
pmp
(
'nx'
,
[
4
,
18
,
54
])
@
pmp
(
'
dx
'
,
[
1.
,
0.1
3
,
1
32
])
@
pmp
(
'
fov
'
,
[
0.1
,
1
,
5
])
# deg
@
pmp
(
'w'
,
[
0
,
10
,
8489
])
def
test_wstacking
(
nx
,
dx
,
w
):
def
test_wstacking
(
nx
,
fov
,
w
):
np
.
random
.
seed
(
42
)
dx
=
fov
*
np
.
pi
/
180
/
nx
ny
,
dy
=
nx
,
dx
conf
=
ng
.
GridderConfig
(
nx
,
ny
,
1e-7
,
dx
,
dy
)
x
,
y
=
conf
.
Nu
(),
conf
.
Nv
()
...
...
Write
Preview
Supports
Markdown
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