You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wrsamp cannot calculate calibration for physical signals with NaN or expanded layout #786
File ".../wfdb/io/_signal.py", in set_d_features
res = est_res(self.p_signal)
File ".../wfdb/io/_signal.py", in est_res
res.append(np.where(res_levels >= nlevels)[0][0])
IndexError: index 0 is out of bounds for axis 0 with size 0
NaN marks missing samples, and when fmt, adc_gain and baseline are given, NaN is written as the format's missing-value marker. The resolution estimate in est_res doesn't skip NaN, though, so the automatic calibration path fails.
2. An expanded physical signal without calibration
For a uniform p_signal, set_d_features(do_adc=1) calculates fmt, adc_gain and baseline. With expanded=True it doesn't, so expanded physical signals can only be written if the calibration is given explicitly.
write_record (#785) goes through the same calibration path, so it fails the same way for records built in code.
Expected: both cases calculate the format and calibration the same way as uniform signals without NaN, ignoring missing samples.
Activity