From a42c9f3c72215df2cce4c682898239dfe536894a Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Mon, 8 Apr 2024 15:22:05 -0500 Subject: [PATCH] fix: channel mapping for waveform extraction --- element_array_ephys/ephys_organoids.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/element_array_ephys/ephys_organoids.py b/element_array_ephys/ephys_organoids.py index d3b95493..6b3d81e9 100644 --- a/element_array_ephys/ephys_organoids.py +++ b/element_array_ephys/ephys_organoids.py @@ -908,10 +908,8 @@ def make(self, key): ) electrode_query &= f'electrode IN {tuple(probe_info["used_electrodes"])}' - channel_info = electrode_query.fetch(as_dict=True, order_by="channel_idx") - channel_info: dict[int, dict] = { - ch.pop("channel_idx"): key | ch for ch in channel_info - } # e.g., {0: {'organoid_id': 'O09', + channel_info = electrode_query.fetch(as_dict=True, order_by="electrode") + channel_info: dict[int, dict] = {ch_idx: ch for ch_idx, ch in enumerate(channel_info)} waveform_dir = output_dir / sorter_name / "waveform" if not waveform_dir.exists():