Hi all,
I came across a weird artifact in my MEG data (Neuromag Vectorview). Not sure how to describe it or what is going on. So, here a screenshot of what it looks like:
The data is unprocessed at that stage. The artifact is only sometimes present in the file, and also only over some sensors. There is no error or warning that something is fishy. The raw.info looks also fine (superficially). Running some preprocessing (filter + sss) seems to also work ok (no issues in the log file), however, when trying to save the raw file afterwards, I get following error message:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 raw_proc.save(deriv_stub % 'filt-raw_sss.fif', overwrite=True, fmt='single', split_naming='bids')` `File <decorator-gen-213>:12, in save(self, fname, picks, tmin, tmax, buffer_size_sec, drop_small_buffer, proj, fmt, overwrite, split_size, split_naming, verbose)` `File /gpfs/project/projects/bpsydm/tools/pyEnvs/meg/lib/python3.9/site-packages/mne/io/base.py:1489, in BaseRaw.save(self, fname, picks, tmin, tmax, buffer_size_sec, drop_small_buffer, proj, fmt, overwrite, split_size, split_naming, verbose)
1487 _validate_type(split_naming, str, 'split_naming')
1488 _check_option('split_naming', split_naming, ('neuromag', 'bids'))
-> 1489 _write_raw(fname, self, info, picks, fmt, data_type, reset_range,
1490 start, stop, buffer_size, projector, drop_small_buffer,
1491 split_size, split_naming, 0, None, overwrite)
File /gpfs/project/projects/bpsydm/tools/pyEnvs/meg/lib/python3.9/site-packages/mne/io/base.py:2224, in _write_raw(fname, raw, info, picks, fmt, data_type, reset_range, start, stop, buffer_size, projector, drop_small_buffer, split_size, split_naming, part_idx, prev_fname, overwrite)
2222 picks = _picks_to_idx(info, picks, 'all', ())
2223 with start_and_end_file(use_fname) as fid:
-> 2224 cals = _start_writing_raw(fid, info, picks, data_type,
2225 reset_range, raw.annotations)
2226 with ctx:
2227 final_fname = _write_raw_fid(
2228 raw, info, picks, fid, cals, part_idx, start, stop,
2229 buffer_size, prev_fname, split_size, use_fname,
(...)
2232 overwrite=True # we've started writing already above
2233 )
File /gpfs/project/projects/bpsydm/tools/pyEnvs/meg/lib/python3.9/site-packages/mne/io/base.py:2427, in _start_writing_raw(fid, info, sel, data_type, reset_range, annotations)
2424 info['chs'][k]['range'] = 1.0
2425 cals.append(info['chs'][k]['cal'] * info['chs'][k]['range'])
-> 2427 write_meas_info(fid, info, data_type=data_type, reset_range=reset_range)
2429 #
2430 # Annotations
2431 #
2432 if len(annotations) > 0: # don't save empty annot
File /gpfs/project/projects/bpsydm/tools/pyEnvs/meg/lib/python3.9/site-packages/mne/io/meas_info.py:2146, in write_meas_info(fid, info, data_type, reset_range)
2144 write_int(fid, FIFF.FIFF_SUBJ_HAND, si['hand'])
2145 if si.get('weight') is not None:
-> 2146 write_float(fid, FIFF.FIFF_SUBJ_WEIGHT, si['weight'])
2147 if si.get('height') is not None:
2148 write_float(fid, FIFF.FIFF_SUBJ_HEIGHT, si['height'])
File /gpfs/project/projects/bpsydm/tools/pyEnvs/meg/lib/python3.9/site-packages/mne/io/write.py:96, in write_float(fid, kind, data)
94 """Write a single-precision floating point tag to a fif file."""
95 data_size = 4
---> 96 data = np.array(data, dtype='>f4').T
97 _write(fid, data, kind, data_size, FIFF.FIFFT_FLOAT, '>f4')
ValueError: could not convert string to float: 'n/a'
- MNE version: 1.0.2
Has anyone any idea what might be going on here?
Thanks,
Eduard