Commit 90e57542 authored by Philipp Arras's avatar Philipp Arras
Browse files

Add another test

parent d0685c95
......@@ -238,6 +238,24 @@ def test_correlations(nxdirty, nydirty, nrow, nchan, epsilon, du, dv, weight):
assert_allclose(np.zeros_like(y1), y1.imag)
@pmp("nrow", (1, 1000))
@pmp("nchan", (1, 10))
@pmp("epsilon", (1e-2, 1e-7, 2e-12))
@pmp("weight", (True, False))
def test_no_correlation(nrow, nchan, epsilon, weight):
np.random.seed(42)
bl, conf, idx = _init_gridder(128, 128, epsilon, nchan, nrow)
wgt = np.random.rand(*idx.shape) if weight else None
w = conf.W()
for uu in range(-2*w, 2*w):
for vv in range(-2*w, 2*w):
if abs(uu) >= w or abs(vv) >= w:
with pytest.raises(RuntimeError):
ng.get_correlations(bl, conf, idx, uu, vv, wgt)
else:
ng.get_correlations(bl, conf, idx, uu, vv, wgt)
@pmp('epsilon', [1e-2, 1e-4, 1e-7, 1e-10, 1e-11, 1e-12, 2e-13])
@pmp('nxdirty', [12, 128])
@pmp('nydirty', [4, 12, 128])
......
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