66
77from neo .rawio .spikeglxrawio import SpikeGLXRawIO
88from neo .test .rawiotest .common_rawio_test import BaseTestRawIO
9-
9+ import numpy
1010
1111class TestSpikeGLXRawIO (BaseTestRawIO , unittest .TestCase ):
1212 rawioclass = SpikeGLXRawIO
@@ -29,6 +29,7 @@ class TestSpikeGLXRawIO(BaseTestRawIO, unittest.TestCase):
2929 "spikeglx/NP2_with_sync" ,
3030 "spikeglx/NP2_no_sync" ,
3131 "spikeglx/NP2_subset_with_sync" ,
32+ "/mnt/DATA/data/studies/manish/playpen/test_run2" ,
3233 ]
3334
3435 def test_with_location (self ):
@@ -85,6 +86,20 @@ def test_subset_with_sync(self):
8586 )
8687 assert chunk .shape [1 ] == 120
8788
89+ def test_nidq_digital_channel (self ):
90+ rawio_digital = SpikeGLXRawIO ("/mnt/DATA/data/studies/manish/playpen/test_run2" )
91+ rawio_digital_channel .parse_header ()
92+ # This data should have 8 event channels
93+ assert (np .shape (rawio_digital .header ['event_channels' ])[0 ] == 8 )
94+
95+ # Channel 0 in this data will have sync pulses at 1 Hz, let's confirm that
96+ all_events = rawio_digital .get_event_timestamps (0 ,0 ,0 )
97+ on_events = np .where (all_events [2 ] == 'XD0 ON' )
98+ on_ts = this_events [0 ][on_events ]
99+ on_diff = np .unique (np .diff (on_ts ))
100+ for diff in this_on_diff :
101+ error = 0.0001 * rawio_digital .get_signal_sampling_rate ()
102+ assert abs (diff - rawio_digital .get_signal_sampling_rate ()) < error
88103
89104if __name__ == "__main__" :
90105 unittest .main ()
0 commit comments