Closed mkoculak closed 5 years ago
are you using windows? it can be an overlflow of integers as int are int32 on windows.
yes please share the file so we can try to replicate the pb.
thanks
Yes, I am using Windows 10. Is there any way to overcome the overflow issue on Windows?
the link to the file (if it won't work, I can try uploading it somewhere else): https://ujchmura-my.sharepoint.com/:u:/g/personal/marcin_koculak_doctoral_uj_edu_pl/ESeDLKjMJEFLtV3t5VO1jecB0nOBVQ-X0Cvwrq7V3ihVUw?e=gyUfWg
I confirm that I have no problem loading your file on macos with the current master branch.
I don't have a big enough windows machine to debug this :(
I would put a break point in the code before the seek crash here : https://github.com/mne-tools/mne-python/blob/master/mne/io/edf/edf.py#L264 see if you actually end up with negative integers and then track down the origin of the problem.
HTH
So it seems that the problem is with the variable ch_offset
created couple lines earlier
https://github.com/mne-tools/mne-python/blob/master/mne/io/edf/edf.py#L250
ch_offsets = np.cumsum(np.concatenate([[0], n_samps]))
because it is created as int32
and then creates the overflow of block_offset
variable.
Adding a parameter dtype=np.int64
to the numpy cumsum function made the code run without problems.
ch_offsets = np.cumsum(np.concatenate([[0], n_samps]), dtype=np.int64)
Great can you send us a PR? Thx
Describe the bug
I am trying to read a relatively big .bdf file (~3GB, 80 channels, 2048Hz, 6215 sec. of recording) and got the error below.
I successfully read the data with
pyedflib
:I have also checked readability with BDFReader shipped with ActiView by Biosemi and it reads the data with no problems.
I tried it with a couple of different files of similar size, the result is the same. All files were recorded with ActiveView and not modified after.
Steps and/or code to reproduce
As mentioned, the file is big, but I can share a link to OneDrive copy if necessary.
Additional information
I was looking around if there were some issues with big files, but did not find anything on the matter. If this was already addressed somewhere, I would be grateful for pointing me to the right direction.