File tree Expand file tree Collapse file tree 1 file changed +16
-19
lines changed
Expand file tree Collapse file tree 1 file changed +16
-19
lines changed Original file line number Diff line number Diff line change 7777 "8" : (- (2 ** 31 ), 2 ** 31 - 1 ),
7878}
7979
80+ # Digital value used to represent a missing/invalid sample, in each of the
81+ # WFDB dat formats.
82+ INVALID_SAMPLE_VALUE = {
83+ "80" : - (2 ** 7 ),
84+ "310" : - (2 ** 9 ),
85+ "311" : - (2 ** 9 ),
86+ "212" : - (2 ** 11 ),
87+ "16" : - (2 ** 15 ),
88+ "61" : - (2 ** 15 ),
89+ "160" : - (2 ** 15 ),
90+ "24" : - (2 ** 23 ),
91+ "32" : - (2 ** 31 ),
92+ "8" : None ,
93+ }
94+
8095
8196class SignalMixin (object ):
8297 """
@@ -1874,25 +1889,7 @@ def _digi_nan(fmt):
18741889 """
18751890 if isinstance (fmt , list ):
18761891 return [_digi_nan (f ) for f in fmt ]
1877-
1878- if fmt == "80" :
1879- return - 128
1880- if fmt == "310" :
1881- return - 512
1882- if fmt == "311" :
1883- return - 512
1884- elif fmt == "212" :
1885- return - 2048
1886- elif fmt == "16" :
1887- return - 32768
1888- elif fmt == "61" :
1889- return - 32768
1890- elif fmt == "160" :
1891- return - 32768
1892- elif fmt == "24" :
1893- return - 8388608
1894- elif fmt == "32" :
1895- return - 2147483648
1892+ return INVALID_SAMPLE_VALUE [fmt ]
18961893
18971894
18981895def est_res (signals ):
You can’t perform that action at this time.
0 commit comments