from read_baseline_data import *
from utility import *
#import nix_helpers as nh 
import matplotlib.pyplot as plt
import numpy as np
from IPython import embed #Funktionen importieren


#Zeitpunkte einer EOD über Zero-crossings finden, die in einer Steigung liegen
data_dir = "../data"
dataset = "2018-11-09-ad-invivo-1"
time,eod = read_baseline_eod(os.path.join(data_dir, dataset))
spike_times = read_baseline_spikes(os.path.join(data_dir, dataset))
print(len(spike_times))

eod_times = zero_crossing(eod,time)
eod_durations = np.diff(eod_times)
print(len(spike_times))
print(len(eod_durations))

#for st in spike_times:
	#et = eod_times[eod_times < st]
	#dt = st - et
	
#vs = vector_strength(spike_times, eod_durations)
