EDF annotation texts not in UTF-8 (ISSSTELEÓN): legacy reads them as edf_convert does, modern retries latin1
This commit is contained in:
@@ -55,7 +55,12 @@ class Preprocessing:
|
||||
import mne
|
||||
|
||||
p = PreprocessPlan.from_dict(plan)
|
||||
raw = mne.io.read_raw_edf(edf_path, preload=True, verbose="error")
|
||||
try:
|
||||
raw = mne.io.read_raw_edf(edf_path, preload=True, verbose="error")
|
||||
except Exception as e: # annotation texts in a Windows code page
|
||||
if "latin1" not in str(e):
|
||||
raise
|
||||
raw = mne.io.read_raw_edf(edf_path, preload=True, verbose="error", encoding="latin1")
|
||||
ren, seen, drop = {}, set(), []
|
||||
for c in raw.ch_names: # edf_convert: unknown dropped, first duplicate kept
|
||||
n = _channels.normalize(c)
|
||||
|
||||
Reference in New Issue
Block a user