Initial commit
This commit is contained in:
19
test/visual_sanity_checks.py
Normal file
19
test/visual_sanity_checks.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from utils.file_utils import load_preprocessed_data, get_epochs
|
||||
|
||||
|
||||
def check_peaks():
|
||||
"""
|
||||
Sanity check for the "get_peaks" method
|
||||
"""
|
||||
import matplotlib.pyplot as plt
|
||||
raw = load_preprocessed_data('002', 'N170')
|
||||
epochs, _ = get_epochs(raw, [('face', 'intact')], picks='P7')
|
||||
ch, latency, peak = epochs.average().get_peak(tmin=0.13, tmax=0.2, mode='neg', return_amplitude=True)
|
||||
import numpy as np
|
||||
plt.plot(epochs.times, np.squeeze(epochs.average().data.T))
|
||||
plt.vlines([0.13, 0.2], -0.00001, 0.00001, colors='r', linestyles='dotted')
|
||||
plt.vlines(latency, -0.00001, 0.00001, colors='gray', linestyles='dotted')
|
||||
plt.show()
|
||||
|
||||
|
||||
check_peaks()
|
||||
Reference in New Issue
Block a user