Exemplo n.º 1
0
    def setLimitDetection(self, xs: np.ndarray, ld: Union[float, np.ndarray]) -> None:
        if isinstance(ld, float):
            ld = np.full(xs.size, ld)

        data = np.stack((xs, ld), axis=1)
        poly = array_to_polygonf(data)
        self.ld.replace(poly)
Exemplo n.º 2
0
    def setLimitCritical(self, xs: np.ndarray, lc: Union[float, np.ndarray]) -> None:
        if isinstance(lc, float):
            lc = np.full(xs.size, lc)

        data = np.stack((xs, lc), axis=1)
        poly = array_to_polygonf(data)
        self.lc.replace(poly)
Exemplo n.º 3
0
    def setBackground(self, xs: np.ndarray, ub: Union[float, np.ndarray]) -> None:
        if isinstance(ub, float):
            ub = np.full(xs.size, ub)

        data = np.stack((xs, ub), axis=1)
        poly = array_to_polygonf(data)
        self.ub.replace(poly)
Exemplo n.º 4
0
    def setFit(self, bins: np.ndarray, fit: np.ndarray) -> None:
        poly = array_to_polygonf(np.stack((bins, fit), axis=1))
        self.fit.replace(poly)

        idx = np.argmax(fit)
        x, y = bins[idx], fit[idx]
        self.label_fit.setPlainText(f"{x:.4g}")
        self.label_fit.setData(0, QtCore.QPointF(x, y))

        self.updateFitLabelPos()
Exemplo n.º 5
0
 def setScatter(self, xs: np.ndarray, ys: np.ndarray) -> None:
     data = np.stack((xs, ys), axis=1)
     poly = array_to_polygonf(data)
     self.scatter_series.replace(poly)
Exemplo n.º 6
0
 def setData(self, ys: np.ndarray) -> None:
     xs = np.arange(ys.size)
     self.yvalues = ys
     data = np.stack((xs, ys), axis=1)
     poly = array_to_polygonf(data)
     self.series.replace(poly)