def test_shift_2d(self): ns = 500 w = scipy.signal.ricker(ns, 10) w = np.matlib.repmat(w, 100, 1).transpose() self.assertTrue( np.all(np.isclose(shift(w, 1, axis=0), np.roll(w, 1, axis=0)))) self.assertTrue( np.all(np.isclose(shift(w, 1, axis=1), np.roll(w, 1, axis=1))))
def test_shift_1d(self): ns = 500 w = scipy.signal.ricker(ns, 10) self.assertTrue(np.all(np.isclose(shift(w, 1), np.roll(w, 1))))