def test_auto_correlate_n(self): out = core.auto_correlate(a, n = 3) self.assertTrue(np.allclose(out,auto_a[0:3])) out = core.auto_correlate(a,t1,n = 3) self.assertTrue(np.allclose(out,auto_a_t1[0:3])) out = core.auto_correlate(a,t1,n = 3, aout = out) self.assertTrue(np.allclose(out,auto_a_t1[0:3]*2))
def test_auto_correlate(self): out = core.auto_correlate(a) self.assertTrue(np.allclose(out,auto_a)) out = core.auto_correlate(a,t1) self.assertTrue(np.allclose(out,auto_a_t1)) out = core.auto_correlate(a,t1, aout = out) self.assertTrue(np.allclose(out,auto_a_t1*2))
def test_auto_correlate2(self): out = core.auto_correlate(a2, axis = -1) self.assertTrue(np.allclose(out[0],auto_a)) out = core.auto_correlate(a2,t1, axis = -1) self.assertTrue(np.allclose(out[0],auto_a_t1)) out = core.auto_correlate(a2,t1, axis = -1, aout = out) self.assertTrue(np.allclose(out[0],auto_a_t1*2))
def test_auto_correlate_n2(self): out = core.auto_correlate(a2, n = 3,axis = -1) self.assertTrue(np.allclose(out[0],auto_a[0:3])) out = core.auto_correlate(a2,t1,n = 3, axis = -1) self.assertTrue(np.allclose(out[0],auto_a_t1[0:3])) out = core.auto_correlate(a2,t1,n = 3, aout = out, axis = 1) self.assertTrue(np.allclose(out[0],auto_a_t1[0:3]*2))