Beispiel #1
0
    def check_contiguous_double(self):
        # double test
        xt      = xc1
        yt      = autocorr(xt, xt.size - 1)

        yr  = correlate(xt, xt, mode = 'full')
        yr  = yr[xt.size-1:]

        assert_array_equal(yt, yr)
Beispiel #2
0
    def check_non_contiguous_float(self):
        # float test
        xt      = xff1
        yt      = autocorr(xt, xt.size - 1)

        yr  = correlate(xt, xt, mode = 'full')
        yr  = yr[xt.size-1:]

        assert_array_equal(yt, yr)
Beispiel #3
0
    def check_double_partial(self):
        # C, axis 1 test
        xt      = xc
        axis    = -1
        lag     = 1
        yt      = autocorr(xt, lag, axis = axis)

        yr      = autocorr_py(xt, lag, axis = axis)
        assert_array_equal(yt, yr)

        # C, axis 0 test
        xt      = xc
        axis    = 0
        lag     = 0
        yt      = autocorr(xt, lag, axis = axis)

        yr      = autocorr_py(xt, lag, axis = axis)
        assert_array_equal(yt, yr)

        # F, axis 0 test
        xt      = xf
        axis    = 1
        lag     = xt.shape[axis] - 1
        yt      = autocorr(xt, lag, axis = axis)

        yr      = autocorr_py(xt, lag, axis = axis)
        assert_array_equal(yt, yr)

        # F, axis 1 test
        xt      = xf
        axis    = -1
        lag     = 1
        yt      = autocorr(xt, lag, axis = axis)

        yr      = autocorr_py(xt, lag, axis = axis)
        assert_array_equal(yt, yr)
Beispiel #4
0
    def check_float(self):
        # C, axis 1 test
        xt      = xcf
        axis    = -1
        lag     = xt.shape[axis] - 1
        yt      = autocorr(xt, lag, axis = axis)

        yr      = autocorr_py(xt, lag, axis = axis)
        assert_array_equal(yt, yr)

        # C, axis 0 test
        xt      = xcf
        axis    = 0
        lag     = xt.shape[axis] - 1
        yt      = autocorr(xt, lag, axis = axis)

        yr      = autocorr_py(xt, lag, axis = axis)
        assert_array_equal(yt, yr)

        # F, axis 0 test
        xt      = xff
        axis    = 0
        lag     = xt.shape[axis] - 1
        yt      = autocorr(xt, lag, axis = axis)

        yr      = autocorr_py(xt, lag, axis = axis)
        assert_array_equal(yt, yr)

        # F, axis 1 test
        xt      = xff
        axis    = -1
        lag     = xt.shape[axis] - 1
        yt      = autocorr(xt, lag, axis = axis)

        yr      = autocorr_py(xt, lag, axis = axis)
        assert_array_equal(yt, yr)