Exemple #1
0
 def stepup(self,pars,x):
     """
     A fit function.
     """
     return 0.5*SpecfitFuns.upstep(pars,x)
 def stepUp(self, pars, x):
     """
     Error function like.
     """
     return 0.5 * SpecfitFuns.upstep(pars, x)
        self.connect(self.dismissButton, qt.SIGNAL("clicked()"), self.reject)
        self.connect(self.okButton, qt.SIGNAL("clicked()"), 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 PyMca 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 PyMca 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())