def guess_starting_values(self, y, x):
        ymax, ymin = max(y), min(y)
        yex = ymax
        self.set_initval(self.params.amplitude, 5.*(ymax-ymin))
        if self.negative:
            yex = ymin
            self.params.amplitude.value = -(ymax - ymin)*5.0
        iyex = index_nearest(y, yex)
        self.set_initval(self.params.center, x[iyex])

        halfy = yex /2.0
        ihalfy = index_of(y, halfy)
        sig0 = abs(x[iyex] - x[ihalfy])
        sig1 = 0.15*(max(x) - min(x))
        if sig1 < sig0 : sig0 = sig1
        self.set_initval(self.params.sigma,  sig0)
        bkg0 = ymin
        if self.negative: bkg0 = ymax
        self.set_init_bkg(bkg0)
could probably improve this
dataset/ETHPy150Open xraypy/xraylarch/plugins/math/fitpeak.py/PeakModel.guess_starting_values