MNE version: 1.4.2
operating system: macOS 12.5
I am trying to do the following:
- Read in a .edf file
- Select a subset of channels and rename them.
- Export to a new .edf file
The code I use to do this is the following, where rawFile
is the path to the original .edf and standardFile is the path to the new .edf to be written.
psgFile = mne.io.read_raw_edf(rawFile)
psgInfo = psgFile.info
for channel in psgInfo.ch_names:
if channel in self.channel_mapping.keys():
mne.rename_channels(psgFile.info,{channel:self.channel_mapping[channel]})
else:
psgFile.drop_channels(channel)
mne.export.export_raw(standardFile,psgFile,overwrite=True)
It seems to work fine, but then I read in my new file as follows:
psgFile2 = mne.io.read_raw_edf(standardFile)
When I look at graphs of psgFile2, all channels are flat lines. Each channel contains a time series with only one value in it, 0.00011273
Any guidance would be greatly appreciated!