Hello,
I’m running into this issue as well.
I have files originally named like:
-rw-r–r-- 1 archive archiveg 216M Mar 15 11:29 M87177739+Study20240314+avmmn_visit2_run1_raw-1.fif
-rw-r–r-- 1 archive archiveg 2.0G Mar 15 11:30 M87177739+Study20240314+avmmn_visit2_run1_raw.fif
-rw-r–r-- 1 archive archiveg 942M Mar 15 11:30 M87177739+Study20240314+avmmn_visit2_run2_raw.fif
-rw-r–r-- 1 archive archiveg 479M Mar 15 11:30 M87177739+Study20240314+avmmn_visit2_run3_raw.fif
We used proprietary MEGIN maxfilter command to process each file. When I load the first processed file (the one named run1_raw.fif), I get the following error:
In [16]: raw = io.Raw(fnames[1])
Opening raw data file /export/research/analysis/human/jstephen/synchrony_20105/MEG_AUTOANALYSIS/subjects/M87177739/M87177739_avmmn_visit2_run1_tsss_mc.fif...
<ipython-input-16-8c6434757102>:1: RuntimeWarning: This filename (/export/research/analysis/human/jstephen/synchrony_20105/MEG_AUTOANALYSIS/subjects/M87177739/M87177739_avmmn_visit2_run1_tsss_mc.fif) does not conform to MNE naming conventions. All raw files should end with raw.fif, raw_sss.fif, raw_tsss.fif, _meg.fif, _eeg.fif, _ieeg.fif, raw.fif.gz, raw_sss.fif.gz, raw_tsss.fif.gz, _meg.fif.gz, _eeg.fif.gz or _ieeg.fif.gz
raw = io.Raw(fnames[1])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[16], line 1
----> 1 raw = io.Raw(fnames[1])
File <decorator-gen-390>:12, in __init__(self, fname, allow_maxshield, preload, on_split_missing, verbose)
File /export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne1.7/lib/python3.12/site-packages/mne/io/fiff/raw.py:105, in Raw.__init__(self, fname, allow_maxshield, preload, on_split_missing, verbose)
103 next_fname = fname
104 while next_fname is not None:
--> 105 raw, next_fname, buffer_size_sec = self._read_raw_file(
106 next_fname, allow_maxshield, preload, do_check_ext
107 )
108 do_check_ext = False
109 raws.append(raw)
File <decorator-gen-391>:12, in _read_raw_file(self, fname, allow_maxshield, preload, do_check_ext, verbose)
File /export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne1.7/lib/python3.12/site-packages/mne/io/fiff/raw.py:326, in Raw._read_raw_file(self, fname, allow_maxshield, preload, do_check_ext, verbose)
323 tag = read_tag(fid, ent.pos)
324 nskip = int(tag.data.item())
--> 326 next_fname = _get_next_fname(fid, fname_rep, tree)
328 # reformat raw_extras to be a dict of list/ndarray rather than
329 # list of dict (faster access)
330 raw_extras = {key: [r[key] for r in raw_extras] for key in raw_extras[0]}
File /export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne1.7/lib/python3.12/site-packages/mne/_fiff/open.py:70, in _get_next_fname(fid, fname, tree)
68 for nodes in nodes_list:
69 next_fname = None
---> 70 for ent in nodes["directory"]:
71 if ent.kind == FIFF.FIFF_REF_ROLE:
72 tag = read_tag(fid, ent.pos)
TypeError: 'NoneType' object is not iterable
What is the correct way to handle this situation?
Thank you,
Megan