-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (32 loc) · 1.04 KB
/
Copy pathmain.py
File metadata and controls
37 lines (32 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import loadaerdat as ld
import spikes as spk
import sys
if __name__ == "__main__":
# extract data
print('Loading AEDAT file...')
# can import data using a different way
# data = ld.loadaerdat('./file.aedat', 0, 'aedat', 1, 'DVS128')
time = data[0]
xaddr = data[1]
yaddr = data[2]
pol = spk.use_pm_polarity(data[3])
# user defined vars
# pixel of interest address
myxaddr = 3
myyaddr = 3
# range around that pixel
# note a big range can be expensive
rng = 5
# dummy data
# xaddr = [1,2,3,4,3,3,6,3]
# yaddr = [2,8,2,5,2,5,6,3]
# pol = [0,0,1,0,0,1,1,0]
# time = [0,1,2,3,4,5,6,7]
input('Press any key to continue...')
print('Starting spike tools...')
considered_indexes = spk.keep_one_addr_with_rng(time=time, xaddr=xaddr, yaddr=yaddr, pol=pol, myxaddr=myxaddr, myyaddr=myyaddr, rng=rng)
if considered_indexes == []:
sys.exit('Error: no spikes were extracted for the specified address. Try another one.')
print('Done extracting spikes')
input('Press any key to continue...')
spk.plot_polarity(time, pol, considered_indexes)