@@ -941,6 +941,7 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
941941 byte_offset = byte_offset [:]
942942 samps_per_frame = samps_per_frame [:]
943943 skew = skew [:]
944+ init_value = init_value [:]
944945
945946 # Set defaults for empty fields
946947 for i in range (n_sig ):
@@ -950,6 +951,8 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
950951 samps_per_frame [i ] = 1
951952 if skew [i ] == None :
952953 skew [i ] = 0
954+ if init_value [i ] == None :
955+ init_value [i ] = 0
953956
954957 # If skew is to be ignored, set all to 0
955958 if ignore_skew :
@@ -966,6 +969,7 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
966969 w_byte_offset = {} # one scalar per dat file
967970 w_samps_per_frame = {} # one list per dat file
968971 w_skew = {} # one list per dat file
972+ w_init_value = {} # one list per dat file
969973 w_channel = {} # one list per dat file
970974
971975 for fn in file_name :
@@ -979,6 +983,7 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
979983 w_byte_offset [fn ] = byte_offset [datchannel [fn ][0 ]]
980984 w_samps_per_frame [fn ] = [samps_per_frame [c ] for c in datchannel [fn ]]
981985 w_skew [fn ] = [skew [c ] for c in datchannel [fn ]]
986+ w_init_value [fn ] = [init_value [c ] for c in datchannel [fn ]]
982987 w_channel [fn ] = idc
983988
984989 # Wanted dat channels, relative to the dat file itself
@@ -1009,6 +1014,7 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
10091014 byte_offset = w_byte_offset [fn ],
10101015 samps_per_frame = w_samps_per_frame [fn ],
10111016 skew = w_skew [fn ],
1017+ init_value = w_init_value [fn ],
10121018 sampfrom = sampfrom ,
10131019 sampto = sampto ,
10141020 smooth_frames = smooth_frames ,
@@ -1033,6 +1039,7 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
10331039 byte_offset = w_byte_offset [fn ],
10341040 samps_per_frame = w_samps_per_frame [fn ],
10351041 skew = w_skew [fn ],
1042+ init_value = w_init_value [fn ],
10361043 sampfrom = sampfrom ,
10371044 sampto = sampto ,
10381045 smooth_frames = smooth_frames ,
@@ -1047,8 +1054,9 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
10471054
10481055
10491056def _rd_dat_signals (file_name , dir_name , pn_dir , fmt , n_sig , sig_len ,
1050- byte_offset , samps_per_frame , skew , sampfrom , sampto ,
1051- smooth_frames , no_file = False , sig_data = None ):
1057+ byte_offset , samps_per_frame , skew , init_value ,
1058+ sampfrom , sampto , smooth_frames ,
1059+ no_file = False , sig_data = None ):
10521060 """
10531061 Read all signals from a WFDB dat file.
10541062
@@ -1074,6 +1082,8 @@ def _rd_dat_signals(file_name, dir_name, pn_dir, fmt, n_sig, sig_len,
10741082 The samples/frame for each signal of the dat file.
10751083 skew : list
10761084 The skew for the signals of the dat file.
1085+ init_value : list
1086+ The initial value for each signal of the dat file.
10771087 sampfrom : int
10781088 The starting sample number to be read from the signals.
10791089 sampto : int
0 commit comments