analysis
This commit is contained in:
parent
c3c95e8c98
commit
b2c3a99a3b
@ -2,21 +2,22 @@ import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from read_baseline_data import *
|
||||
from IPython import embed
|
||||
from NixFrame import *
|
||||
|
||||
inch_factor = 2.54
|
||||
data_dir = '../data'
|
||||
dataset = '2018-11-09-ad-invivo-1'
|
||||
time, eod = read_baseline_eod(os.path.join(data_dir, dataset))
|
||||
|
||||
fig = plt.figure(figsize=(12/inch_factor, 8/inch_factor))
|
||||
ax = fig.add_subplot(111)
|
||||
ax.plot(time[:1000], eod[:1000])
|
||||
ax.set_xlabel('time [ms]', fontsize=12)
|
||||
ax.set_ylabel('voltage [mV]', fontsize=12)
|
||||
plt.xticks(fontsize = 8)
|
||||
plt.yticks(fontsize = 8)
|
||||
fig.tight_layout()
|
||||
plt.savefig('eod.pdf')
|
||||
#fig = plt.figure(figsize=(12/inch_factor, 8/inch_factor))
|
||||
#ax = fig.add_subplot(111)
|
||||
#ax.plot(time[:1000], eod[:1000])
|
||||
#ax.set_xlabel('time [ms]', fontsize=12)
|
||||
#ax.set_ylabel('voltage [mV]', fontsize=12)
|
||||
#plt.xticks(fontsize = 8)
|
||||
#plt.yticks(fontsize = 8)
|
||||
#fig.tight_layout()
|
||||
#plt.savefig('eod.pdf')
|
||||
|
||||
#interspikeintervalhistogram, windowsize = 1 ms
|
||||
#plt.hist
|
||||
@ -26,14 +27,14 @@ plt.savefig('eod.pdf')
|
||||
|
||||
spikes = read_baseline_spikes(os.path.join(data_dir, dataset))
|
||||
interspikeintervals = np.diff(spikes)
|
||||
fig = plt.figure()
|
||||
plt.hist(interspikeintervals, bins=np.arange(0, np.max(interspikeintervals), 0.0001))
|
||||
plt.show()
|
||||
#fig = plt.figure()
|
||||
#plt.hist(interspikeintervals, bins=np.arange(0, np.max(interspikeintervals), 0.0001))
|
||||
#plt.show()
|
||||
|
||||
mu = np.mean(interspikeintervals)
|
||||
sigma = np.std(interspikeintervals)
|
||||
cv = sigma/mu
|
||||
print(cv)
|
||||
#print(cv)
|
||||
|
||||
# calculate zero crossings of the eod
|
||||
# plot mean of eod circles
|
||||
@ -47,10 +48,15 @@ eod_times = time[(eod >= threshold) & (shift_eod < threshold)]
|
||||
sampling_rate = 40000.0
|
||||
eod_idx = eod_times*sampling_rate
|
||||
|
||||
fig = plt.figure()
|
||||
for i, idx in enumerate(eod_idx):
|
||||
#embed()
|
||||
#exit()
|
||||
plt.plot(time[int(idx):int(eod_idx[i+1])], eod[int(idx):int(eod_idx[i+1])])
|
||||
plt.show()
|
||||
#fig = plt.figure()
|
||||
eod_cuts = [];
|
||||
#for i, idx in enumerate(eod_idx)-1:
|
||||
#eod_cuts.append(eod[int(idx):int(eod_idx[i+1])])
|
||||
#time_cut = time[int(idx):int(eod_idx[i+1])]
|
||||
#plt.plot(time[int(idx):int(eod_idx[i+1])], eod[int(idx):int(eod_idx[i+1])])
|
||||
#plt.show()
|
||||
data = NixToFrame(data_dir)
|
||||
|
||||
|
||||
embed()
|
||||
exit()
|
||||
|
Loading…
Reference in New Issue
Block a user