- mne.preprocessing.annotate_flat(raw, bad_percent=5.0, min_duration=0.005, picks=None, verbose=None)¶
Annotate flat segments of raw data (or add to a bad channel list).
- rawinstance of
The raw data.
The percentage of the time a channel can be bad. Below this percentage, temporal bad marking (
Annotations) will be used. Above this percentage, spatial bad marking (
info['bads']) will be used. Defaults to 5 (5%).
The minimum duration (sec) to consider as actually flat. For some systems with low bit data representations, adjacent time samples with exactly the same value are not totally uncommon. Defaults to 0.005 (5 ms).
Channels to include. Slices and lists of integers will be interpreted as channel indices. In lists, channel type strings (e.g.,
['meg', 'eeg']) will pick channels of those types, channel name strings (e.g.,
['MEG0111', 'MEG2623']will pick the given channels. Can also be the string values “all” to pick all channels, or “data” to pick data channels. None (default) will pick good data channels. Note that channels in
info['bads']will be included if their names or indices are explicitly provided.
- verbosebool |
- rawinstance of
This function is useful both for removing short segments of data where the acquisition system clipped (i.e., hit the ADC limit of the hardware) and for automatically identifying channels that were flat for a large proportion of a given recording.
This function may perform much faster if data are loaded in memory, as it loads data one channel at a time (across all time points), which is typically not an efficient way to read raw data from disk.
New in version 0.18.