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)
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)
def getDataPriority(self, data, info): data = self.normalizeData(data) if info.isNXdata: nxd = NXdata(data) if nxd.signal_is_0d or nxd.interpretation in ["scalar", "scaler"]: return 100 return DataView.UNSUPPORTED
def getDataPriority(self, data, info): data = self.normalizeData(data) if info.isNXdata: nxd = NXdata(data) if nxd.signal_ndim >= 3: if nxd.interpretation not in ["scalar", "scaler", "spectrum", "image"]: return 100 return DataView.UNSUPPORTED
def getDataPriority(self, data, info): data = self.normalizeData(data) if info.isNXdata: nxd = NXdata(data) if nxd.is_x_y_value_scatter or nxd.is_unsupported_scatter: return DataView.UNSUPPORTED if nxd.signal_is_1d and \ not nxd.interpretation in ["scalar", "scaler"]: return 100 if nxd.interpretation == "spectrum": return 100 return DataView.UNSUPPORTED
def setData(self, data): data = self.normalizeData(data) nxd = NXdata(data) signal_name = data.attrs["signal"] group_name = data.name y_axis, x_axis = nxd.axes[-2:] y_label, x_label = nxd.axes_names[-2:] self.getWidget().setImageData( nxd.signal, x_axis=x_axis, y_axis=y_axis, signal_name=signal_name, xlabel=x_label, ylabel=y_label, title="NXdata group %s: %s" % (group_name, signal_name))
def setData(self, data): data = self.normalizeData(data) nxd = NXdata(data) signal_name = get_attr_as_string(data, "signal") group_name = data.name z_axis, y_axis, x_axis = nxd.axes[-3:] z_label, y_label, x_label = nxd.axes_names[-3:] self.getWidget().setStackData(nxd.signal, x_axis=x_axis, y_axis=y_axis, z_axis=z_axis, signal_name=signal_name, xlabel=x_label, ylabel=y_label, zlabel=z_label, title="NXdata group %s: %s" % (group_name, signal_name))
def setData(self, data): data = self.normalizeData(data) signal = NXdata(data).signal self.getWidget().setArrayData(signal, labels=True)
def getDataPriority(self, data, info): data = self.normalizeData(data) if info.isNXdata: if NXdata(data).is_x_y_value_scatter: return 100 return DataView.UNSUPPORTED