Skip to content

Commit

Permalink
minor bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
handejong committed Sep 16, 2024
1 parent dda8458 commit ca83a5f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Fipster_python/Fipster.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ def peri_event(self, stamps, window = 10, from_ref = False):
# First process the stamps
if stamps.__class__ == str:
stamps = self.timestamps[stamps]
if stamps.__class__ == pd.Series:
stamps = stamps.values

# Make the timeline
timeline = np.arange(-window, window, 1/self.framerate)
Expand All @@ -735,8 +737,10 @@ def peri_event(self, stamps, window = 10, from_ref = False):
limit = (window+1)/self.framerate
indexer = (stamps>data[1, 0, 0]+limit) & (stamps<data[1, -1, 0]-limit)
if not sum(indexer) == len(stamps):
print(f'Removing the following timestamps because not enough data is available at the beginning or the end of the recording:')
print(f'NOTE: not enough data is available at the beginning or the end of the recording. Adding nan values for these stamps:')
print(stamps[~indexer])

# We removed this and instead we'll include np.nan values (see below)
#stamps = stamps[indexer]
#output = output[indexer, :, :]
#original_time = original_time[indexer, :, :]
Expand Down

0 comments on commit ca83a5f

Please sign in to comment.