'Fit data to these models keeping some of the parameters common to the
two models.'

def __call__(self, *args):

    from scipy import optimize
    if (len(args) != reduce((lambda x, y: (((x + 1) + y) + 1)), self.modeldims)):
        raise ValueError(u'Expected    {}    coordinates    in    args    but    {}    provided'.format(reduce((lambda x, y: (((x + 1) + y) + 1)), self.modeldims), len(args)))
    (self.fitparams[:], _) = optimize.leastsq(self.objective_function, self.fitparams, args=args)
    fparams = self.fitparams[:]
    numjp = len(self.initvals)
    jointfitparams = fparams[:numjp]
    del fparams[:numjp]
    for model in self.models:
        joint_params = self.jointparams[model]
        numfp = (len(model._parameters) - len(joint_params))
        mfparams = fparams[:numfp]
        del fparams[:numfp]
        mparams = []
        param_metrics = model._param_metrics
        for param_name in model.param_names:
            if (param_name in joint_params):
                index = joint_params.index(param_name)
                mparams.extend([jointfitparams[index]])
            else:
                slice_ = param_metrics[param_name][u'slice']
                plen = (slice_.stop - slice_.start)
                mparams.extend(mfparams[:plen])
                del mfparams[:plen]
        model.parameters = np.array(mparams)
