We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ffa5113 commit d13e8acCopy full SHA for d13e8ac
wfdb/io/_signal.py
@@ -514,6 +514,8 @@ def calc_adc_params(self):
514
pmin = minvals[ch]
515
pmax = maxvals[ch]
516
517
+ if pmax == np.inf:
518
+ raise ValueError('Signal contains inf. Cannot convert.')
519
# map values using full digital range.
520
521
# If the entire signal is nan, just put any.
@@ -536,7 +538,6 @@ def calc_adc_params(self):
536
538
# baseline has to be an integer.
537
539
adc_gain = (dmax-dmin) / (pmax-pmin)
540
baseline = dmin - adc_gain*pmin
-
541
# The baseline needs to be an integer
542
if pmin > 0:
543
baseline = int(np.ceil(baseline))
0 commit comments