Skip to content

Commit d2e2f08

Browse files
committed
added get_probe_type function for clarity
1 parent affca49 commit d2e2f08

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

element_array_ephys/ephys_no_curation.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,17 @@ def map_channel_to_electrode(probe_type="A1x32-6mm-100-177-H32_21mm", input_indi
148148

149149
electrode_ids = lookup[input_indices]
150150
return electrode_ids
151+
152+
def get_probe_type(ephys_key):
153+
"""
154+
Gets the probe type for a given ephys session key. EphysSessionProbe needs an entry along with the EphysSession for ephys_key
155+
"""
156+
probe_type = set((EphysSessionProbe * probe.Probe & ephys_key).fetch('probe_type'))
157+
if len(probe_type) != 1:
158+
raise ValueError(
159+
f"Couldn't identify probe type for {ephys_key} - expected one, found {len(probe_type)}"
160+
)
161+
return probe_type.pop()
151162
# ----------------------------- Table declarations ----------------------
152163

153164

0 commit comments

Comments
 (0)