File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,33 @@ def test_read_write_flac_multifrequency(self):
286286 )
287287 assert record == record_write
288288
289+ def test_read_write_flac_many_channels (self ):
290+ """
291+ Check we can read and write to format 516 with more than 8 channels.
292+ """
293+ # Read in a signal with 12 channels in format 16
294+ record = wfdb .rdrecord ("sample-data/s0010_re" , physical = False )
295+
296+ # Test that we can write out the signal in format 516
297+ wfdb .wrsamp (
298+ record_name = "s0010_re_fmt516" ,
299+ fs = record .fs ,
300+ units = record .units ,
301+ sig_name = record .sig_name ,
302+ fmt = ["516" ] * record .n_sig ,
303+ d_signal = record .d_signal ,
304+ adc_gain = record .adc_gain ,
305+ baseline = record .baseline ,
306+ write_dir = self .temp_path ,
307+ )
308+
309+ # Check that signal matches the original
310+ record_fmt516 = wfdb .rdrecord (
311+ os .path .join (self .temp_path , "s0010_re_fmt516" ),
312+ physical = False ,
313+ )
314+ assert (record .d_signal == record_fmt516 .d_signal ).all ()
315+
289316 def test_read_flac_longduration (self ):
290317 """
291318 Three signals multiplexed in a FLAC file, over 2**24 samples.
You can’t perform that action at this time.
0 commit comments