the-siesta-group / edfio

Read and write EDF/EDF+ files.
Apache License 2.0
27 stars 4 forks source link

Ensure physical min/max are always rounded down/up #2

Closed hofaflo closed 9 months ago

hofaflo commented 10 months ago

Currently, physical_min and physical_max are rounded via string formatting when writing them to their respective header fields, to fit the 8 character limit. This can lead to a situation where e.g. physical_max is rounded down, making it smaller than some actual (physical) signal values. Always rounding physical_min down and physical_max up ensures that all signal values lie within the physical range. This should make clipping the digital values to the digital range in EdfSignal._set_data obsolete and thereby close #1.