From 7bec7f0fe1c40146e8b45757d4c156a4f9b49001 Mon Sep 17 00:00:00 2001 From: Mario Mulansky Date: Tue, 20 Jan 2015 14:39:22 +0100 Subject: add spike sync to some examples --- examples/averages.py | 15 +++++++++++++++ examples/spike_sync.py | 3 +-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/examples/averages.py b/examples/averages.py index 6413ab2..c3e81e2 100644 --- a/examples/averages.py +++ b/examples/averages.py @@ -42,3 +42,18 @@ print("SPIKE-distance (0-1000): %.8f" % spike1) print("SPIKE-distance (1000-2000): %.8f" % spike2) print("SPIKE-distance (0-1000) and (2000-3000): %.8f" % spike3) print("SPIKE-distance (1000-2000) and (3000-4000): %.8f" % spike4) +print() + +f = spk.spike_sync_profile(spike_trains[0], spike_trains[1]) + +print("SPIKE-Synchronization: %.8f" % f.avrg()) + +spike_sync1 = f.avrg(interval=(0, 1000)) +spike_sync2 = f.avrg(interval=(1000, 2000)) +spike_sync3 = f.avrg(interval=[(0, 1000), (2000, 3000)]) +spike_sync4 = f.avrg(interval=[(1000, 2000), (3000, 4000)]) + +print("SPIKE-Sync (0-1000): %.8f" % spike_sync1) +print("SPIKE-Sync (1000-2000): %.8f" % spike_sync2) +print("SPIKE-Sync (0-1000) and (2000-3000): %.8f" % spike_sync3) +print("SPIKE-Sync (1000-2000) and (3000-4000): %.8f" % spike_sync4) diff --git a/examples/spike_sync.py b/examples/spike_sync.py index 535f19f..a72dbbf 100644 --- a/examples/spike_sync.py +++ b/examples/spike_sync.py @@ -11,7 +11,6 @@ spike_trains = spk.load_spike_trains_from_txt("../test/SPIKE_Sync_Test.txt", plt.figure() f = spk.spike_sync_profile(spike_trains[0], spike_trains[1]) -# f = spk.spike_sync_profile(spikes1, spikes2) x, y = f.get_plottable_data() plt.plot(x, y, '--ok', label="SPIKE-SYNC profile") print(f.x) @@ -33,7 +32,7 @@ plt.figure() f = spk.spike_sync_profile_multi(spike_trains) x, y = f.get_plottable_data() -plt.plot(x, y, '-k', label="SPIKE-SYNC profile") +plt.plot(x, y, '-k', label="SPIKE-Sync profile") print("Average:", f.avrg()) -- cgit v1.2.3