analyzer.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:spyking-circus-ort 作者: spyking-circus 项目源码 文件源码
def view_synthetic_templates(self, indices=None, time=None, nn=100, hf_dist=45, a_dist=1.0):

        if indices is None:
            indices = range(self.nb_cells)

        if not numpy.iterable(indices):
            indices = [indices]

        scaling = None
        pylab.figure()

        for i in indices:

            template   = self._get_synthetic_template(i, time, nn, hf_dist, a_dist)
            template   = template.toarray()
            width      = template.shape[1]
            xmin, xmax = self.probe.field_of_view['x_min'], self.probe.field_of_view['x_max']
            ymin, ymax = self.probe.field_of_view['y_min'], self.probe.field_of_view['y_max']
            if scaling is None:
                scaling= 10*numpy.max(numpy.abs(template))
            colorVal   = self._scalarMap_synthetic.to_rgba(i)

            for count, i in enumerate(xrange(self.nb_channels)):
                x, y     = self.probe.positions[:, i]
                xpadding = ((x - xmin)/(float(xmax - xmin) + 1))*(2*width)
                ypadding = ((y - ymin)/(float(ymax - ymin) + 1))*scaling
                pylab.plot(xpadding + numpy.arange(width), ypadding + template[i, :], color=colorVal)

        pylab.tight_layout()
        pylab.setp(pylab.gca(), xticks=[], yticks=[])
        pylab.xlim(xmin, 3*width)
        pylab.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号