Closed nwilming closed 8 years ago
@nwilming indeed there is some problem with the code there.
@jaeilepp is on holiday till the end of the month. Feel free to make a PR with a minimal diff. Your code looks reasonable. Only comment is that you need to take care of the fact that some of the raw files being concatenated may not have annotations.
I think this has to do with the mess with first_samp
. I can take a look when I get back.
I think the problem was just with the syncing with raw.plot
. See https://github.com/mne-tools/mne-python/pull/3540.
I'm working on a dataset where I cut 10 minute chunks out of a 1h recording, do some artifact detection and then concatenate the chunks that interest me. It seems that after the concatenation with concate_raws the artifact annotations are out of sync. I have a minimal example that creates an artificial raw structure that shows this behavior:
It seems that the way how annotations are combined is buggy. My guess is that the repeated call of mne.annotations._combine_annotations in mne.io.raw.append does not properly subtract and add the necessary offsets. Since this code is fairly central to mne and I don't understand the consequences of changing it I'm not proposing a PR. But for the example above the following code gives a valid annotation for the concatenated raw object: