diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2015-05-11 17:41:08 +0200 |
---|---|---|
committer | Mario Mulansky <mario.mulansky@gmx.net> | 2015-05-11 17:41:08 +0200 |
commit | bec2529367f1bdd5dac6d6fbaec560a30feec3c7 (patch) | |
tree | 9c817b1e3648b52238ae3aea44f5572097855f37 /pyspike/DiscreteFunc.py | |
parent | 3b10b416940ae674df6d9dff8cdddc31085d8cf5 (diff) |
treatment of empty spike trains in spike sync
Diffstat (limited to 'pyspike/DiscreteFunc.py')
-rw-r--r-- | pyspike/DiscreteFunc.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pyspike/DiscreteFunc.py b/pyspike/DiscreteFunc.py index dfe2cab..6ade87e 100644 --- a/pyspike/DiscreteFunc.py +++ b/pyspike/DiscreteFunc.py @@ -136,6 +136,10 @@ class DiscreteFunc(object): :rtype: pair of float """ + if len(self.y) <= 2: + # no actual values in the profile, return spike sync of 0 + return 0.0, 1.0 + def get_indices(ival): """ Retuns the indeces surrounding the given interval""" start_ind = np.searchsorted(self.x, ival[0], side='right') |