Skip to content

Commit 287bde1

Browse files
committed
Merge branch 'add-mux-index' of github.com:alejoe91/probeinterface into add-mux-index
2 parents d85645a + 7aa35c1 commit 287bde1

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/probeinterface/neuropixels_tools.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def make_mux_table_array(mux_information) -> np.array:
122122
123123
Returns
124124
-------
125-
mux_channels_array : np.array
125+
adc_groups_array : np.array
126126
Array of which channels are in each adc group, shaped (number of `adc`s, number of channels in each `adc`).
127127
"""
128128

@@ -135,12 +135,12 @@ def make_mux_table_array(mux_information) -> np.array:
135135
num_adcs, num_channels_per_adc = map(int, adc_info[1:].split(","))
136136

137137
# Then remove the brackets, and split using " " to get each integer as a list
138-
mux_channels = [
138+
adc_groups = [
139139
np.array(each_mux.replace("(", "").replace(")", "").split(" ")).astype("int") for each_mux in split_mux
140140
]
141-
mux_channels_array = np.transpose(np.array(mux_channels))
141+
adc_groups_array = np.transpose(np.array(adc_groups))
142142

143-
return num_adcs, num_channels_per_adc, mux_channels_array
143+
return num_adcs, num_channels_per_adc, adc_groups_array
144144

145145

146146
def get_probe_contour_vertices(shank_width, tip_length, probe_length) -> list:
@@ -331,18 +331,18 @@ def _make_npx_probe_from_description(probe_description, model_name, elec_ids, sh
331331
# annotate each contact with its mux channel
332332
num_adcs, num_channels_per_adc, mux_table = make_mux_table_array(mux_info)
333333
num_contacts = positions.shape[0]
334-
# mux channel: which adc is used for each contact
335-
mux_channels = np.zeros(num_contacts, dtype="int64")
336-
# mux index: order of sampling of the contact in the adc group
337-
mux_index = np.zeros(num_contacts, dtype="int64")
338-
for adc_idx, mux_channels_per_adc in enumerate(mux_table):
339-
mux_channels_per_adc = mux_channels_per_adc[mux_channels_per_adc < num_contacts]
340-
mux_channels[mux_channels_per_adc] = adc_idx
341-
mux_index[mux_channels_per_adc] = np.arange(len(mux_channels_per_adc))
334+
# ADC group: which adc is used for each contact
335+
adc_groups = np.zeros(num_contacts, dtype="int64")
336+
# ADC sample order: order of sampling of the contact in the adc group
337+
adc_sample_order = np.zeros(num_contacts, dtype="int64")
338+
for adc_idx, adc_groups_per_adc in enumerate(mux_table):
339+
adc_groups_per_adc = adc_groups_per_adc[adc_groups_per_adc < num_contacts]
340+
adc_groups[adc_groups_per_adc] = adc_idx
341+
adc_sample_order[adc_groups_per_adc] = np.arange(len(adc_groups_per_adc))
342342
probe.annotate(num_adcs=num_adcs)
343343
probe.annotate(num_channels_per_adc=num_channels_per_adc)
344-
probe.annotate_contacts(mux_channels=mux_channels)
345-
probe.annotate_contacts(mux_index=mux_index)
344+
probe.annotate_contacts(adc_group=adc_groups)
345+
probe.annotate_contacts(adc_sample_order=adc_sample_order)
346346

347347
return probe
348348

0 commit comments

Comments
 (0)