AverageRange.py 文件源码

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

项目:dataArtist 作者: radjkarl 项目源码 文件源码
def _update(self, limits=None):
        curves = self.display.widget.curves
        x = self.display.stack.values
        y = []
        s = self.pStd.value()
        yStd = []
        for curve in curves:
            if limits:
                b1 = np.argmax(curve.xData >= limits[0])
                b2 = np.argmax(curve.xData >= limits[1])
                if b2 == 0:
                    b2 = -1
            else:
                b1, b2 = None, None

            y.append(np.nanmean(curve.yData[b1:b2]))
            if s:
                yStd.append(np.nanstd(curve.yData[b1:b2]))

        if self.out is None or self.out.isClosed():
            self.out = self.display.workspace.addDisplay(
                origin=self.display,
                axes=self.display.axes.copy(('stack', 1)),
                title='ROI',
                names=['ROI'],
                data=[(x, y)])
        else:
            self.out.widget.curves[0].setData(x, y)

        if s:
            if self.outStd is None or self.outStd.isClosed():
                self.outStd = self.display.workspace.addDisplay(
                    origin=self.display,
                    axes=self.display.axes.copy(('stack', 1)),
                    title='ROI - std',
                    names=['ROI - std'],
                    data=[(x, yStd)])
            else:
                self.outStd.widget.curves[0].setData(x, yStd)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号