Skip to content

Commit ce9abcc

Browse files
committed
plot only the shank with the peak electrode
1 parent 2eb9540 commit ce9abcc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

element_array_ephys/plotting/unit_level.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ def plot_depth_waveforms(
9090
probe.ProbeType.Electrode & f"probe_type='{probe_type}'"
9191
).fetch("electrode", "y_coord")
9292

93+
peak_electrode_shank = (
94+
probe.ProbeType.Electrode
95+
& f"probe_type='{probe_type}'"
96+
& f"electrode={peak_electrode}"
97+
).fetch1("shank")
98+
9399
peak_coord_y = coord_y[electrodes == peak_electrode][0]
94100

95101
coord_ylim_low = (
@@ -107,10 +113,13 @@ def plot_depth_waveforms(
107113
(probe.ProbeType.Electrode)
108114
& f"probe_type = '{probe_type}'"
109115
& f"y_coord BETWEEN {coord_ylim_low} AND {coord_ylim_high}"
116+
& f"shank={peak_electrode_shank}"
117+
)
118+
electrodes_to_plot, x_coords, y_coords = tbl.fetch(
119+
"electrode", "x_coord", "y_coord"
110120
)
111-
electrodes_to_plot = tbl.fetch("electrode")
112121

113-
coords = np.array(tbl.fetch("x_coord", "y_coord")).T # x, y coordinates
122+
coords = np.array([x_coords, y_coords]).T # x, y coordinates
114123

115124
waveforms = (
116125
ephys.WaveformSet.Waveform

0 commit comments

Comments
 (0)