-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #639 from magland/set-probe
add set_probe method to BaseRecordingExtractorInterface
- Loading branch information
Showing
5 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import List | ||
|
||
import numpy as np | ||
|
||
|
||
def generate_mock_probe(num_channels: int, num_shanks: int = 3): | ||
import probeinterface as pi | ||
|
||
# The shank ids will be 0, 0, 0, ..., 1, 1, 1, ..., 2, 2, 2, ... | ||
shank_ids: List[int] = [] | ||
positions = np.zeros((num_channels, 2)) | ||
# ceil division | ||
channels_per_shank = (num_channels + num_shanks - 1) // num_shanks | ||
for i in range(num_shanks): | ||
# x0, y0 is the position of the first electrode in the shank | ||
x0 = 0 | ||
y0 = i * 200 | ||
for j in range(channels_per_shank): | ||
if len(shank_ids) == num_channels: | ||
break | ||
shank_ids.append(i) | ||
x = x0 + j * 10 | ||
y = y0 + (j % 2) * 10 | ||
positions[len(shank_ids) - 1] = x, y | ||
probe = pi.Probe(ndim=2, si_units="um") | ||
probe.set_contacts(positions=positions, shapes="circle", shape_params={"radius": 5}) | ||
probe.set_device_channel_indices(np.arange(num_channels)) | ||
probe.set_shank_ids(shank_ids) | ||
return probe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters