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_gridder
Commits
9f85bcd9
Commit
9f85bcd9
authored
Sep 04, 2019
by
Martin Reinecke
Browse files
demo fixes
parent
33a8ede5
Changes
1
Hide whitespace changes
Inline
Side-by-side
demo_wstack.py
View file @
9f85bcd9
...
...
@@ -49,7 +49,7 @@ def test_against_wdft(nrow, nchan, nxdirty, nydirty, fov, epsilon, nthreads,
if
single
:
print
(
"
\n
Calling single-precision functions"
)
ms
=
ms
.
astype
(
"c8"
)
tdirty
=
tdirty
.
astype
(
"
c8
"
)
tdirty
=
tdirty
.
astype
(
"
f4
"
)
else
:
print
(
"
\n
Calling double-precision functions"
)
...
...
@@ -59,18 +59,20 @@ def test_against_wdft(nrow, nchan, nxdirty, nydirty, fov, epsilon, nthreads,
truth
=
explicit_gridder
(
uvw
,
freq
,
ms
,
nxdirty
,
nydirty
,
xpixsize
,
ypixsize
)
res
=
ng
.
ms2dirty
(
uvw
,
freq
,
ms
,
None
,
nxdirty
,
nydirty
,
xpixsize
,
ypixsize
,
epsilon
,
nthreads
)
ypixsize
,
epsilon
,
do_wstacking
=
True
,
nthreads
=
nthreads
)
print
(
"L2 error between explicit transform and gridder:"
,
_l2error
(
truth
,
res
))
# test adjointness
print
(
"
\n
Testing adjointness of the gridding/degridding operation"
)
adj1
=
np
.
vdot
(
ng
.
ms2dirty
(
uvw
,
freq
,
ms
,
None
,
nxdirty
,
nydirty
,
xpixsize
,
ypixsize
,
epsilon
,
nthreads
,
verbosity
=
2
),
xpixsize
,
ypixsize
,
epsilon
,
do_wstacking
=
True
,
nthreads
=
nthreads
,
verbosity
=
2
),
tdirty
)
adj2
=
np
.
vdot
(
ms
,
ng
.
dirty2ms
(
uvw
,
freq
,
tdirty
,
None
,
xpixsize
,
ypixsize
,
epsilon
,
nthreads
,
verbosity
=
2
)).
real
epsilon
,
do_wstacking
=
True
,
nthreads
=
nthreads
,
verbosity
=
2
)).
real
print
(
"adjointness test:"
,
np
.
abs
(
adj1
-
adj2
)
/
np
.
maximum
(
np
.
abs
(
adj1
),
np
.
abs
(
adj2
)))
...
...
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