Exemple #1
0
def test_correlate1():
    """
    correlate(data, kernel, mode=FULL)
    """
    result = convolve.correlate(np.arange(8), [1, 2], mode=VALID)
    test = np.array([ 2,  5,  8, 11, 14, 17, 20])
    assert_equal(result.all(),test.all())
Exemple #2
0
def test_correlate9():
    test = convolve.correlate(np.arange(8), [1, 2, 3, 4, 5, 6], mode=FULL)
    result = np.array([  0,   6,  17,  32,  50,  70,  91, 112,  85,  60,  38,  20,   7])
    assert_equal(result.all(),test.all())
Exemple #3
0
def test_correlate8():
    test = convolve.correlate(np.arange(8), [1, 2, 3, 4, 5, 6], mode=SAME)
    result = np.array([ 17,  32,  50,  70,  91, 112,  85,  60])
    assert_equal(result.all(),test.all())
Exemple #4
0
def test_correlate7():
    test = convolve.correlate(np.arange(8), [1, 2, 3, 4, 5, 6], mode=VALID)
    result = np.array([ 70,  91, 112])
    assert_equal(result.all(),test.all())
Exemple #5
0
def test_correlate6():
    test = convolve.correlate(np.arange(8), [1, 2, 3], mode=FULL)
    result = np.array([ 0,  3,  8, 14, 20, 26, 32, 38, 20,  7])
    assert_equal(result.all(),test.all())
Exemple #6
0
def test_correlate5():
    test = convolve.correlate(np.arange(8), [1, 2, 3], mode=SAME)
    result = np.array([ 3,  8, 14, 20, 26, 32, 38, 20])
    assert_equal(result.all(),test.all())
Exemple #7
0
def test_correlate4():
    test = convolve.correlate(np.arange(8), [1, 2, 3], mode=VALID)
    result = np.array([ 8, 14, 20, 26, 32, 38])
    assert_equal(result.all(),test.all())
Exemple #8
0
def test_correlate3():
    result = convolve.correlate(np.arange(8), [1, 2], mode=FULL)
    test = np.array([ 0,  2,  5,  8, 11, 14, 17, 20,  7])
    assert_equal(result.all(),test.all())