@@ -1517,7 +1517,8 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
1517
1517
record .samps_per_frame ,
1518
1518
record .skew , sampfrom , sampto ,
1519
1519
channels , smooth_frames ,
1520
- ignore_skew )
1520
+ ignore_skew ,
1521
+ return_res = return_res )
1521
1522
1522
1523
# Arrange/edit the object fields to reflect user channel
1523
1524
# and/or signal range input
@@ -1538,7 +1539,8 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
1538
1539
record .samps_per_frame ,
1539
1540
record .skew , sampfrom ,
1540
1541
sampto , channels ,
1541
- smooth_frames , ignore_skew )
1542
+ smooth_frames , ignore_skew ,
1543
+ return_res = return_res )
1542
1544
1543
1545
# Arrange/edit the object fields to reflect user channel
1544
1546
# and/or signal range input
@@ -1588,7 +1590,8 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
1588
1590
record .segments [seg_num ] = rdrecord (
1589
1591
os .path .join (dir_name , record .seg_name [seg_num ]),
1590
1592
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 )
1592
1595
1593
1596
# Arrange the fields of the layout specification segment, and
1594
1597
# the overall object, to reflect user input.
@@ -1609,7 +1612,7 @@ def rdrecord(record_name, sampfrom=0, sampto=None, channels=None,
1609
1612
1610
1613
1611
1614
def 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 ):
1613
1616
"""
1614
1617
Read a WFDB record, and return the physical signals and a few important
1615
1618
descriptor fields.
@@ -1641,6 +1644,11 @@ def rdsamp(record_name, sampfrom=0, sampto=None, channels=None, pn_dir=None,
1641
1644
Whether to display a warning if the specified channel indices
1642
1645
or names are not contained in the record, and no signal is
1643
1646
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.
1644
1652
1645
1653
Returns
1646
1654
-------
@@ -1682,8 +1690,8 @@ def rdsamp(record_name, sampfrom=0, sampto=None, channels=None, pn_dir=None,
1682
1690
1683
1691
record = rdrecord (record_name = record_name , sampfrom = sampfrom ,
1684
1692
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 )
1687
1695
1688
1696
signals = record .p_signal
1689
1697
fields = {}
0 commit comments