def test_encoder_events_corrupt(self): path = self.main_path.joinpath('data', 'wheel', 'lt5') for file_events in path.rglob('_iblrig_encoderEvents.raw.*'): dy = raw._load_encoder_events_file_lt5(file_events) self.assertTrue(dy.size > 6) path = self.main_path.joinpath('data', 'wheel', 'ge5') for file_events in path.rglob('_iblrig_encoderEvents.raw.*'): dy = raw._load_encoder_events_file_ge5(file_events) self.assertTrue(dy.size > 6)
def test_wheel_folder(self): # the wheel folder contains other errors in bpod output that had to be addressed # 2 first samples timestamp AWOL instead of only one wf = self.wheel_path / '_iblrig_encoderPositions.raw.2firstsamples.ssv' df = raw._load_encoder_positions_file_lt5(wf) self.assertTrue(np.all(np.diff(np.array(df.re_ts)) > 0)) # corruption in the middle of file wf = self.wheel_path / '_iblrig_encoderEvents.raw.CorruptMiddle.ssv' df = raw._load_encoder_events_file_lt5(wf) self.assertTrue(np.all(np.diff(np.array(df.re_ts)) > 0))
def test_wheel_folders(self): # the wheel folder contains other errors in bpod output that had to be addressed for wf in self.wheel_lt5_path.glob('_iblrig_encoderPositions*.raw*.ssv'): df = raw._load_encoder_positions_file_lt5(wf) self.assertTrue(np.all(np.diff(np.array(df.re_ts)) > 0)) for wf in self.wheel_lt5_path.glob('_iblrig_encoderEvents*.raw*.ssv'): df = raw._load_encoder_events_file_lt5(wf) self.assertTrue(np.all(np.diff(np.array(df.re_ts)) > 0)) for wf in self.wheel_ge5_path.glob('_iblrig_encoderPositions*.raw*.ssv'): df = raw._load_encoder_positions_file_ge5(wf) self.assertTrue(np.all(np.diff(np.array(df.re_ts)) > 0)) for wf in self.wheel_ge5_path.glob('_iblrig_encoderEvents*.raw*.ssv'): df = raw._load_encoder_events_file_ge5(wf) self.assertTrue(np.all(np.diff(np.array(df.re_ts)) > 0))
def test_encoder_events_duds(self): # TRAINING SESSIONS path = self.training_lt5['path'] / "raw_behavior_data" path = next(path.glob("_iblrig_encoderEvents.raw*.ssv"), None) dy = raw._load_encoder_events_file_lt5(path) self.assertEqual(dy.bns_ts.dtype.name, 'object') self.assertTrue(dy.shape[0] == 7) # -- version >= 5.0.0 path = self.training_ge5['path'] / "raw_behavior_data" path = next(path.glob("_iblrig_encoderEvents.raw*.ssv"), None) dy = raw._load_encoder_events_file_ge5(path) self.assertTrue(dy.shape[0] == 38) # BIASED SESSIONS path = self.biased_lt5['path'] / "raw_behavior_data" path = next(path.glob("_iblrig_encoderEvents.raw*.ssv"), None) dy = raw._load_encoder_events_file_lt5(path) self.assertEqual(dy.bns_ts.dtype.name, 'object') self.assertTrue(dy.shape[0] == 7) # -- version >= 5.0.0 path = self.biased_ge5['path'] / "raw_behavior_data" path = next(path.glob("_iblrig_encoderEvents.raw*.ssv"), None) dy = raw._load_encoder_events_file_ge5(path) self.assertTrue(dy.shape[0] == 26)