def test_utils_crosscorrelate(): ''' Test of crosscorrelate() in utils module ''' a = np.array( [ [2.0, 3.0, 4.0, 5.0], [6.0, 7.0, 8.0, 9.0], [10.0, 11.0, 12.0, 13.0], [14.0, 15.0, 16.0, 17.0], ] ) b = np.array( [ [-5.0, -4.0, -3.0, -2.0], [-1.0, 0.0, 1.0, 2.0], [3.0, 4.0, 5.0, 6.0], [7.0, 8.0, 9.0, 10.0], ] ) result = utils.crosscorrelate(a, b) true_result = np.array( [ [176.0 + 0.0j, 184.0 + 0.0j, 208.0 + 0.0j, 184.0 + 0.0j], [304.0 + 0.0j, 312.0 + 0.0j, 336.0 + 0.0j, 312.0 + 0.0j], [688.0 + 0.0j, 696.0 + 0.0j, 720.0 + 0.0j, 696.0 + 0.0j], [304.0 + 0.0j, 312.0 + 0.0j, 336.0 + 0.0j, 312.0 + 0.0j], ] ) assert_allclose(result, true_result)
def test_utils_crosscorrelate(): ''' Test of crosscorrelate() in utils module ''' a = np.array([[2., 3., 4., 5.], [6., 7., 8., 9.], [10., 11., 12., 13.], [14., 15., 16., 17.]]) b = np.array([[-5., -4., -3., -2.], [-1., 0., 1., 2.], [3., 4., 5., 6.], [7., 8., 9., 10.]]) result = utils.crosscorrelate(a, b) true_result = np.array([[176. + 0.j, 184. + 0.j, 208. + 0.j, 184. + 0.j], [304. + 0.j, 312. + 0.j, 336. + 0.j, 312. + 0.j], [688. + 0.j, 696. + 0.j, 720. + 0.j, 696. + 0.j], [304. + 0.j, 312. + 0.j, 336. + 0.j, 312. + 0.j]]) assert_allclose(result, true_result)