Ejemplo n.º 1
0
# creating a results array, with the dimensions of the ParameterSpace
corrcoef_results = numpy.empty(dims)

# scanning the ParameterSpace
for experiment in p.iter_inner():
    # calculation of the index in the space
    index = p.parameter_space_index(experiment)
    # perfomring the experiment
    cc, time_axis_cc, corrcoef = calc_cc(experiment)
    corrcoef_results[index] = corrcoef
    # plotting the cc's
    subplot_index = (dims[1] * index[0]) + index[1]
    pylab.subplot(dims[0], dims[1], subplot_index + 1)
    pylab.plot(time_axis_cc, cc)
    pylab.title(make_name(experiment, p.range_keys()))
    pylab.xlim(-30, 30.)
    pylab.ylim(0, 10.)

# plot the results
pylab.matshow(corrcoef_results)
pylab.xticks(numpy.arange(0.5, dims[1] + 0.5, 1.0),
             [str(i) for i in p.jitter._values])
pylab.yticks(numpy.arange(0.5, dims[0] + 0.5, 1.0),
             [str(i) for i in p.c._values])
pylab.xlim(0, dims[1])
pylab.ylim(dims[0], 0)
pylab.xlabel('jitter (ms)')
pylab.ylabel('correlation')
ax = pylab.colorbar()
ax.set_label('correlation')
# creating a results array, with the dimensions of the ParameterSpace
corrcoef_results = numpy.empty(dims)

# scanning the ParameterSpace
for experiment in p.iter_inner():
    # calculation of the index in the space
    index = p.parameter_space_index(experiment)
    # perfomring the experiment
    cc,time_axis_cc, corrcoef = calc_cc(experiment)
    corrcoef_results[index] = corrcoef
    # plotting the cc's
    subplot_index = (dims[1]*index[0])+index[1]
    pylab.subplot(dims[0],dims[1],subplot_index+1)
    pylab.plot(time_axis_cc,cc)
    pylab.title(make_name(experiment,p.range_keys()))
    pylab.xlim(-30,30.)
    pylab.ylim(0,10.)


# plot the results
pylab.matshow(corrcoef_results)
pylab.xticks(numpy.arange(0.5,dims[1]+0.5,1.0),[str(i) for i in p.jitter._values])
pylab.yticks(numpy.arange(0.5,dims[0]+0.5,1.0),[str(i) for i in p.c._values])
pylab.xlim(0,dims[1])
pylab.ylim(dims[0],0)
pylab.xlabel('jitter (ms)')
pylab.ylabel('correlation')
ax = pylab.colorbar()
ax.set_label('correlation')
pylab.draw()