@@ -376,17 +376,26 @@ def get_probe_tuple(info):
376376 dock = normalize (info .get ("probe_dock" ))
377377 return (slot , port , dock )
378378
379- unique_probe_tuples = {get_probe_tuple (info ) for info in info_list }
379+ info_list_imec = [info for info in info_list if info .get ("device" ) != "nidq" ]
380+ unique_probe_tuples = {get_probe_tuple (info ) for info in info_list_imec }
380381 sorted_probe_keys = sorted (unique_probe_tuples )
381382 probe_tuple_to_probe_index = {key : idx for idx , key in enumerate (sorted_probe_keys )}
382383
383384 for info in info_list :
384385 if info .get ("device" ) == "nidq" :
385- info ["device_index" ] = 0 # TODO: Handle multi nidq case
386+ info ["device_index" ] = "" # TODO: Handle multi nidq case, maybe use meta["typeNiEnabled"]
386387 else :
387388 info ["device_index" ] = probe_tuple_to_probe_index [get_probe_tuple (info )]
388389
390+ # Define stream base on device [imec|nidq], device_index and stream_kind [ap|lf] for imec
391+ for info in info_list :
392+ device_kind = info ["device_kind" ]
393+ device_index = info ["device_index" ]
394+ stream_kind = f".{ info ['stream_kind' ]} " if info ["stream_kind" ] else ""
395+ stream_name = f"{ device_kind } { device_index } { stream_kind } "
389396
397+ info ["stream_name" ] = stream_name
398+
390399 return info_list
391400
392401
@@ -513,7 +522,6 @@ def extract_stream_info(meta_file, meta):
513522 if "imec" in fname .split ("." )[- 2 ]:
514523 device = fname .split ("." )[- 2 ]
515524 stream_kind = fname .split ("." )[- 1 ]
516- stream_name = device + "." + stream_kind
517525 units = "uV"
518526 # please note the 1e6 in gain for this uV
519527
@@ -553,7 +561,6 @@ def extract_stream_info(meta_file, meta):
553561 else :
554562 device = fname .split ("." )[- 1 ]
555563 stream_kind = ""
556- stream_name = device
557564 units = "V"
558565 channel_gains = np .ones (num_chan )
559566
@@ -586,7 +593,7 @@ def extract_stream_info(meta_file, meta):
586593 info ["trigger_num" ] = trigger_num
587594 info ["device" ] = device
588595 info ["stream_kind" ] = stream_kind
589- info ["stream_name " ] = stream_name
596+ info ["device_kind " ] = meta . get ( "typeThis" , device . split ( "." )[ 0 ])
590597 info ["units" ] = units
591598 info ["channel_names" ] = [txt .split (";" )[0 ] for txt in meta ["snsChanMap" ]]
592599 info ["channel_gains" ] = channel_gains
0 commit comments