- MNE version: e.g. 1.3.1
- operating system: e.g. Windows 10
I am trying to save some epochs as a psd spectrum in a .fif file, so that my colleague can just load them into their computations. I can create the object and save it just fine, but when I try to load it, it gives me the error: ‘[filename] does not start with a file id tag’.
Here is my code:
# make epochs
epochs = mne.Epochs(raw, events=myevents, event_id=events_dict, tmin=ep_start, tmax=ep_end, baseline=(None,None), reject= None)
# Compute PSD
PSD_epochs = epochs['ML'].compute_psd(method='multitaper', fmin=frqs[0], fmax=frqs[1], picks=sensors[i_sens] )
# save psd epochs
fname=PATHOUT+'PSD_MLpochs/' + SUBS[i_sub] + '_'+ CONDS[i_con] + sens[i_sens] + 'ML_psd_epo.fif'
PSD_epochs.save(fname, overwrite=True)
# load to check
loadpochs = mne.read_epochs(fname, preload=True)
Will I need to simply save the extracted data as a numpy array, or is there a way to save the object as it is?
Thanks for reading!