-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotting.py
84 lines (61 loc) · 1.95 KB
/
plotting.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import numpy as np
import json
import matplotlib
matplotlib.use('Agg')
import pylab as pl
# Plot the different figures for the merged spikes and voltages recordings.
# This file, as the MergeSpikefiles.py should be one level up than Test/..., the output of a simulation.
fparam = 'Test/Parameters/simulation_parameters.json'
f = open(fparam, 'r')
params = json.load(f)
params['figures_folder'] = "%sFigures/" % params['folder_name']
i_f = 1
pl.figure(i_f)
cell = 'states'
recorder_type = 'spikes'
for nstate in range(params['n_states']):
# print nstate
data = np.loadtxt(params['spiketimes_folder']+'/'+str(nstate)+cell+'_merged_'+recorder_type+'.dat' )
pl.scatter(data[:,1], data[:,0])
pl.title(cell)
name= 'fig'+str(i_f)+'_'+cell+'.pdf'
pl.savefig(params['figures_folder']+name)
pl.show()
i_f += 1
cell = 'rp'
pl.figure(i_f)
for ni in range(params['n_states']*params['n_actions']):
# print nstate
data = np.loadtxt(params['spiketimes_folder']+str(ni)+cell+'_merged_'+recorder_type+'.dat' )
pl.scatter(data[:,1], data[:,0])
pl.title(cell)
name= 'fig'+str(i_f)+'_'+cell+'.pdf'
pl.savefig(params['figures_folder']+name)
i_f += 1
cell = 'rew'
pl.figure(i_f)
data = np.loadtxt(params['spiketimes_folder']+cell+'_merged_'+recorder_type+'.dat' )
pl.scatter(data[:,1], data[:,0])
pl.title(cell)
name= 'fig'+str(i_f)+'_'+cell+'.pdf'
pl.savefig(params['figures_folder']+name)
i_f += 1
pl.show()
cell_types = ['d1', 'd2', 'actions','efference']
cell_types_volt = ['d1', 'd2', 'actions']
# SPIKES
for cell in cell_types:
pl.figure(i_f)
for naction in range(params['n_actions']):
data = np.loadtxt(params['spiketimes_folder']+str(naction)+cell+'_merged_'+recorder_type+'.dat' )
pl.scatter(data[:,1], data[:,0])
pl.title(cell)
name= 'fig'+str(i_f)+'_'+cell+'.pdf'
pl.savefig(params['figures_folder']+name)
i_f += 1
pl.show()
'''
# VOLTAGES
for cell in cell_types_volt:
for n in params['n_actions']:
'''