Ejemplo n.º 1
0
def test_iplv():
    data = np.load("../examples/data/eeg_32chans_10secs.npy")
    ts, avg = iplv(data, [1.0, 4.0], 128.0)

    ts = np.float32(ts)
    avg = np.float32(avg)

    expected_ts = np.load("data/test_iplv_ts.npy")
    expected_ts = np.float32(expected_ts)
    np.testing.assert_array_equal(ts, expected_ts)

    expected_avg = np.load("data/test_iplv_avg.npy")
    expected_avg = np.float32(expected_avg)
    np.testing.assert_array_equal(avg, expected_avg)
Ejemplo n.º 2
0
def test_iplv_nofilter():
    data = np.load("../examples/data/rois39_samples100.npy")
    ts, avg = iplv(data)

    if "TRAVIS" in os.environ:
        # We have to use the following to make the test work on Travis
        expected_ts = np.load("data/test_iplv_nofilter_ts.npy")
        np.testing.assert_array_almost_equal(ts, expected_ts)

        expected_avg = np.load("data/test_iplv_nofilter_avg.npy")
        np.testing.assert_array_almost_equal(avg, expected_avg)
    else:
        # The following tests pass locally; but they fail on Travis o_O
        expected_ts = np.load("data/test_iplv_nofilter_ts.npy")
        np.testing.assert_array_almost_equal(ts, expected_ts)
        expected_avg = np.load("data/test_iplv_nofilter_avg.npy")
        np.testing.assert_array_almost_equal(avg, expected_avg)
Ejemplo n.º 3
0
# -*- coding: utf-8 -*-

import numpy as np
np.set_printoptions(precision=3, linewidth=256)

from dyconnmap.fc import iplv

if __name__ == "__main__":
    data = np.load(
        "/home/makism/Github/dyconnmap/examples/data/eeg_32chans_10secs.npy")
    data = data[0:5, :]

    ts, avg = iplv(data, [1.0, 4.0], 128.0)

    print(avg)