11"""
22
3- Support for intan tech rhd and rhs files.
3+ Support for intan tech rhd and rhs files.
44
5- This 2 formats are more or less the same but:
5+ These 2 formats are more or less the same but:
66 * some variance in headers.
77 * rhs amplifier is more complex because the optional DC channel
88
99RHS supported version 1.0
10- RHD supported version 1.0 1.1 1.2 1.3 2.0
10+ RHD supported version 1.0 1.1 1.2 1.3 2.0 3.0, 3.1
1111
1212See:
1313 * http://intantech.com/files/Intan_RHD2000_data_file_formats.pdf
@@ -333,6 +333,11 @@ def read_rhs(filename):
333333 if len (channels_by_type [sig_type ]) > 0 :
334334 name = {5 : 'DIGITAL-IN' , 6 : 'DIGITAL-OUT' }[sig_type ]
335335 data_dtype += [(name , 'uint16' , BLOCK_SIZE )]
336+
337+ if bool (global_info ['notch_filter_mode' ]) and global_info ['major_version' ] >= 3 :
338+ global_info ['notch_filter_applied' ] = True
339+ else :
340+ global_info ['notch_filter_applied' ] = False
336341
337342 return global_info , ordered_channels , data_dtype , header_size , BLOCK_SIZE
338343
@@ -346,7 +351,6 @@ def read_rhs(filename):
346351 ('minor_version' , 'int16' ),
347352]
348353
349-
350354rhd_global_header_part1 = [
351355 ('sampling_rate' , 'float32' ),
352356
@@ -360,7 +364,7 @@ def read_rhs(filename):
360364 ('desired_upper_bandwidth' , 'float32' ),
361365
362366 ('notch_filter_mode' , 'int16' ),
363-
367+
364368 ('desired_impedance_test_frequency' , 'float32' ),
365369 ('actual_impedance_test_frequency' , 'float32' ),
366370
@@ -544,5 +548,10 @@ def read_rhd(filename):
544548 if len (channels_by_type [sig_type ]) > 0 :
545549 name = {4 : 'DIGITAL-IN' , 5 : 'DIGITAL-OUT' }[sig_type ]
546550 data_dtype += [(name , 'uint16' , BLOCK_SIZE )]
547-
551+
552+ if bool (global_info ['notch_filter_mode' ]) and version >= V ('3.0' ):
553+ global_info ['notch_filter_applied' ] = True
554+ else :
555+ global_info ['notch_filter_applied' ] = False
556+
548557 return global_info , ordered_channels , data_dtype , header_size , BLOCK_SIZE
0 commit comments