@@ -173,7 +173,7 @@ def _parse_header(self):
173173 self ._block_size ,
174174 channel_number_dict ,
175175 ) = read_rhd (self .filename , self .file_format )
176-
176+
177177 #############################################
178178 # memmap the raw data for each format type
179179 #############################################
@@ -207,7 +207,6 @@ def _parse_header(self):
207207 channel_file_paths = raw_file_paths_dict [stream_name ]
208208 channel_memmap_list = [np .memmap (fp , dtype = stream_dtype , mode = "r" ) for fp in channel_file_paths ]
209209 self ._raw_data [stream_name ] = channel_memmap_list
210-
211210
212211 # Data Integrity checks
213212 # strictness of check is controlled by ignore_integrity_checks
@@ -747,12 +746,12 @@ def read_rhs(filename, file_format: str):
747746
748747 # Build a dictionary with channel count
749748 special_cases_for_counting = [
750- "DC Amplifier channel" ,
751- "Stim channel" ,
749+ "DC Amplifier channel" ,
750+ "Stim channel" ,
752751 ]
753752 names_to_count = [name for name in stream_names if name not in special_cases_for_counting ]
754753 channel_number_dict = {name : len (stream_name_to_channel_info_list [name ]) for name in names_to_count }
755-
754+
756755 # Both DC Amplifier and Stim streams have the same number of channels as the amplifier stream
757756 channel_number_dict ["DC Amplifier channel" ] = channel_number_dict ["RHS2000 amplifier channel" ]
758757 channel_number_dict ["Stim channel" ] = channel_number_dict ["RHS2000 amplifier channel" ]
@@ -1204,6 +1203,7 @@ def create_one_file_per_signal_dict_rhd(dirname):
12041203
12051204 return raw_file_paths_dict
12061205
1206+
12071207stream_name_to_file_name_rhs = {
12081208 "RHS2000 amplifier channel" : "amplifier.dat" ,
12091209 "RHS2000 auxiliary input channel" : "auxiliary.dat" ,
@@ -1214,6 +1214,7 @@ def create_one_file_per_signal_dict_rhd(dirname):
12141214 "USB board digital output channel" : "digitalout.dat" ,
12151215}
12161216
1217+
12171218def create_one_file_per_signal_dict_rhs (dirname ):
12181219 """Function for One File Per Signal Type
12191220
@@ -1275,10 +1276,10 @@ def create_one_file_per_channel_dict_rhd(dirname):
12751276 for stream_name , file_prefix in stream_name_to_file_prefix_rhd .items ():
12761277 stream_files = [file for file in files if file_prefix in file .name ]
12771278 # Map file name to channel name amp-A-000.dat -> A-000 amp-B-006.dat -> B-006 etc
1278- file_path_to_channel_name = lambda x : '-' .join (x .stem .split ('-' )[1 :])
1279+ file_path_to_channel_name = lambda x : "-" .join (x .stem .split ("-" )[1 :])
12791280 sorted_stream_files = sorted (stream_files , key = file_path_to_channel_name )
12801281 raw_file_paths_dict [stream_name ] = sorted_stream_files
1281-
1282+
12821283 raw_file_paths_dict ["timestamp" ] = [Path (dirname / "time.dat" )]
12831284 return raw_file_paths_dict
12841285
@@ -1294,6 +1295,7 @@ def create_one_file_per_channel_dict_rhd(dirname):
12941295 "USB board digital output channel" : "board-DIGITAL-OUT" ,
12951296}
12961297
1298+
12971299def create_one_file_per_channel_dict_rhs (
12981300 dirname ,
12991301):
@@ -1316,7 +1318,7 @@ def create_one_file_per_channel_dict_rhs(
13161318 for stream_name , file_prefix in stream_name_to_file_prefix_rhs .items ():
13171319 stream_files = [file for file in files if file_prefix in file .name ]
13181320 # Map file name to channel name amp-A-000.dat -> A-000 amp-B-006.dat -> B-006 etc
1319- file_path_to_channel_name = lambda x : '-' .join (x .stem .split ('-' )[1 :])
1321+ file_path_to_channel_name = lambda x : "-" .join (x .stem .split ("-" )[1 :])
13201322 sorted_stream_files = sorted (stream_files , key = file_path_to_channel_name )
13211323 raw_file_paths_dict [stream_name ] = sorted_stream_files
13221324
0 commit comments