pynwb
pynwb copied to clipboard
Improve TimeSeries trializing functionality.
Feature Request
Users need ability trialize TimeSeries through means other than supplying list of TimeSeries that apply to trials/epochs.
Currently users must do this like so:
import datetime
from pynwb import TimeSeries, NWBFile
nwbfile = NWBFile(identifier='foo', session_start_time=datetime.datetime.now(), session_description='bar')
ts = TimeSeries(name='a', data=np.arange(1000), timestamps=np.arange(1000), unit='m')
nwbfile.add_acquisition(ts)
nwbfile.add_trial(start_time=5., stop_time=10., timeseries=[ts])
nwbfile.add_trial(start_time=15., stop_time=20., timeseries=[ts])
Additional info can be found in the NWB basics tutorial and the API docs.
Additional requirements for trializing TImeSeries data (per comment from @bendichter on #830):
- Ending a trial either using 'stop_time' or a duration from 'start_time'
- Aligning to different events in the trial, such as stimulus onset, or behavior onset.
- Expanding the window before the start of the trial and/or after the end
- Aligning to non-interval events, such as annotations
- Aligning to intervals other than
trials
The hidden method TimeIntervals.__calculate_idx_count may need to be modified and exposed.
another possible requirement: filter the trials by a certain condition