mne.io.read_raw_edf

mne.io.read_raw_edf(input_fname, montage=None, eog=None, misc=None, stim_channel='', annot=None, annotmap=None, exclude=(), preload=False, verbose=None)[source]

Reader function for EDF+, BDF, GDF conversion to FIF.

Parameters:
input_fname : str

Path to the EDF+, BDF, or GDF file.

montage : str | None | instance of Montage

Path or instance of montage containing electrode positions. If None, sensor locations are (0,0,0). See the documentation of mne.channels.read_montage() for more information.

eog : list or tuple

Names of channels or list of indices that should be designated EOG channels. Values should correspond to the electrodes in the edf file. Default is None.

misc : list or tuple

Names of channels or list of indices that should be designated MISC channels. Values should correspond to the electrodes in the edf file. Default is None.

stim_channel : str | int | ‘auto’ | False

The channel name or channel index (starting at 0). -1 corresponds to the last channel. If False, there will be no stim channel added. If ‘auto’ (default), the stim channel will be added as the last channel if the header contains 'EDF Annotations' or GDF events (otherwise stim channel will not be added). None is accepted as an alias for False.

Warning

This defaults to ‘auto’ in 0.17. When using TAL channels (‘EDF Annotations’, ‘BDF Annotations’) set stim_channel to False and migrate the code to use mne.events_from_annotations().

annot : str | None

Path to annotation file. If None, no derived stim channel will be added (for files requiring annotation file to interpret stim channel). This was deprecated in 0.17 and will be removed in 0.18.

annotmap : str | None

Path to annotation map file containing mapping from label to trigger. Must be specified if annot is not None. This was deprecated in 0.17 and will be removed in 0.18.

exclude : list of str

Channel names to exclude. This can help when reading data with different sampling rates to avoid unnecessary resampling.

preload : bool or str (default False)

Preload data into memory for data manipulation and faster indexing. If True, the data will be preloaded into memory (fast, requires large amount of memory). If preload is a string, preload is the file name of a memory-mapped file which is used to store the data on the hard drive (slower, requires less memory).

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose() and Logging documentation for more).

Returns:
raw : Instance of RawEDF

A Raw object containing EDF data.

See also

mne.io.Raw
Documentation of attribute and methods.

Notes

Biosemi devices trigger codes are encoded in bits 1-16 of the status channel, whereas system codes (CMS in/out-of range, battery low, etc.) are coded in bits 16-23 (see http://www.biosemi.com/faq/trigger_signals.htm). To retrieve correct event values (bits 1-16), one could do:

>>> events = mne.find_events(...)  # doctest:+SKIP
>>> events[:, 2] >>= 8  # doctest:+SKIP

It is also possible to retrieve system codes, but no particular effort has been made to decode these in MNE.

For GDF files, the stimulus channel is constructed from the events in the header. You should use keyword stim_channel=-1 to add it at the end of the channel list. The id numbers of overlapping events are simply combined through addition. To get the original events from the header, use method raw.find_edf_events.