Beispiel #1
0
    def setData(self, data):
        data = self.normalizeData(data)
        nxd = NXdata(data)
        signal_name = get_attr_as_string(data, "signal")
        # signal_errors = nx.errors   # not supported
        group_name = data.name
        x_axis, y_axis = nxd.axes[-2:]

        x_label, y_label = nxd.axes_names[-2:]
        if x_label is not None:
            x_errors = nxd.get_axis_errors(x_label)
        else:
            x_errors = None

        if y_label is not None:
            y_errors = nxd.get_axis_errors(y_label)
        else:
            y_errors = None

        self.getWidget().setCurveData(y_axis,
                                      x_axis,
                                      values=nxd.signal,
                                      yerror=y_errors,
                                      xerror=x_errors,
                                      ylabel=signal_name,
                                      xlabel=x_label,
                                      title="NXdata group " + group_name)
Beispiel #2
0
    def setData(self, data):
        data = self.normalizeData(data)
        nxd = NXdata(data)
        signal_name = data.attrs["signal"]
        group_name = data.name
        if nxd.axes_names[-1] is not None:
            x_errors = nxd.get_axis_errors(nxd.axes_names[-1])
        else:
            x_errors = None

        self.getWidget().setCurveData(nxd.signal, nxd.axes[-1],
                                      yerror=nxd.errors, xerror=x_errors,
                                      ylabel=signal_name, xlabel=nxd.axes_names[-1],
                                      title="NXdata group " + group_name)