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

adds data and unit arguments to spiketimes TimeSeries object #405

Merged
merged 2 commits into from
Apr 24, 2020
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
5 changes: 4 additions & 1 deletion ipfx/nwb_append.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from hdmf.backends.hdf5.h5_utils import H5DataIO
from pynwb import TimeSeries
from pynwb import ProcessingModule
import numpy as np


PathLike = Union[
Expand Down Expand Up @@ -50,9 +51,11 @@ def append_spike_times(input_nwb_path: PathLike,
spike_module = ProcessingModule(name='spikes',
description='detected spikes')
for sweep_num, spike_times in sweep_spike_times.items():
wrapped_spike_times = H5DataIO(data=spike_times,
wrapped_spike_times = H5DataIO(data=np.asarray(spike_times),
compression=True)
ts = TimeSeries(timestamps=wrapped_spike_times,
unit='seconds',
data=wrapped_spike_times,
name=f"Sweep_{sweep_num}")
spike_module.add_data_interface(ts)

Expand Down