mattbit / neurokit

Neurophysiological timeseries toolkit
1 stars 1 forks source link

EDF writer generates invalid files when values are too big #95

Open mattbit opened 3 years ago

mattbit commented 3 years ago

When writing to EDF a signal with very high values (e.g. 1e9), the file gets created successfully, but it is an invalid EDF. This happens because pyedflib doesn't take into account overflow of the fixed number of ascii bytes used to write the physical max and min.

Before generating this situation, the signal should be validated and an exception should be raised.

mattbit commented 3 years ago

We could also change the code to use the more modern highlevel interface of pyedflib, it would slightly simplify things and maybe also solve this problem (but I'm not sure about that).