diff --git a/code/analysis_rs.py b/code/analysis_rs.py index 356d461..106fb28 100644 --- a/code/analysis_rs.py +++ b/code/analysis_rs.py @@ -42,7 +42,7 @@ cv = sigma/mu # plot psth into the same plot # calculate vector strength -threshold = 0; +threshold = 0 shift_eod = np.roll(eod, 1) eod_times = time[(eod >= threshold) & (shift_eod < threshold)] sampling_rate = 40000.0 diff --git a/code/utility.py b/code/utility.py index 86f2407..0c1ce34 100644 --- a/code/utility.py +++ b/code/utility.py @@ -2,7 +2,7 @@ import numpy as np def zero_crossing(eod,time): - threshold = 0; + threshold = 0 shift_eod = np.roll(eod, 1) eod_times = time[(eod >= threshold) & (shift_eod < threshold)] sampling_rate = 40000.0 @@ -10,9 +10,9 @@ def zero_crossing(eod,time): return eod_idx -def vector_strength(spike_times, eod_durations) +def vector_strength(spike_times, eod_durations): alphas = spike_times/ eod_durations cs = (1/len(spike_times))*np.sum(np.cos(alphas))^2 sn = (1/len(spike_times))*np.sum(np.sin(alphas))^2 - vs = np.sprt(cs+sn) + vs = np.sqrt(cs+sn) return vs