[pointprocesses] update exercise
This commit is contained in:
parent
acf7fc8c81
commit
9075fe1be2
@ -15,7 +15,7 @@
|
||||
\else
|
||||
\newcommand{\stitle}{}
|
||||
\fi
|
||||
\header{{\bfseries\large Exercise 8\stitle}}{{\bfseries\large Point processes}}{{\bfseries\large November 27th, 2017}}
|
||||
\header{{\bfseries\large Exercise 8\stitle}}{{\bfseries\large Point processes}}{{\bfseries\large December 3th, 2018}}
|
||||
\firstpagefooter{Prof. Dr. Jan Benda}{Phone: 29 74573}{Email:
|
||||
jan.benda@uni-tuebingen.de}
|
||||
\runningfooter{}{\thepage}{}
|
||||
|
21
pointprocesses/lecture/dattomat.py
Normal file
21
pointprocesses/lecture/dattomat.py
Normal file
@ -0,0 +1,21 @@
|
||||
import sys
|
||||
import numpy as np
|
||||
import scipy.io as io
|
||||
|
||||
file = sys.argv[1]
|
||||
with open(file, 'r') as sf:
|
||||
x = []
|
||||
for line in sf:
|
||||
line = line.strip()
|
||||
if len(line) > 0 and line[0] != '#':
|
||||
x.append(float(line))
|
||||
spikes = np.array(x)*0.001
|
||||
# break the single spiketrain in trials of 5 seconds:
|
||||
trials = []
|
||||
w = 5.0
|
||||
for t0 in np.arange(0.0, spikes[-1], w):
|
||||
trials.append(spikes[(spikes>=t0)&(spikes<t0+w)]-t0)
|
||||
data = {'spikes': trials}
|
||||
io.savemat(file.replace('.dat', '.mat'), data)
|
||||
|
||||
|
BIN
pointprocesses/lecture/p-unit_baselineactivity.mat
Normal file
BIN
pointprocesses/lecture/p-unit_baselineactivity.mat
Normal file
Binary file not shown.
Reference in New Issue
Block a user