Skip to content

Concatenating * raw.fif files

Christian Brodbeck edited this page Mar 31, 2020 · 1 revision

Sometimes recordings are interrupted, and the session is saved in two or more files instead of a single file. In that case, these files can be concatenated before further processing, so that they can afterwards be treated identically to other raw files. The code snippet below assumes that both segments (R0001_session_1 and R0001_session_2) have been converted to *-raw.fif files:

import mne
raw = mne.io.read_raw_fif('R0001_session_1-raw.fif')
raw2 = mne.io.read_raw_fif('R0001_session_2-raw.fif')
raw.append(raw2)
raw.save('R0001_session-raw.fif')