pynwb icon indicating copy to clipboard operation
pynwb copied to clipboard

Improve TimeSeries trializing functionality.

Open ajtritt opened this issue 5 years ago • 1 comments

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):

  1. Ending a trial either using 'stop_time' or a duration from 'start_time'
  2. Aligning to different events in the trial, such as stimulus onset, or behavior onset.
  3. Expanding the window before the start of the trial and/or after the end
  4. Aligning to non-interval events, such as annotations
  5. Aligning to intervals other than trials

The hidden method TimeIntervals.__calculate_idx_count may need to be modified and exposed.

ajtritt avatar Feb 21 '19 00:02 ajtritt

another possible requirement: filter the trials by a certain condition

bendichter avatar Feb 21 '19 01:02 bendichter