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)
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)
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)
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()
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)
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)