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

Num hw chan resolution #85

Merged
merged 5 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions src/trodes_to_nwb/convert_ephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def __init__(
else:
self.nwb_hw_channel_order = nwb_hw_channel_order

if stream_index == 3 and len(self.nwb_hw_channel_order) < self.n_channel:
edeno marked this conversation as resolved.
Show resolved Hide resolved
self.n_channel = len(self.nwb_hw_channel_order)
"""split excessively large iterators into smaller ones
"""
iterator_size = [neo_io._raw_memmap.shape[0] for neo_io in self.neo_io]
Expand Down
9 changes: 9 additions & 0 deletions src/trodes_to_nwb/spike_gadgets_raw_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ def _parse_header(self):

self._sampling_rate = float(hconf.attrib["samplingRate"])
num_ephy_channels = int(hconf.attrib["numChannels"])
# check for agreement with number of channels in xml
sconf_channels = np.sum([len(x) for x in sconf])
if sconf_channels < num_ephy_channels:
num_ephy_channels = sconf_channels
if sconf_channels > num_ephy_channels:
raise ValueError(
"SpikeGadgets: the number of channels in the spike configuration is larger than the number of channels in the hardware configuration"
)

try:
num_chan_per_chip = int(sconf.attrib["chanPerChip"])
except KeyError:
Expand Down
Loading