class, preload=False, first_samps=(0, ), last_samps=None, filenames=(None, ), raw_extras=(None, ), orig_format='double', dtype=<class 'numpy.float64'>, buffer_size_sec=1.0, orig_units=None, *, verbose=None)[source]#

Base class for Raw data.


The mne.Info object with information about the sensors and methods of measurement.

preloadbool | str | ndarray

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). If preload is an ndarray, the data are taken from that array. If False, data are not read until save.


Iterable of the first sample number from each raw file. For unsplit raw files this should be a length-one list or tuple.

last_sampsiterable | None

Iterable of the last sample number from each raw file. For unsplit raw files this should be a length-one list or tuple. If None, then preload must be an ndarray.


Tuple of length one (for unsplit raw files) or length > 1 (for split raw files).

raw_extraslist of dict

The data necessary for on-demand reads for the given reader format. Should be the same length as filenames. Will have the entry raw_extras['orig_nchan'] added to it for convenience.


The data format of the original raw file (e.g., 'double').

dtypedtype | None

The dtype of the raw data. If preload is an ndarray, its dtype must match what is passed here.


The buffer size in seconds that should be written by default using

orig_unitsdict | None

Dictionary mapping channel names to their units as specified in the header file. Example: {‘FC1’: ‘nV’}.

New in v0.17.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

See also

Documentation of attributes and methods.


This class is public to allow for stable type-checking in user code (i.e., isinstance(my_raw_object, BaseRaw)) but should not be used as a constructor for Raw objects (use instead one of the subclass constructors, or one of the* functions).

Subclasses must provide the following methods:

  • _read_segment_file(self, data, idx, fi, start, stop, cals, mult) (only needed for types that support on-demand disk reads)


Annotations for marking segments of data.


Channel names.


The current gradient compensation grade.


The filenames used.


The first data sample.


The first time point (including first_samp but not meas_date).


The last data sample.


Number of time points.


Whether or not projections are active.


Time points.



Check channel type membership.


Get raw data and times.


Return the number of time points.

add_channels(add_list[, force_update_info])

Append new channels to the instance.

add_events(events[, stim_channel, replace])

Add events to stim channel.

add_proj(projs[, remove_existing, verbose])

Add SSP projection vectors.


Add reference channels to data that consists of all zeros.

anonymize([daysback, keep_his, verbose])

Anonymize measurement information in place.

append(raws[, preload])

Concatenate raw instances as if they were continuous.

apply_function(fun[, picks, dtype, n_jobs, ...])

Apply a function to a subset of channels.

apply_gradient_compensation(grade[, verbose])

Apply CTF gradient compensation.

apply_hilbert([picks, envelope, n_jobs, ...])

Compute analytic signal or envelope for a subset of channels/vertices.


Apply the signal space projection (SSP) operators to the data.


Clean up the object.

compute_psd([method, fmin, fmax, tmin, ...])

Perform spectral analysis on sensor data.

compute_tfr(method, freqs, *[, tmin, tmax, ...])

Compute a time-frequency representation of sensor data.


Return copy of Raw instance.

crop([tmin, tmax, include_tmax, verbose])

Crop raw data file.

crop_by_annotations([annotations, verbose])

Get crops of raw data file for selected annotations.


Remove SSP projection vector.


Describe channels (name, type, descriptive statistics).

drop_channels(ch_names[, on_missing])

Drop channel(s).

export(fname[, fmt, physical_range, ...])

Export Raw to external formats.

filter(l_freq, h_freq[, picks, ...])

Filter a subset of channels/vertices.

get_channel_types([picks, unique, only_data_chs])

Get a list of channel type for each channel.

get_data([picks, start, stop, ...])

Get data in the given range.


Get a DigMontage from instance.

interpolate_bads([reset_bads, mode, origin, ...])

Interpolate bad MEG and EEG channels.

load_bad_channels([bad_file, force, verbose])

Mark channels as bad from a text file.


Load raw data.

notch_filter(freqs[, picks, filter_length, ...])

Notch filter a subset of channels.

pick(picks[, exclude, verbose])

Pick a subset of channels.

pick_channels(ch_names[, ordered, verbose])


LEGACY: New code should use inst.pick(...).

pick_types([meg, eeg, stim, eog, ecg, emg, ...])


LEGACY: New code should use inst.pick(...).

plot([events, duration, start, n_channels, ...])

Plot raw data.

plot_projs_topomap([ch_type, sensors, ...])

Plot SSP vector.

plot_psd([fmin, fmax, tmin, tmax, picks, ...])


LEGACY: New code should use .compute_psd().plot().

plot_psd_topo([tmin, tmax, fmin, fmax, ...])


LEGACY: New code should use .compute_psd().plot_topo().

plot_psd_topomap([bands, tmin, tmax, ...])


LEGACY: New code should use .compute_psd().plot_topomap().

plot_sensors([kind, ch_type, title, ...])

Plot sensor positions.

rename_channels(mapping[, allow_duplicates, ...])

Rename channels.


Reorder channels.

resample(sfreq, *[, npad, window, ...])

Resample all channels.

save(fname[, picks, tmin, tmax, ...])

Save raw data to file.

savgol_filter(h_freq[, verbose])

Filter the data using Savitzky-Golay polynomial method.

set_annotations(annotations[, emit_warning, ...])

Setter for annotations.

set_channel_types(mapping, *[, ...])

Specify the sensor types of channels.

set_eeg_reference([ref_channels, ...])

Specify which reference to use for EEG data.


Set the measurement start date.

set_montage(montage[, match_case, ...])

Set EEG/sEEG/ECoG/DBS/fNIRS channel positions and digitization points.

time_as_index(times[, use_rounding, origin])

Convert time to indices.

to_data_frame([picks, index, scalings, ...])

Export data in tabular structure as a pandas DataFrame.