Allow exporting edf where a channel contains only constant values#12911
Allow exporting edf where a channel contains only constant values#12911larsoner merged 2 commits intomne-tools:mainfrom
Conversation
cbrnr
left a comment
There was a problem hiding this comment.
LGTM, thanks @hofaflo! Could you add a changelog entry please?
Just out of curiosity, what are the implications of having a pmax that is actually not the true maximum of the signal? I mean, the test shows that everything is correctly saved and loaded, but then pmax in the file is just wrong?
None that I know of. The physical range (together with the digital range) is just used to determine signal gain and offset. There is no requirement that they actually occur within the signal. This is already the case for |
|
Thanks @hofaflo ! |
* upstream/main: eegbci api: allow downloading multiple subjects (mne-tools#12918) DOC: Document Linux desktop workaround (mne-tools#12900) Allow exporting edf where a channel contains only constant values (mne-tools#12911) Autogenerate environment.yml file from pyproject.toml (mne-tools#12914)
Currently, exporting to edf fails if one channel contains only constant values and
physical_range="auto", becauseedfiorequires that (explicitly passed) physical minimum and maximum differ from each other (link). This requirement is suggested in Q8 in the EDF FAQ, because min == max leads to a division by zero when calculating the signal offset, which might cause an error when loading the file. This PR ensures that physical minimum and maximum are always different when usingphysical_range="auto". Forphysical_range="channelwise",edfiotakes care of that , asmnepasses no physical range toedfio.EdfSignal.