diff options
author | Mario Mulansky <mario.mulansky@gmx.net> | 2017-10-04 21:56:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-04 21:56:40 -0700 |
commit | de571efd0894f0332eadec7e4a2184f9a4ffaf25 (patch) | |
tree | 0e6bf7b745a5baae0bee0a4d8a2873c8ca4bef85 /pyspike/DiscreteFunc.py | |
parent | f4ea757a1a32be3df440b4d742cafd5036544225 (diff) | |
parent | ecd4b5f0f7e93859c1262593e2c09e1eb6775819 (diff) |
Merge pull request #27 from mariomulansky/develop
Merge v 0.5.2
Diffstat (limited to 'pyspike/DiscreteFunc.py')
-rw-r--r-- | pyspike/DiscreteFunc.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pyspike/DiscreteFunc.py b/pyspike/DiscreteFunc.py index fe97bc2..caad290 100644 --- a/pyspike/DiscreteFunc.py +++ b/pyspike/DiscreteFunc.py @@ -170,10 +170,6 @@ expected." start_ind, end_ind = get_indices(ival) value += np.sum(self.y[start_ind:end_ind]) multiplicity += np.sum(self.mp[start_ind:end_ind]) - if multiplicity == 0.0: - # empty profile, return spike sync of 1 - value = 1.0 - multiplicity = 1.0 return (value, multiplicity) def avrg(self, interval=None, normalize=True): @@ -190,7 +186,10 @@ expected." """ val, mp = self.integral(interval) if normalize: - return val/mp + if mp > 0: + return val/mp + else: + return 1.0 else: return val |