Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maxwell: skip streams without routing #1579

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions neo/rawio/maxwellrawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import os
from pathlib import Path
import platform
import warnings
from urllib.request import urlopen

import numpy as np
Expand Down Expand Up @@ -114,7 +115,8 @@ def _parse_header(self):
max_sig_length = 0
self._signals = {}
sig_channels = []
for stream_id in signal_streams["id"]:
well_indices_to_remove = []
for stream_index, stream_id in enumerate(signal_streams["id"]):
if int(version) == 20160704:
sr = 20000.0
settings = h5file["settings"]
Expand Down Expand Up @@ -145,7 +147,13 @@ def _parse_header(self):
gain = settings["gain"][0]
gain_uV = 3.3 / (1024 * gain) * 1e6
mapping = settings["mapping"]
sigs = h5file["wells"][stream_id][self.rec_name]["groups"]["routed"]["raw"]
if "routed" in h5file["wells"][stream_id][self.rec_name]["groups"]:
sigs = h5file["wells"][stream_id][self.rec_name]["groups"]["routed"]["raw"]
else:
warnings.warn(f"No 'routed' group found for well {stream_id}")
well_indices_to_remove.append(stream_index)
continue


channel_ids = np.array(mapping["channel"])
electrode_ids = np.array(mapping["electrode"])
Expand All @@ -164,6 +172,9 @@ def _parse_header(self):

self._t_stop = max_sig_length / sr

if len(well_indices_to_remove) > 0:
signal_streams = np.delete(signal_streams, np.array(well_indices_to_remove))

sig_channels = np.array(sig_channels, dtype=_signal_channel_dtype)

spike_channels = []
Expand Down
Loading