def __objective(self, params, y=None, x=None, dy=None, **kws):
        bkg = 0
        if x is not None: bkg = self.calc_background(x)
        if y is None:     y   = 0.0
        if dy is None:    dy  = 1.0
        model = self.model(self.params, x=x, dy=dy, **kws)
        return (model + bkg - y)/dy
fit objective function
dataset/ETHPy150Open xraypy/xraylarch/plugins/math/fitpeak.py/FitModel.__objective