Commit 9f85bcd9 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

demo fixes

parent 33a8ede5
......@@ -49,7 +49,7 @@ def test_against_wdft(nrow, nchan, nxdirty, nydirty, fov, epsilon, nthreads,
if single:
print("\nCalling single-precision functions")
ms = ms.astype("c8")
tdirty = tdirty.astype("c8")
tdirty = tdirty.astype("f4")
else:
print("\nCalling 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("\nTesting 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)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment