Skip to content

Commit 4d18c53

Browse files
author
Benjamin Moody
committed
_rd_segment: add init_value argument.
This should be a list containing the initial sample value for each signal; this is required in order to correctly read format-8 dat files.
1 parent d2406cf commit 4d18c53

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

wfdb/io/_signal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ def smooth_frames(self, sigtype='physical'):
865865

866866

867867
def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
868-
samps_per_frame, skew, sampfrom, sampto, channels,
868+
samps_per_frame, skew, init_value, sampfrom, sampto, channels,
869869
smooth_frames, ignore_skew, no_file=False, sig_data=None, return_res=64):
870870
"""
871871
Read the digital samples from a single segment record's associated
@@ -893,6 +893,8 @@ def _rd_segment(file_name, dir_name, pn_dir, fmt, n_sig, sig_len, byte_offset,
893893
The samples/frame for each signal of the dat file.
894894
skew : list
895895
The skew for the signals of the dat file.
896+
init_value : list
897+
The initial value for each signal of the dat file.
896898
sampfrom : int
897899
The starting sample number to be read from the signals.
898900
sampto : int

wfdb/io/record.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3524,6 +3524,7 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
35243524
byte_offset=record.byte_offset,
35253525
samps_per_frame=record.samps_per_frame,
35263526
skew=record.skew,
3527+
init_value=record.init_value,
35273528
sampfrom=sampfrom,
35283529
sampto=sampto,
35293530
channels=channels,

0 commit comments

Comments
 (0)