histogram
This commit is contained in:
parent
9f80891616
commit
d77d377849
@ -7,14 +7,13 @@ from IPython import embed
|
|||||||
|
|
||||||
# plot and data values
|
# plot and data values
|
||||||
inch_factor = 2.54
|
inch_factor = 2.54
|
||||||
|
sampling_rate = 40000
|
||||||
data_dir = '../data'
|
data_dir = '../data'
|
||||||
#dataset = '2018-11-09-ad-invivo-1'
|
dataset = '2018-11-09-ad-invivo-1'
|
||||||
dataset = '2018-11-13-aa-invivo-1'
|
#dataset = '2018-11-13-aa-invivo-1'
|
||||||
|
|
||||||
# read eod and time of baseline
|
# read eod and time of baseline
|
||||||
time, eod = read_baseline_eod(os.path.join(data_dir, dataset))
|
time, eod = read_baseline_eod(os.path.join(data_dir, dataset))
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
eod_norm = eod - np.mean(eod)
|
eod_norm = eod - np.mean(eod)
|
||||||
|
|
||||||
# calculate eod times and indices by zero crossings
|
# calculate eod times and indices by zero crossings
|
||||||
@ -22,20 +21,15 @@ threshold = 0
|
|||||||
shift_eod = np.roll(eod_norm, 1)
|
shift_eod = np.roll(eod_norm, 1)
|
||||||
eod_times = time[(eod_norm >= threshold) & (shift_eod < threshold)]
|
eod_times = time[(eod_norm >= threshold) & (shift_eod < threshold)]
|
||||||
|
|
||||||
|
eod_duration = eod_times[2]- eod_times[1] #time in s
|
||||||
|
|
||||||
|
|
||||||
eod_duration = eod_times[2]- eod_times[1]
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 5cd62554fa5af12a6a50661f0a60cd2b0457e702
|
|
||||||
# read spikes during baseline activity
|
# read spikes during baseline activity
|
||||||
spikes = read_baseline_spikes(os.path.join(data_dir, dataset))
|
spikes = read_baseline_spikes(os.path.join(data_dir, dataset)) #spikes in s
|
||||||
# calculate interpike intervals and plot them
|
# calculate interpike intervals and plot them
|
||||||
interspikeintervals = np.diff(spikes)/eod_duration
|
interspikeintervals = np.diff(spikes)/eod_duration
|
||||||
|
|
||||||
fig, ax = plt.subplots(figsize=(20/inch_factor, 10/inch_factor))
|
fig, ax = plt.subplots(figsize=(20/inch_factor, 10/inch_factor))
|
||||||
plt.hist(interspikeintervals, bins=np.arange(0, np.max(interspikeintervals), 0.0001), color='royalblue')
|
plt.hist(interspikeintervals, bins=np.arange(0, np.max(interspikeintervals), 0.1), color='royalblue')
|
||||||
plt.xlabel("eod cycles", fontsize = 22)
|
plt.xlabel("eod cycles", fontsize = 22)
|
||||||
plt.xticks(fontsize = 18)
|
plt.xticks(fontsize = 18)
|
||||||
plt.ylabel("number of \n interspikeintervals", fontsize = 22)
|
plt.ylabel("number of \n interspikeintervals", fontsize = 22)
|
||||||
|
Loading…
Reference in New Issue
Block a user