braintools.cogtask.interval_of#
- braintools.cogtask.interval_of(elem, total)[source]#
Get slice for a named period in a sequence of periods.
- Parameters:
- Returns:
Slice object for accessing the period in time-indexed arrays.
- Return type:
Examples
>>> periods = {'fixation': 10, 'stimulus': 20, 'delay': 15} >>> interval_of('stimulus', periods) slice(10, 30, None)