def saveFitRes(ftype, xi, eff, nsig, fres): """ """ np.savez(fitresfile(ftype, xi, eff), status=np.array([[key, fres[0][key]] for key in fres[0]]), fitres=np.array([[p.name, [p.value, p.error * np.sqrt(nsig)]] for p in fres[1]]), corr=np.array(fres[2]), nsig=nsig)
def getConc(N): """ Concentration matrix for Lambda form-factors """ print('MULT = {}'.format(MULT)) data = np.load(fitresfile('upol', 0., False) + '.npz') corr = data['corr'] print(corr) errs = [x[1] for x in data['fitres'][:,1]] / np.sqrt(N*MULT) print(errs) covs = corr * np.outer(errs, errs) return np.linalg.inv(covs)
def readFitRes(ftype, xi, eff): """ """ assert (ftype in FTYPES) data = np.load(fitresfile(ftype, xi, eff) + '.npz') status = OrderedDict( [x, y] for x, y, in zip(data['status'][:, 0], data['status'][:, 1])) fitres = OrderedDict( [x, y] for x, y, in zip(data['fitres'][:, 0], data['fitres'][:, 1])) return { 'status': status['is_valid'], 'fitres': fitres, 'fitcor': data['corr'] }
def xiErr(key, xi): return np.load(fitresfile(key, xi, False) + '.npz')['fitres'][-1][1][1]
def allErrs(key, xi=0.): """ """ return [ x[1][1] for x in np.load(fitresfile(key, xi, False) + '.npz')['fitres'] ]