@@ -1517,7 +1517,8 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
15171517 record .samps_per_frame ,
15181518 record .skew , sampfrom , sampto ,
15191519 channels , smooth_frames ,
1520- ignore_skew )
1520+ ignore_skew ,
1521+ return_res = return_res )
15211522
15221523 # Arrange/edit the object fields to reflect user channel
15231524 # and/or signal range input
@@ -1538,7 +1539,8 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
15381539 record .samps_per_frame ,
15391540 record .skew , sampfrom ,
15401541 sampto , channels ,
1541- smooth_frames , ignore_skew )
1542+ smooth_frames , ignore_skew ,
1543+ return_res = return_res )
15421544
15431545 # Arrange/edit the object fields to reflect user channel
15441546 # and/or signal range input
@@ -1588,7 +1590,8 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
15881590 record .segments [seg_num ] = rdrecord (
15891591 os .path .join (dir_name , record .seg_name [seg_num ]),
15901592 sampfrom = seg_ranges [i ][0 ], sampto = seg_ranges [i ][1 ],
1591- channels = seg_channels [i ], physical = physical , pn_dir = pn_dir )
1593+ channels = seg_channels [i ], physical = physical , pn_dir = pn_dir ,
1594+ return_res = return_res )
15921595
15931596 # Arrange the fields of the layout specification segment, and
15941597 # the overall object, to reflect user input.
@@ -1609,7 +1612,7 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
16091612
16101613
16111614def rdsamp (record_name , sampfrom = 0 , sampto = None , channels = None , pn_dir = None ,
1612- channel_names = None , warn_empty = False ):
1615+ channel_names = None , warn_empty = False , return_res = 64 ):
16131616 """
16141617 Read a WFDB record, and return the physical signals and a few important
16151618 descriptor fields.
@@ -1641,6 +1644,11 @@ def rdsamp(record_name, sampfrom=0, sampto=None, channels=None, pn_dir=None,
16411644 Whether to display a warning if the specified channel indices
16421645 or names are not contained in the record, and no signal is
16431646 returned.
1647+ return_res : int, optional
1648+ The numpy array dtype of the returned signals. Options are: 64,
1649+ 32, 16, and 8, where the value represents the numpy int or float
1650+ dtype. Note that the value cannot be 8 when physical is True
1651+ since there is no float8 format.
16441652
16451653 Returns
16461654 -------
@@ -1682,8 +1690,8 @@ def rdsamp(record_name, sampfrom=0, sampto=None, channels=None, pn_dir=None,
16821690
16831691 record = rdrecord (record_name = record_name , sampfrom = sampfrom ,
16841692 sampto = sampto , channels = channels , physical = True ,
1685- pn_dir = pn_dir , m2s = True , channel_names = channel_names ,
1686- warn_empty = warn_empty )
1693+ pn_dir = pn_dir , m2s = True , return_res = return_res ,
1694+ channel_names = channel_names , warn_empty = warn_empty )
16871695
16881696 signals = record .p_signal
16891697 fields = {}
0 commit comments