change reference to old_helper_functions
This commit is contained in:
parent
e7553b24cd
commit
d7f70ab48d
@ -4,7 +4,7 @@ import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from IPython import embed
|
||||
import os
|
||||
import helperFunctions as hf
|
||||
import introduction.old_helper_functions as ohf
|
||||
from thunderfish.eventdetection import detect_peaks
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ def set_savepath(new_path):
|
||||
|
||||
|
||||
def main():
|
||||
for folder in hf.get_subfolder_paths("data/"):
|
||||
for folder in ohf.get_subfolder_paths("data/"):
|
||||
filepath = folder + "/basespikes1.dat"
|
||||
set_savepath("figures/" + folder.split('/')[1] + "/")
|
||||
|
||||
@ -51,8 +51,8 @@ def main():
|
||||
|
||||
isi_histogram(spiketimes)
|
||||
|
||||
times, eods = hf.get_traces(folder, 2, 'BaselineActivity')
|
||||
times, v1s = hf.get_traces(folder, 1, 'BaselineActivity')
|
||||
times, eods = ohf.get_traces(folder, 2, 'BaselineActivity')
|
||||
times, v1s = ohf.get_traces(folder, 1, 'BaselineActivity')
|
||||
|
||||
vs = calculate_vector_strength(times, eods, spiketimes, v1s)
|
||||
|
||||
@ -211,10 +211,7 @@ def __vector_strength__(relative_spike_times, eod_durations):
|
||||
if n == 0:
|
||||
return 0
|
||||
|
||||
phase_times = np.zeros(n)
|
||||
|
||||
for i in range(n):
|
||||
phase_times[i] = (relative_spike_times[i] / eod_durations[i]) * 2 * np.pi
|
||||
phase_times = (relative_spike_times / eod_durations) * 2 * np.pi
|
||||
vs = np.sqrt((1 / n * sum(np.cos(phase_times))) ** 2 + (1 / n * sum(np.sin(phase_times))) ** 2)
|
||||
|
||||
return vs
|
||||
|
Loading…
Reference in New Issue
Block a user