- MNE version: 1.6.1
- operating system: macOS 12 (running in VSCode)
I’m trying to plot my continuous EEG data. Here’s my code:
import mne
file_path = 'file_path/filename.gdf'
raw = mne.io.read_raw_gdf(file_path, preload=True)
print(raw.info)
raw.filter(1, 50, fir_design="firwin")
print(f"lowpass filter:{raw.info['lowpass']}")
raw.plot()
I get the following error:
Traceback (most recent call last):
raw.plot()
File "...MNE-Python/1.6.1_0/.mne-python/lib/python3.11/site-packages/mne/io/base.py", line 1808, in plot
return plot_raw(
^^^^^^^^^
File "<decorator-gen-157>", line 12, in plot_raw
File "...MNE-Python/1.6.1_0/.mne-python/lib/python3.11/site-packages/mne/viz/raw.py", line 258, in plot_raw
decim, picks_data = _handle_decim(info, decim, lowpass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...MNE-Python/1.6.1_0/.mne-python/lib/python3.11/site-packages/mne/viz/utils.py", line 1987, in _handle_decim
decim = max(int(info["sfreq"] / (lp * 3) + 1e-6), 1)
~~~~~~~~~~~~~~^~~~~~~~~~
ZeroDivisionError: float division by zero
My sampling frequency is 512.0 Hz (from raw.info).
I noticed that the lowpass filter doesn’t update after raw.filter() (it remains zero), even though highpass filter is updated to 1. I also get the following message when loading my data:
<ipython-input-2-f238b083ba6e>:4: RuntimeWarning: Channels contain different highpass filters. Highest filter setting will be stored.
raw = mne.io.read_raw_gdf(file_path, preload=True)
<ipython-input-2-f238b083ba6e>:4: RuntimeWarning: Channels contain different lowpass filters. Lowest filter setting will be stored.
raw = mne.io.read_raw_gdf(file_path, preload=True)
Before filtering, both high and lowpass are 0, and raw.plot() creates the same error. And I get the same error after removing all but eeg channels.
Appreciate any help!