MCPcopy
hub / github.com/mne-tools/mne-python / get_data

Function get_data

mne/preprocessing/tests/test_ctps.py:31–48  ·  view source on GitHub ↗

Generate ground truth and testing data.

(n_trials, j_extent)

Source from the content-addressed store, hash-verified

29
30
31def get_data(n_trials, j_extent):
32 """Generate ground truth and testing data."""
33 ground_truth = np.tile(single_trial, n_trials)
34 my_shape = n_trials, 1, 600
35 random_data = rng.random_sample(my_shape)
36 rand_ints = rng.randint(-j_extent, j_extent, n_trials)
37 jittered_data = np.array([np.roll(single_trial, i) for i in rand_ints])
38 data = np.concatenate(
39 [
40 ground_truth.reshape(my_shape),
41 jittered_data.reshape(my_shape),
42 random_data.reshape(my_shape),
43 ],
44 1,
45 )
46
47 assert data.shape == (n_trials, 3, 600)
48 return data
49
50
51# vary extent of jittering --> creates phaselocks at the borders if

Callers 1

test_ctpsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected