mne.io.read_raw_nwb#

mne.io.read_raw_nwb(fname, *, ch_type='seeg', series=None, preload=False, verbose=None)[source]#

Read an NWB voltage series using h5py.

Parameters:
fnamepath-like

Path to an NWB file.

ch_typestr

The channel type to use for all channels, e.g. "seeg" (default) or "ecog". NWB files do not store channel types.

seriesstr | None

The path of the series to read inside the file, e.g. "processing/ecephys/LFP/lfp". If None (default), read the only voltage series in acquisition, or else the only ElectricalSeries in the file.

preloadbool | str

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, it is the name of a freshly created memory-mapped file used to store the data on the hard drive (slower, requires less memory). An existing file is overwritten. The caller owns the file and is responsible for removing it after the Raw object is no longer in use. For supported Raw readers, the exact string "auto" instead reuses decoded data below the directory configured by mne.set_cache_dir(). Entries persist without a size limit and are mapped copy-on-write. Use Path("auto") for a literal filename.

Changed in version 1.13: Support for the "auto" decoded-data cache was added.

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.

Returns:
rawinstance of RawNWB

The raw recording.

See also

mne.io.read_raw

Read raw data from supported formats.

Notes

Requires h5py. Without series, reads the single ElectricalSeries in the file’s acquisition group, or the single two-dimensional TimeSeries in volts if there is no ElectricalSeries. Channel names are the electrode IDs if available, otherwise channel numbers. Timestamps must be uniformly sampled. Each table in intervals (e.g. trials) becomes annotations described as NWB/<table>, except invalid_times, which becomes BAD_nwb_invalid; rows scoped to other series are skipped. The subject ID and sex are stored in raw.info["subject_info"].

New in v1.14.