Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/trodes_to_nwb/convert_intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def add_sample_count(
)

# get the systime information
systime = np.array(rec_dci.timestamps) * NANOSECONDS_PER_SECOND
systime = np.array(rec_dci.timestamps)
# get the sample count information
trodes_sample = np.concatenate(
[neo_io.get_analogsignal_timestamps(0, None) for neo_io in rec_dci.neo_io]
Expand Down
5 changes: 4 additions & 1 deletion src/trodes_to_nwb/tests/test_convert_intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from trodes_to_nwb.tests.test_convert_rec_header import default_test_xml_tree
from trodes_to_nwb.tests.utils import data_path

NANOSECONDS_PER_SECOND = 1e9


def test_add_epochs():
metadata_path = data_path / "20230622_sample_metadata.yml"
Expand Down Expand Up @@ -69,7 +71,8 @@ def test_add_sample_count():
== old_nwbfile.processing["sample_count"]["sample_count"].data[:]
).all()
assert np.allclose(
read_nwbfile.processing["sample_count"]["sample_count"].timestamps[:],
read_nwbfile.processing["sample_count"]["sample_count"].timestamps[:]
* NANOSECONDS_PER_SECOND, # Account for error in old file timestamps
old_nwbfile.processing["sample_count"]["sample_count"].timestamps[:],
rtol=0,
atol=(1.0 / 30000) * 1e9,
Expand Down