finally :D
This commit is contained in:
parent
a151ebd886
commit
c713cbc1ff
@ -42,33 +42,31 @@ for deltaf in df_map.keys():
|
|||||||
binary_spikes = np.isin(cut_range, spikes_idx)*1
|
binary_spikes = np.isin(cut_range, spikes_idx)*1
|
||||||
|
|
||||||
if phase_vec[idx] in df_phase_time[deltaf].keys():
|
if phase_vec[idx] in df_phase_time[deltaf].keys():
|
||||||
df_phase_time[deltaf][phase_vec[idx]].append(spikes[rep][phase])
|
df_phase_time[deltaf][phase_vec[idx]].append(spikes_cut)
|
||||||
df_phase_binary[deltaf][phase_vec[idx]] = np.vstack((df_phase_binary[deltaf][phase_vec[idx]], binary_spikes))
|
df_phase_binary[deltaf][phase_vec[idx]] = np.vstack((df_phase_binary[deltaf][phase_vec[idx]], binary_spikes))
|
||||||
else:
|
else:
|
||||||
df_phase_time[deltaf][phase_vec[idx]] = [spikes[rep][phase]]
|
df_phase_time[deltaf][phase_vec[idx]] = [spikes_cut]
|
||||||
df_phase_binary[deltaf][phase_vec[idx]] = binary_spikes
|
df_phase_binary[deltaf][phase_vec[idx]] = binary_spikes
|
||||||
|
|
||||||
|
|
||||||
plot_trials = df_phase_binary['-50Hz'][0.0]
|
|
||||||
#hist_data = plt.hist(plot_trials)
|
plot_trials = df_phase_time['-50Hz'][0.0]
|
||||||
#ax.plot(hist_data[1][:-1], hist_data[0])
|
plot_trials_binary = np.mean(df_phase_binary['-50Hz'][0.0], axis=0)
|
||||||
|
|
||||||
|
mu = 1
|
||||||
|
sigma = 100
|
||||||
|
time_gauss = np.arange(-4*sigma, 4*sigma, 1)
|
||||||
|
gauss = gaussian(time_gauss, mu, sigma)
|
||||||
|
smoothed_spikes = np.convolve(plot_trials_binary, gauss, 'same')
|
||||||
|
time_axis = np.arange(-50, 50, 1/sampling_rate)
|
||||||
|
|
||||||
fig, ax = plt.subplots()
|
fig, ax = plt.subplots()
|
||||||
for i, trial in enumerate(plot_trials):
|
for i, trial in enumerate(plot_trials):
|
||||||
embed()
|
ax.scatter(trial, np.ones(len(trial))+i, marker='|', color='k')
|
||||||
exit()
|
ax.plot(time_axis, smoothed_spikes)
|
||||||
trial[trial == 0] = np.nan
|
|
||||||
ax.scatter(np.ones(len(trial)), trial, marker='|', color='k', size=12)
|
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
|
||||||
#mu = 1
|
|
||||||
#sigma = 1
|
|
||||||
#time_gauss = np.arange(-4, 4, 1)
|
|
||||||
#gauss = gaussian(time_gauss, mu, sigma)
|
|
||||||
# spikes during time vec (00010000001)?
|
|
||||||
|
|
||||||
#smoothed_spikes = np.convolve(plot_spikes, gauss, 'same')
|
|
||||||
#window = np.mean(np.diff(plot_spikes))
|
#window = np.mean(np.diff(plot_spikes))
|
||||||
#time_vec = np.arange(plot_spikes[0], plot_spikes[-1]+window, window)
|
#time_vec = np.arange(plot_spikes[0], plot_spikes[-1]+window, window)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user