def get_performance(file_name, name):
a, b = os.path.splitext(os.path.basename(file_name))
file_name, ext = os.path.splitext(file_name)
file_out = os.path.join(os.path.abspath(file_name), a)
data = {}
result = h5py.File(file_out + '.basis.hdf5')
data['spatial'] = result.get('spatial')[:]
data['temporal'] = numpy.zeros(61) #result.get('temporal')[:]
pylab.figure()
pylab.subplot(121)
pylab.imshow(data['spatial'], interpolation='nearest')
pylab.title('Spatial')
pylab.xlabel('# Electrode')
pylab.ylabel('# Electrode')
pylab.colorbar()
pylab.subplot(122)
pylab.title('Temporal')
pylab.plot(data['temporal'])
pylab.xlabel('Time [ms]')
x, y = pylab.xticks()
pylab.xticks(x, (x-x[-1]//2)//10)
pylab.tight_layout()
plot_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '.'))
plot_path = os.path.join(plot_path, 'plots')
plot_path = os.path.join(plot_path, 'whitening')
if not os.path.exists(plot_path):
os.makedirs(plot_path)
output = os.path.join(plot_path, '%s.pdf' %name)
pylab.savefig(output)
return data
评论列表
文章目录