File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -509,6 +509,26 @@ def reset_times(self):
509509 rs .t_start = None
510510 rs .sampling_frequency = self .sampling_frequency
511511
512+ def shift_start_time (self , shift , segment_index = None ):
513+ """
514+ Shift the starting time of the times.
515+
516+ shift : int | float
517+ The shift to apply to the first time point. If positive,
518+ the current start time will be increased by `shift`. If
519+ negative, the start time will be decreased.
520+
521+ segment_index : int | None
522+ The segment on which to shift the times.
523+ """
524+ segment_index = self ._check_segment_index (segment_index )
525+ rs = self ._recording_segments [segment_index ]
526+
527+ if self .has_time_vector ():
528+ rs .time_vector += shift
529+ else :
530+ rs .t_start += shift
531+
512532 def sample_index_to_time (self , sample_ind , segment_index = None ):
513533 """
514534 Transform sample index into time in seconds
You can’t perform that action at this time.
0 commit comments