def FitErrorFunction(self, fitpars):
        if self.return_resolution:
            model, resolution = self.GenerateModel(fitpars, return_resolution=True)
        else:
            model = self.GenerateModel(fitpars)
        outfile = open("chisq_summary.dat", 'a')
        #weights = 1.0 / self.data.err
        weights = np.ones(self.data.size())
        weights /= weights.sum()

        #Find the regions to use (ignoring the parts that were defined as bad)
        good = np.arange(self.data.x.size, dtype=np.int32)
        if len(self.ignore) > 0 and all([len(region) > 0 for region in self.ignore]):
            for region in self.ignore:
                x0 = min(region)
                x1 = max(region)
                tmp1 = [self.data.x[i] in self.data.x[good] for i in range(self.data.x.size)]
                tmp2 = np.logical_or(self.data.x < x0, self.data.x > x1)
                good = np.where(np.logical_and(tmp1, tmp2))[0]

        logging.info("Fraction of points used in X^2 evaluation: {}".format(float(good.size)/float(self.data.size())))
        return_array = (self.data.y - self.data.cont * model.y)[good] * weights[good]
        #Evaluate bound conditions and output the parameter value to the logfile.
        fit_idx = 0
        for i in range(len(self.bounds)):
            if self.fitting[i]:
                #if len(self.bounds[i]) == 2:
                #    return_array += FittingUtilities.bound(self.bounds[i], fitpars[fit_idx])
                outfile.write("%.12g\t" % self.const_pars[i])
                self.parvals[i].append(self.const_pars[i])
                fit_idx += 1
        outfile.write("%g\n" % (np.sum(return_array**2) / float(weights.size)))

        self.chisq_vals.append(np.sum(return_array**2) / float(weights.size))
        logging.info("X^2 = {}".format(np.sum(return_array**2) / float(weights.size)))
        outfile.close()

        return return_array


    ### -----------------------------------------------
Implements command line method to pass traffic through BIG-IP
dataset/ETHPy150Open kgullikson88/Telluric-Fitter/src/TelluricFitter.py/TelluricFitter.FitErrorFunction--crossover with--dataset/ETHPy150Open F5Networks/aws-deployments/src/f5_aws/cli.py/CLI.start_traffic