Average evoked data in a certain time range

External Email - Use Caution

Dear MNE developers,

I would like to ask if it is possible to average the evoked data in a certain time range? For example I would like to have a 2 seconds average (when t=1 to t=3) out of 4 seconds recording (t=0 to t=4) -> middle span averaging.
My objective is to plot a topomap using evoked.plot_topomap in the 1-3 seconds middle span average (the output is just a single topomap image as the result of averaging from the 1-3 seconds)

Best regards,
Melvin H.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190506/01aad4c0/attachment.html

External Email - Use Caution

Hi Melvin,

I believe you can do this interactively in evoked.plot
<https://martinos.org/mne/dev/generated/mne.Evoked.html#mne.Evoked.plot>.
If you want to script this, the easiest solution might be to do the
averaging yourself by following these steps:

1. Crop the data to the desired time interval using evoked.crop
2. Average the resulting evoked.data using numpy
3. Use EvokedArray to create a new evoked instance from this average numpy
array
4. Use evoked.plot_topomap on this average.

Hope that helps,
Mainak