Skip to content

Commit 8699626

Browse files
authored
Merge pull request #372 from int-brain-lab/empty_timestamps
Handle empty timestamps in video compression and qc
2 parents 872b879 + 5b6ff87 commit 8699626

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ibllib/io/extractors/camera.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ def _extract(self, sync=None, chmap=None, video_path=None,
123123
count = count[:length]
124124
else:
125125
assert length == count.size, 'fewer counts than frames'
126+
raw_ts = fpga_times[self.label]
127+
assert raw_ts.shape[0] > 0, 'no timestamps found in channel indicated for ' \
128+
f'{self.label} camera'
126129
return align_with_audio(raw_ts, audio, gpio, count,
127130
display=display,
128131
extrapolate_missing=extrapolate_missing)

ibllib/qc/camera.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,11 @@ def run(self, update: bool = False, **kwargs) -> (str, dict):
347347
namespace = f'video{self.label.capitalize()}'
348348
if all(x is None for x in self.data.values()):
349349
self.load_data(**kwargs)
350-
if self.data['frame_samples'] is None:
350+
if self.data['frame_samples'] is None or self.data['timestamps'] is None:
351351
return 'NOT_SET', {}
352+
if self.data['timestamps'].shape[0] == 0:
353+
_log.error(f'No timestamps for {self.label} camera; setting outcome to CRITICAL')
354+
return 'CRITICAL', {}
352355

353356
def is_metric(x):
354357
return isfunction(x) and x.__name__.startswith('check_')

0 commit comments

Comments
 (0)