Hello,
In my studies, I record bipolar ECoG from 3 animals simultaneously. Can I combine several files belonging to the same experimental group under one file? For example, there are 12 animals in a group and I can record from 3 animals at once. Therefore, at the end of the experiment, there are 4 different files. I want to merge these files.
Yes but that’s really just some sort of concatenation / merging and loses information about individual participants … from the doc:
in case of multple files, the new file will get the subject, recording, date and time
of the file that has the reference at the moment of printing.
You can select the reference in the Time-menu
My understanding was they’d like to have some sort of a meta-structure (in the most simple case, basically a list of recordings), but maybe I was mistaken.
if they’re recording 3 animals at once, presumably that means something like channels 1-10 are animal A, channels 11-20 are animal B, etc. So I think the goal is to add channels? And although this is possible it is not very easy in MNE-Python because it would require that all 4 files have exactly the same duration. So you would probably need to do something like:
load the data into separate Raw objects
use .get_data() method to get the NumPy arrays
figure out which recording is the longest
zero-pad the other 3 NumPy arrays to match the longest one
combine the arrays with np.concatenate (make sure you do it on the channels axis, not the time axis)
convert back to Raw object using mne.io.RawArray
An unstated part of step 6 is “getting the channel names right” — they need to be unique, and presumably you want the channel names to encode both physical location and which animal they were from.
OK… the steps I’ve outlined above describe how to work around that (by zero-padding). This still may or may not be good enough (e.g., if you are trying to align specific events, you might need to zero-pad some at both the beginning and the end). But in principle it’s possible.