-
Notifications
You must be signed in to change notification settings - Fork 317
Closed
Description
If rdrecord is invoked with:
smooth_frames=Trueandphysical=True(default), it should setrec.p_signalto a two-dimensional floating-point array.smooth_frames=Trueandphysical=False, it should setrec.d_signalto a two-dimensional integer array.smooth_frames=Falseandphysical=True, it should setrec.e_p_signalto a list of floating-point arrays.smooth_frames=Falseandphysical=False, it should setrec.e_d_signalto a list of integer arrays.
For example:
>>> type(wfdb.rdrecord('sample-data/03700181', smooth_frames=True, physical=True).p_signal)
<class 'numpy.ndarray'>
>>> type(wfdb.rdrecord('sample-data/03700181', smooth_frames=True, physical=False).d_signal)
<class 'numpy.ndarray'>
>>> type(wfdb.rdrecord('sample-data/03700181', smooth_frames=False, physical=True).e_p_signal)
<class 'list'>
>>> type(wfdb.rdrecord('sample-data/03700181', smooth_frames=False, physical=False).e_d_signal)
<class 'list'>
However, if every signal in the record has exactly one sample per frame, this doesn't work:
>>> type(wfdb.rdrecord('sample-data/100', smooth_frames=True, physical=True).p_signal)
<class 'numpy.ndarray'>
>>> type(wfdb.rdrecord('sample-data/100', smooth_frames=True, physical=False).d_signal)
<class 'numpy.ndarray'>
>>> type(wfdb.rdrecord('sample-data/100', smooth_frames=False, physical=True).e_p_signal)
<class 'NoneType'>
>>> type(wfdb.rdrecord('sample-data/100', smooth_frames=False, physical=False).e_d_signal)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/benjamin/wfdb-python/wfdb/io/record.py", line 3637, in rdrecord
record.convert_dtype(physical, return_res, smooth_frames)
File "/home/benjamin/wfdb-python/wfdb/io/_signal.py", line 726, in convert_dtype
current_dtype = self.e_d_signal[ch].dtype
TypeError: 'NoneType' object is not subscriptable
Metadata
Metadata
Assignees
Labels
No labels