change reference to old_helper_functions

This commit is contained in:
a.ott 2020-01-29 11:04:18 +01:00
parent e7553b24cd
commit d7f70ab48d

View File

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