@@ -321,6 +321,9 @@ def apply_gain_zoom(self, factor_ratio):
321321
322322 def get_data_in_chunk (self , t1 , t2 , segment_index ):
323323 ind1 , ind2 = self .get_chunk_indices (t1 , t2 , segment_index )
324+ # handle blank spots
325+ if ind1 == ind2 :
326+ return np .array ([]), np .array ([[]]), [], [], [], []
324327
325328 traces_chunk = self .controller .get_traces (segment_index = segment_index , start_frame = ind1 , end_frame = ind2 )
326329
@@ -345,7 +348,11 @@ def get_data_in_chunk(self, t1, t2, segment_index):
345348 data_curves += offsets [:, None ]
346349
347350 t_start , _ = self .controller .get_t_start_t_stop ()
348- times_chunk = np .arange (traces_chunk .shape [0 ], dtype = 'float64' ) / self .controller .sampling_frequency + max (t1 , t_start )
351+ if self .controller .main_settings ["use_times" ]:
352+ recording = self .controller .analyzer .recording
353+ times_chunk = recording .get_times (segment_index = segment_index )[ind1 :ind2 ]
354+ else :
355+ times_chunk = np .arange (traces_chunk .shape [0 ], dtype = 'float64' ) / self .controller .sampling_frequency + max (t1 , t_start )
349356
350357 scatter_x = []
351358 scatter_y = []
@@ -355,7 +362,6 @@ def get_data_in_chunk(self, t1, t2, segment_index):
355362 global_to_local_chan_inds = np .zeros (self .controller .channel_ids .size , dtype = 'int64' )
356363 global_to_local_chan_inds [visible_channel_inds ] = np .arange (visible_channel_inds .size , dtype = 'int64' )
357364
358-
359365 for unit_index , unit_id in self .controller .iter_visible_units ():
360366
361367 inds = np .flatnonzero (spikes_chunk ["unit_index" ] == unit_index )
@@ -482,6 +488,12 @@ def _qt_seek(self, t):
482488
483489 times_chunk , data_curves , scatter_x , scatter_y , scatter_colors , scatter_unit_ids = \
484490 self .get_data_in_chunk (t1 , t2 , self .controller .get_time ()[1 ])
491+
492+ if times_chunk .size == 0 :
493+ self .signals_curve .setData ([], [])
494+ self .scatter .setData (x = [], y = [], brush = [])
495+ return
496+
485497 connect = np .ones (data_curves .shape , dtype = 'bool' )
486498 connect [:, - 1 ] = 0
487499
0 commit comments