self.okButton.clicked.connect(self.accept) def getParameters(self): parametersDict = self.parametersWidget.getParameters() return parametersDict def setParameters(self, ddict): return self.parametersWidget.setParameters(ddict) if __name__ == "__main__": app = qt.QApplication([]) if len(sys.argv) > 1: from PyMca5.PyMcaIO import specfilewrapper as specfile sf = specfile.Specfile(sys.argv[1]) scan = sf[0] data = scan.data() energy = data[0, :] spectrum = data[1, :] w = XASNormalizationDialog(None, spectrum, energy=energy) else: from PyMca5 import SpecfitFuns noise = numpy.random.randn(1500.) x = 8000. + numpy.arange(1500.) y = SpecfitFuns.upstep([100, 8500., 50], x) w = XASNormalizationDialog(None, y + numpy.sqrt(y)* noise, energy=x) ret=w.exec_() if ret: print(w.getParameters())
def stepUp(self,pars,x): """ Error function like. """ return 0.5*SpecfitFuns.upstep(pars,x)
def getParameters(self): parametersDict = self.parametersWidget.getParameters() return parametersDict def setParameters(self, ddict): return self.parametersWidget.setParameters(ddict) def setSpectrum(self, energy, mu): self.parametersWidget.setData(mu, energy=energy) if __name__ == "__main__": app = qt.QApplication([]) if len(sys.argv) > 1: from PyMca5.PyMcaIO import specfilewrapper as specfile sf = specfile.Specfile(sys.argv[1]) scan = sf[0] data = scan.data() energy = data[0, :] spectrum = data[1, :] w = XASNormalizationDialog(None, spectrum, energy=energy) else: from PyMca5 import SpecfitFuns noise = numpy.random.randn(1500) x = 8000. + numpy.arange(1500.) y = SpecfitFuns.upstep([100, 8500., 50], x) w = XASNormalizationDialog(None, y + numpy.sqrt(y) * noise, energy=x) ret = w.exec_() if ret: print(w.getParameters())