summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Mulansky <mario.mulansky@gmx.net>2014-10-14 17:39:49 +0200
committerMario Mulansky <mario.mulansky@gmx.net>2014-10-14 17:39:49 +0200
commit4ff7112e69e75a31c476304ef35960432b8ee17b (patch)
treebb2fa69adceedac5575bead45d0d0b24b7d7c4bc
parent823e44d055b71ba406ea380e8f1087443b38ebb4 (diff)
more isi docs
-rw-r--r--Readme.md12
-rw-r--r--setup.py2
2 files changed, 12 insertions, 2 deletions
diff --git a/Readme.md b/Readme.md
index 55dbd33..6348d09 100644
--- a/Readme.md
+++ b/Readme.md
@@ -98,13 +98,21 @@ The following code loads some exemplary spike trains, computes the dissimilarity
time_interval=(0, 4000))
isi_profile = spk.isi_distance(spike_trains[0], spike_trains[1])
x, y = isi_profile.get_plottable_data()
- plt.plot(x, np.abs(y), '--k')
- print("ISI distance: %.8f" % isi_profil.abs_avrg())
+ plt.plot(x, y, '--k')
+ print("ISI distance: %.8f" % isi_profil.avrg())
plt.show()
The ISI-profile is a piece-wise constant function, there the function `isi_distance` returns an instance of the `PieceWiseConstFunc` class.
As above, this class allows you to obtain arrays that can be used to plot the function with `plt.plt`, but also to compute the absolute average, which amounts to the final scalar ISI-distance.
+Furthermore, `PieceWiseConstFunc` provides an `add` function that can be used to add piece-wise constant function, and a `mul_scalar` function that rescales the function by a scalar.
+This can be used to obtain an average profile:
+
+ isi_profile1.add(isi_profile2)
+ isi_profile1.mul_scalar(0.5)
+ x, y = isi_profile1.get_plottable_data()
+ plt.plot(x, y, label="Average ISI profile")
+
## Computing multi-variate distances
diff --git a/setup.py b/setup.py
index 16a87ea..31db6f8 100644
--- a/setup.py
+++ b/setup.py
@@ -4,6 +4,8 @@ Handles the compilation of pyx source files
Copyright 2014, Mario Mulansky <mario.mulansky@gmx.net>
+Distributed under the BSD License
+
"""
from distutils.core import setup
from Cython.Build import cythonize