Commit 847c9606 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add adjointness test for wgridder

parent a4977523
......@@ -64,6 +64,21 @@ def test_adjointness(nxdirty, nydirty, nrow, nchan, epsilon):
assert_allclose(np.vdot(ms, ms2).real, np.vdot(dirty.real, dirty2.real))
@pmp("nxdirty", (128, 300))
@pmp("nydirty", (128, 250))
@pmp("nrow", (1, 10, 10000))
@pmp("nchan", (1, 10, 100))
@pmp("epsilon", (1e-2, 1e-7, 2e-13))
def test_adjointness_wgridding(nxdirty, nydirty, nrow, nchan, epsilon):
np.random.seed(42)
bl, conf, idx = _init_gridder(nxdirty, nydirty, epsilon, nchan, nrow)
vis = np.random.rand(*idx.shape)-0.5
dirty = np.random.rand(conf.Nxdirty(), conf.Nydirty())-0.5
dirty2 = ng.vis2dirty_wstack(bl, conf, idx, vis)
vis2 = ng.dirty2vis_wstack(bl, conf, idx, dirty)
assert_allclose(np.vdot(vis, vis2), np.vdot(dirty2, dirty), rtol=epsilon)
@pmp("nxdirty", (128,))
@pmp("nydirty", (128,))
@pmp("nrow", (10000,))
......
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