Skip to content

Commit 4996d4b

Browse files
authored
Merge pull request #399 from h-mayorquin/add_probe_length_from_library
neurpixels: add probe length from library
2 parents 4cb28b6 + 2949cfe commit 4996d4b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/probeinterface/neuropixels_tools.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ def _load_np_probe_features():
9393

9494
def get_probe_length(probe_part_number: str) -> int:
9595
"""
96-
Returns the length of a given probe. We assume a length of
97-
1cm (10_000 microns) by default.
96+
Returns the length of a given probe from ProbeTable specifications.
9897
9998
Parameters
10099
----------
@@ -104,12 +103,16 @@ def get_probe_length(probe_part_number: str) -> int:
104103
Returns
105104
-------
106105
probe_length : int
107-
Length of full probe (microns)
106+
Length of full probe shank from tip to base (microns)
108107
"""
108+
np_features = _load_np_probe_features()
109+
probe_spec = np_features["neuropixels_probes"].get(probe_part_number)
109110

110-
probe_length = 10_000
111+
if probe_spec is not None and "shank_tip_to_base_um" in probe_spec:
112+
return int(probe_spec["shank_tip_to_base_um"])
111113

112-
return probe_length
114+
# Fallback for unknown probes or missing field
115+
return 10_000
113116

114117

115118
def make_mux_table_array(mux_information) -> np.array:

0 commit comments

Comments
 (0)