File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 33from neo .rawio .openephysbinaryrawio import OpenEphysBinaryRawIO
44from neo .test .rawiotest .common_rawio_test import BaseTestRawIO
55
6+ import numpy as np
7+
68
79class TestOpenEphysBinaryRawIO (BaseTestRawIO , unittest .TestCase ):
810 rawioclass = OpenEphysBinaryRawIO
@@ -57,6 +59,25 @@ def test_missing_folders(self):
5759 )
5860 rawio .parse_header ()
5961
62+ def test_multiple_ttl_events_parsing (self ):
63+ rawio = OpenEphysBinaryRawIO (
64+ self .get_local_path ("openephysbinary/v0.6.x_neuropixels_with_sync" ), load_sync_channel = False
65+ )
66+ rawio .parse_header ()
67+ rawio .header = rawio .header
68+ # Testing co
69+ # This is the TTL events from the NI Board channel
70+ ttl_events = rawio ._evt_streams [0 ][0 ][1 ]
71+ assert "rising" in ttl_events .keys ()
72+ assert "labels" in ttl_events .keys ()
73+ assert "durations" in ttl_events .keys ()
74+ assert "timestamps" in ttl_events .keys ()
75+
76+ # Check that durations of different event streams are correctly parsed:
77+ assert np .allclose (ttl_events ["durations" ][ttl_events ["labels" ] == "1" ], 0.5 , atol = 0.001 )
78+ assert np .allclose (ttl_events ["durations" ][ttl_events ["labels" ] == "6" ], 0.025 , atol = 0.001 )
79+ assert np .allclose (ttl_events ["durations" ][ttl_events ["labels" ] == "7" ], 0.016666 , atol = 0.001 )
80+
6081
6182if __name__ == "__main__" :
6283 unittest .main ()
You can’t perform that action at this time.
0 commit comments