Add test for sampling

This commit is contained in:
Roman Zeyde
2014-07-05 09:40:09 +03:00
parent c9d7f8e2f2
commit 63fbee8bfc
2 changed files with 14 additions and 2 deletions

12
test_sampling.py Normal file
View File

@@ -0,0 +1,12 @@
import sampling
import numpy as np
def test_resample():
x = np.arange(300)
s = sampling.Sampler(x)
y = np.array(list(s))
k = s.interp.width - 1
x = x[k:-k-1]
err = np.max(np.abs(x - y))
assert err < 1e-10