@@ -89,22 +89,6 @@ def _load_np_probe_features():
8989 "bankB" : "bankB" ,
9090}
9191
92- # Map from ProbeInterface to ProbeTable naming conventions
93- pi_to_pt_names = {
94- "x_pitch" : "electrode_pitch_horz_um" ,
95- "y_pitch" : "electrode_pitch_vert_um" ,
96- "contact_width" : "electrode_size_horz_direction_um" ,
97- "shank_pitch" : "shank_pitch_um" ,
98- "shank_number" : "num_shanks" ,
99- "ncols_per_shank" : "cols_per_shank" ,
100- "nrows_per_shank" : "rows_per_shank" ,
101- "adc_bit_depth" : "adc_bit_depth" ,
102- "model_name" : "description" ,
103- "num_readout_channels" : "num_readout_channels" ,
104- "shank_width_um" : "shank_width_um" ,
105- "tip_length_um" : "tip_length_um" ,
106- }
107-
10892
10993def get_probe_length (probe_part_number : str ) -> int :
11094 """
@@ -241,11 +225,9 @@ def read_imro(file_path: Union[str, Path]) -> Probe:
241225 return _read_imro_string (imro_str , imDatPrb_pn )
242226
243227
244- def _make_npx_probe_from_description (probe_description , elec_ids , shank_ids , mux_table = None ) -> Probe :
228+ def _make_npx_probe_from_description (probe_description , model_name , elec_ids , shank_ids , mux_table = None ) -> Probe :
245229 # used by _read_imro_string and for generating the NP library
246230
247- model_name = probe_description ["description" ]
248-
249231 # compute position
250232 y_idx , x_idx = np .divmod (elec_ids , probe_description ["cols_per_shank" ])
251233 x_pitch = probe_description ["electrode_pitch_horz_um" ]
@@ -257,8 +239,8 @@ def _make_npx_probe_from_description(probe_description, elec_ids, shank_ids, mux
257239 )
258240
259241 stagger = np .mod (y_idx + 1 , 2 ) * raw_stagger
260- x_pos = x_idx * x_pitch + stagger
261- y_pos = y_idx * y_pitch
242+ x_pos = ( x_idx * x_pitch + stagger ). astype ( "float64" )
243+ y_pos = ( y_idx * y_pitch ). astype ( "float64" )
262244
263245 # if probe_description["shank_number"] > 1:
264246 if shank_ids is not None :
@@ -273,7 +255,8 @@ def _make_npx_probe_from_description(probe_description, elec_ids, shank_ids, mux
273255 positions = np .stack ((x_pos , y_pos ), axis = 1 )
274256
275257 # construct Probe object
276- probe = Probe (ndim = 2 , si_units = "um" , model_name = model_name , manufacturer = "IMEC" )
258+ probe = Probe (ndim = 2 , si_units = "um" , model_name = model_name , manufacturer = "imec" )
259+ probe .description = probe_description ["description" ]
277260 probe .set_contacts (
278261 positions = positions ,
279262 shapes = "square" ,
@@ -386,7 +369,7 @@ def _read_imro_string(imro_str: str, imDatPrb_pn: Optional[str] = None) -> Probe
386369 else :
387370 shank_ids = None
388371
389- probe = _make_npx_probe_from_description (pt_metadata , elec_ids , shank_ids , mux_table )
372+ probe = _make_npx_probe_from_description (pt_metadata , imDatPrb_pn , elec_ids , shank_ids , mux_table )
390373
391374 # scalar annotations
392375 probe .annotate (
@@ -905,14 +888,12 @@ def read_openephys(
905888 )
906889 num_shanks = pt_metadata ["num_shanks" ]
907890
908- model_name = pt_metadata .get ("description" )
909- if model_name is None :
910- model_name = "Unknown"
891+ description = pt_metadata .get ("description" )
911892
912893 elec_ids = []
913894 for i , pos in enumerate (positions ):
914895 # Do not calculate contact ids if the model name is not known
915- if model_name == "Unknown" :
896+ if description is None :
916897 elec_ids = None
917898 break
918899
@@ -1056,8 +1037,11 @@ def read_openephys(
10561037 if elec_ids is not None :
10571038 elec_ids = np .array (elec_ids )[chans_saved ]
10581039
1059- probe = _make_npx_probe_from_description (pt_metadata , elec_ids , shank_ids = shank_ids , mux_table = mux_table )
1040+ probe = _make_npx_probe_from_description (
1041+ pt_metadata , probe_part_number , elec_ids , shank_ids = shank_ids , mux_table = mux_table
1042+ )
10601043 probe .serial_number = np_probe_info ["serial_number" ]
1044+ probe .name = np_probe_info ["name" ]
10611045
10621046 probe .annotate (
10631047 part_number = np_probe_info ["part_number" ],
0 commit comments