Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions neo/rawio/openephysrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ def _parse_header(self):
np.median(diff) == RECORD_SIZE
), f"This file has a non valid data block size for channel {chan_id}, this case cannot be handled"

channel_has_corrupted_timestamps = np.any(diff <= 0)
if channel_has_corrupted_timestamps:
# protect against corrupted timestamp in channel
raise ValueError(f"{ch_name} has timestamps with zero values or negative differences between consecutive timestamps, this file ({continuous_filename}) with corrupted timestamps needs to be moved away from the folder.")

if seg_index == 0:
# add in channel list
if ch_name[:2].upper() == "CH":
Expand Down