I often find myself wanting data from epochs in a certain time window, such as from -0.1 to 0.3 seconds. I don't want to look at epochs.times and compute the corresponding sample index every time, so I usually do something like epochs.copy().crop(tmin, tmax).get_data(). But copying the epochs is of course memory (and time) intensive.
I suggest we add two new parameters to the get_data method for raw, epochs, and evoked (evoked still needs the get_data method to be implemented, see #9244): tstart and tstop (or tmin, and tmax)
The get_data method for raw already has start and stop parameters, based on sample indices. The corresponding tstart/tstop params would operate the same way, but in seconds.
Adding something like tstart and tstop (in seconds) would also mean that we should add a return_times=True|False parameter to the epochs.get_data (and evoked.get_data, once we have it). That param is already there for raw.
Finally, maybe this would be a good opportunity to make the get_data interface equal between raw, epochs, and evoked.
epochs and evoked would then need to get the following that are already present in raw:
What do you think?
I often find myself wanting data from epochs in a certain time window, such as from -0.1 to 0.3 seconds. I don't want to look at
epochs.timesand compute the corresponding sample index every time, so I usually do something likeepochs.copy().crop(tmin, tmax).get_data(). But copying the epochs is of course memory (and time) intensive.I suggest we add two new parameters to the
get_datamethod for raw, epochs, and evoked (evoked still needs the get_data method to be implemented, see #9244):tstartandtstop(ortmin, andtmax)The
get_datamethod for raw already hasstartandstopparameters, based on sample indices. The correspondingtstart/tstopparams would operate the same way, but in seconds.Adding something like
tstartandtstop(in seconds) would also mean that we should add areturn_times=True|Falseparameter to the epochs.get_data (and evoked.get_data, once we have it). That param is already there for raw.Finally, maybe this would be a good opportunity to make the
get_datainterface equal between raw, epochs, and evoked.epochs and evoked would then need to get the following that are already present in raw:
What do you think?