meh
This commit is contained in:
commit
fa105a017c
@ -22,7 +22,7 @@ spikes = read_baseline_spikes(os.path.join(data_dir, dataset))
|
||||
interspikeintervals = np.diff(spikes)
|
||||
|
||||
fig, ax = plt.subplots(figsize=(20/inch_factor, 10/inch_factor))
|
||||
plt.hist(interspikeintervals, bins=np.arange(0, np.max(interspikeintervals), 0.0001), color='darkblue')
|
||||
plt.hist(interspikeintervals, bins=np.arange(0, np.max(interspikeintervals), 0.0001), color='royalblue')
|
||||
plt.xlabel("time [ms]", fontsize = 22)
|
||||
plt.xticks(fontsize = 18)
|
||||
plt.ylabel("number of \n interspikeintervals", fontsize = 22)
|
||||
@ -32,8 +32,13 @@ ax.spines["right"].set_visible(False)
|
||||
fig.tight_layout()
|
||||
plt.show()
|
||||
#plt.show()
|
||||
<<<<<<< HEAD
|
||||
#plt.savefig('isis.pdf')
|
||||
exit()
|
||||
=======
|
||||
plt.savefig('isis.png')
|
||||
|
||||
>>>>>>> b9573c65638c8a716e57d75fbe550f0a1ef8859f
|
||||
|
||||
# calculate coefficient of variation
|
||||
mu = np.mean(interspikeintervals)
|
||||
@ -85,13 +90,13 @@ 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='royalblue', alpha=0.5)
|
||||
ax2.fill_between(time_axis, mu_eod+std_eod, mu_eod-std_eod, color='navy', 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='darkblue')
|
||||
ax2.tick_params(axis='y', labelcolor='navy')
|
||||
ax2.spines['top'].set_visible(False)
|
||||
|
||||
plt.yticks(fontsize=18)
|
||||
fig.tight_layout()
|
||||
#plt.show()
|
||||
plt.savefig('eodform_spikehist.pdf')
|
||||
plt.savefig('eodform_spikehist.png')
|
@ -8,7 +8,7 @@ from IPython import embed
|
||||
# define sampling rate and data path
|
||||
sampling_rate = 40 #kHz
|
||||
data_dir = "../data"
|
||||
dataset = "2018-11-13-aj-invivo-1"
|
||||
dataset = "2018-11-14-al-invivo-1"
|
||||
inch_factor = 2.54
|
||||
# parameters for binning, smoothing and plotting
|
||||
cut_window = 60
|
||||
@ -23,8 +23,8 @@ spike_bins = np.arange(-cut_window, cut_window+1) #ms
|
||||
|
||||
# read data from files
|
||||
spikes = read_chirp_spikes(os.path.join(data_dir, dataset))
|
||||
eod = read_chirp_eod(os.path.join(data_dir, dataset))
|
||||
chirp_times = read_chirp_times(os.path.join(data_dir, dataset))
|
||||
#eod = read_chirp_eod(os.path.join(data_dir, dataset))
|
||||
#chirp_times = read_chirp_times(os.path.join(data_dir, dataset))
|
||||
|
||||
# make a delta f map for the quite more complicated keys
|
||||
df_map = map_keys(spikes)
|
||||
@ -42,12 +42,16 @@ for deltaf in df_map.keys():
|
||||
df_phase_time[deltaf] = {}
|
||||
df_phase_binary[deltaf] = {}
|
||||
for rep in df_map[deltaf]:
|
||||
chirp_size = int(rep[-1].strip('Hz'))
|
||||
# print(chirp_size)
|
||||
if chirp_size == 150:
|
||||
continue
|
||||
for phase in spikes[rep]:
|
||||
for idx in np.arange(num_bin):
|
||||
# check the phase
|
||||
if phase[1] > phase_vec[idx] and phase[1] < phase_vec[idx+1]:
|
||||
|
||||
# get spikes between 50 ms befor and after the chirp
|
||||
# get spikes between 60 ms before and after the chirp
|
||||
spikes_to_cut = np.asarray(spikes[rep][phase])
|
||||
spikes_cut = spikes_to_cut[(spikes_to_cut > -cut_window) & (spikes_to_cut < cut_window)]
|
||||
spikes_idx = np.round(spikes_cut*sampling_rate)
|
||||
@ -98,5 +102,5 @@ for df in df_phase_time.keys():
|
||||
fig.tight_layout()
|
||||
#plt.show()
|
||||
#exit()
|
||||
namefigure = '../figures/%s_%i_%i_firingrate.pdf' %(dataset, df, index_phase)
|
||||
plt.savefig(namefigure)
|
||||
namefigure = '../figures/%s_%i_%i_firingrate.png' %(dataset, df, index_phase)
|
||||
plt.savefig(namefigure)
|
||||
|
@ -40,8 +40,8 @@ ax1 = fig.add_subplot(211)
|
||||
plt.yticks(fontsize=18)
|
||||
ax2 = fig.add_subplot(212, sharex=ax1)
|
||||
plt.setp(ax1.get_xticklabels(), visible=False)
|
||||
ax1.plot(time*1000, signal, color = 'royalblue', lw = 1)
|
||||
ax2.plot(time*1000, freq, color = 'royalblue', lw = 3)
|
||||
ax1.plot(time*1000, signal, color = 'midnightblue', lw = 1)
|
||||
ax2.plot(time*1000, freq, color = 'midnightblue', lw = 3)
|
||||
|
||||
ax1.set_ylabel("field [mV]", fontsize = 22)
|
||||
|
||||
@ -54,4 +54,4 @@ plt.xticks(fontsize=18)
|
||||
plt.yticks(fontsize=18)
|
||||
fig.tight_layout()
|
||||
#plt.show()
|
||||
plt.savefig('stimulus_chirp.pdf')
|
||||
plt.savefig('stimulus_chirp.png')
|
||||
|
Loading…
Reference in New Issue
Block a user