analyzeAngle.py 文件源码

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

项目:livespin 作者: biocompibens 项目源码 文件源码
def onpick(self, event):
        for dataind in event.ind:
            site = self.dataObject.sites[dataind]
            if len(str(site)) == 1:
                site = '0'+str(site)
            x1, y1 = self.dataObject.extracts[dataind]
            t = self.dataObject.times[dataind]
            f = glob( '{0}ANGLEsite{1}_extract{2}&{3}_t{4}.png'.format(self.imagespath, int(site), x1, y1, t))
            if len(f) >1 :
                print f
            elif len(f) == 0:
                print '{0}ANGLEsite{1}_extract{2}&{3}_t{4}.png'.format(self.imagespath, int(site), x1, y1, t)
            subprocess.call(['eog', f[0]], stdout=open(os.devnull, 'wb'), stderr=open(os.devnull, 'wb'))
            val = input('Good (1) or not (0) ? If you want the stats, enter a negative number. ')
            self.stats[dataind] = val
            while val < 0 :
                print "True : {0}, False {1}".format(len(self.stats[self.stats==1]), len(self.stats[self.stats==0]))
                val = input('Good or not ? ')
            if val == 0:
                self.ax.scatter(self.X[dataind], self.Y[dataind], c= 'k', marker = 'v')
                print "!!! BUG : ", f[0]
            else:
                self.ax.scatter(self.X[dataind], self.Y[dataind], c = 'r', marker = 'v')

            pylab.draw()
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号