Concatenating Epochs objects in Python?

Hi,

Is it possible to concatenate multiple Epochs objects in Python? For
example, if I load one raw fif file and create an object (let's call it
epochs1) with three epochs A, B, and C, and then I load another raw fif
file and create epochs2 with three epochs D, E, and F, what I would like to
do is combine them into a single object with six epochs A, B, C, D, E, F.

I can't find a method for this in the reference and all I see online is
this github discussion
https://github.com/mne-tools/mne-python/issues/120where it seems like
this was ultimately not done. Loading multiple raw fif
files is not a good option for me because my files are very large and I
don't have the memory to handle it. I suppose another thing I could do is
load one raw fif file at a time and save its epochs to a new fif file, and
then load the separate epoched .fif files together (if mne.read_epochs
allows this) but I am hoping to avoid saving a bunch of files, I'd rather
just create and concatenate the epochs on the fly if that is possible.

Thank you,
Steve

Stephen Politzer-Ahles
New York University, Abu Dhabi
Neuroscience of Language Lab
http://www.nyu.edu/projects/politzer-ahles/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140403/01480b6d/attachment.html

Hi Steve,

Yes, you are right, concatenating Epochs is currently not supported.
Unless you use "preload=True", it won't actually load the data of the
raw file when creating a Raw object. So you should be able to just use a
list of file names when creating Raw and it should work.

The only time you need "preload=True" is when you want to modify the raw
data, e.g., using filtering. In this case, you could load each raw file,
filter it, save it, and then create a new Raw instance that combines all
the files. Like that, you will only need enough RAM to have a single raw
file fully loaded.

HTH,

Martin

Thanks for the input! I do indeed need to do some filtering as well, so I
guess in this case saving extra raw [filtered] files will be unavoidable.

Thanks,
Steve

Stephen Politzer-Ahles
New York University, Abu Dhabi
Neuroscience of Language Lab
http://www.nyu.edu/projects/politzer-ahles/