This commit is contained in:
efish 2018-11-29 10:12:38 +01:00
parent d83383a4f7
commit 68670cd9b2

View File

@ -14,27 +14,22 @@ dataset = '2018-11-09-ad-invivo-1'
# read eod and time of baseline
time, eod = read_baseline_eod(os.path.join(data_dir, dataset))
<<<<<<< HEAD
=======
>>>>>>> d77d377849b65effc29e550f25a9107463c2120b
eod_norm = eod - np.mean(eod)
# calculate eod times and indices by zero crossings
threshold = 0
shift_eod = np.roll(eod_norm, 1)
eod_times = time[(eod_norm >= threshold) & (shift_eod < threshold)]*40000
eod_times = time[(eod_norm >= threshold) & (shift_eod < threshold)]
eod_duration = eod_times[2]- eod_times[1] #time in s
<<<<<<< HEAD
eod_duration = eod_times[2]- eod_times[1]
=======
>>>>>>> d77d377849b65effc29e550f25a9107463c2120b
# read spikes during baseline activity
spikes = read_baseline_spikes(os.path.join(data_dir, dataset)) #spikes in s
# calculate interpike intervals and plot them
@ -49,9 +44,8 @@ plt.yticks(fontsize = 18)
ax.spines["top"].set_visible(False)
ax.spines["right"].set_visible(False)
fig.tight_layout()
plt.show()
#plt.show()
#plt.savefig('isis.pdf')
exit()
plt.savefig('isis.png')
@ -105,10 +99,10 @@ plt.yticks(fontsize=18)
ax1.spines['top'].set_visible(False)
ax2 = ax1.twinx()
ax2.fill_between(time_axis, mu_eod+std_eod, mu_eod-std_eod, color='navy', alpha=0.5)
ax2.fill_between(time_axis, mu_eod+std_eod, mu_eod-std_eod, color='royalblue', alpha=0.5)
ax2.plot(time_axis, mu_eod, color='black', lw=2)
ax2.set_ylabel('voltage [mV]', fontsize=22)
ax2.tick_params(axis='y', labelcolor='navy')
ax2.tick_params(axis='y', labelcolor='royalblue')
ax2.spines['top'].set_visible(False)
plt.yticks(fontsize=18)