# read params pr = c51.process_params() # read data corr_avg, T = read_baryon(pr) # fit fit = chain_fit(pr, corr_avg, T) raise SystemExit # process fit fit_proc = c51.process_bootstrap(fit) fit_boot0, fit_bs = fit_proc() if pr.plot_stab_flag == 'on': c51.stability_plot(fit_boot0, 'E0', 'proton E0 ') c51.stability_plot(fit_boot0, 'Z0_p', 'proton Z0_p ') c51.stability_plot(fit_boot0, 'Z0_s', 'proton Z0_s ') if pr.print_tbl_flag == 'on': tbl = c51.tabulate_result(fit_proc, ['Z0_s', 'Z0_p', 'E0']) print tbl #c51.heatmap(fit_proc.nstates, fit_proc.tmin, fit_proc.normbayesfactor, [0,1], 'Bayes Factor', 'nstates', 'tmin') #c51.heatmap(fit_proc.nstates, fit_proc.tmin, fit_proc.chi2dof, [0,3], 'chi2/dof', 'nstates', 'tmin') # nstate stability c51.nstate_stability_plot(fit_boot0, 'E0', 'proton E0 ') c51.nstate_stability_plot(fit_boot0, 'Z0_p', 'proton Z0_p ') c51.nstate_stability_plot(fit_boot0, 'Z0_s', 'proton Z0_s ') # model averaging #bma = c51.bayes_model_avg(fit_proc, ['Z0_p', 'Z0_s', 'E0']) #print bma # look at small t values #fcn_cls = c51.fit_function(T,nstates=1) #fitraw = fit[0,1]['rawoutput'] #fit_y = fcn_cls.twopt_fitfcn_ss_ps(fitraw.x, fitraw.p) #data_y = fitraw.y
if __name__=='__main__': # read params pr = c51.process_params() # read data p_avg, T = read_proton(pr) # fit fit = fit_proton(pr, p_avg, T) # process fit fit_proc = c51.process_bootstrap(fit) fit_boot0, fit_bs = fit_proc() if pr.plot_stab_flag == 'on': c51.stability_plot(fit_boot0, 'E0', 'proton E0 ') c51.stability_plot(fit_boot0, 'Z0_p', 'proton Z0_p ') c51.stability_plot(fit_boot0, 'Z0_s', 'proton Z0_s ') if pr.print_tbl_flag == 'on': tbl = c51.tabulate_result(fit_proc, ['Z0_s', 'Z0_p', 'E0']) print tbl #c51.heatmap(fit_proc.nstates, fit_proc.tmin, fit_proc.normbayesfactor, [0,1], 'Bayes Factor', 'nstates', 'tmin') #c51.heatmap(fit_proc.nstates, fit_proc.tmin, fit_proc.chi2dof, [0,3], 'chi2/dof', 'nstates', 'tmin') # nstate stability c51.nstate_stability_plot(fit_boot0, 'E0', 'proton E0 ') c51.nstate_stability_plot(fit_boot0, 'Z0_p', 'proton Z0_p ') c51.nstate_stability_plot(fit_boot0, 'Z0_s', 'proton Z0_s ') # model averaging #bma = c51.bayes_model_avg(fit_proc, ['Z0_p', 'Z0_s', 'E0']) #print bma # look at small t values #fcn_cls = c51.fit_function(T,nstates=1) #fitraw = fit[0,1]['rawoutput'] #fit_y = fcn_cls.twopt_fitfcn_ss_ps(fitraw.x, fitraw.p) #data_y = fitraw.y
fit = c51.fitscript_v2(trange, T, mres_dat_bs, bsp, fitfcn.mres_fitfcn, result_flag='off') result = [g, fit] return result if __name__=='__main__': # read parameters params = c51.process_params() # generate bootstrap list draw_n = 0 draws = params.bs_draws(draw_n) # bootstrap mres mres_pion_fit = mres_bs(params, 'pion', draws) #mres_etas_fit = mres_bs(params, 'etas', draws, mres_data_flag) # process bootstrap mres_pion_proc = c51.process_bootstrap(mres_pion_fit) #mres_etas_proc = c51.process_bootstrap(mres_etas_fit) # plot mres stability if params.plot_stab_flag == 'on': mres_pion_0, mres_pion_n = mres_pion_proc() #mres_etas_0, mres_etas_n = mres_etas_proc() c51.stability_plot(mres_pion_0, 'mres', 'pion mres') #c51.stability_plot(mres_etas_0, 'mres', 'etas mres') plt.show() # print results if params.print_tbl_flag == 'on': tblp = c51.tabulate_result(mres_pion_proc, ['mres']) #tble = c51.tabulate_result(mres_etas_proc, ['mres']) print params.ens print tblp #print tble
def fittwo_pt(params, twopt_dat, T): # make data twopt_gv = c51.make_gvars(twopt_dat) # priors priors = params.priors[params.hadron] priors_gv = c51.dict_of_tuple_to_gvar(priors) # read trange trange = params.trange['twopt'] # fit fitfcn = c51.fit_function(T, nstates=1) fit = c51.fitscript_v2(trange, T, twopt_gv, priors_gv, fitfcn.twopt_fitfcn_phiqq, params.print_fit_flag) return np.array([[0, fit]]) if __name__=='__main__': # read parameters params = c51.process_params() # read data twopt_dat, T = read_data(params) # fit two point fit = fittwo_pt(params, twopt_dat, T) # process fit fit_proc = c51.process_bootstrap(fit) fit_boot0, fit_bs = fit_proc() if params.plot_stab_flag == 'on': c51.stability_plot(fit_boot0, 'E0', params.hadron+' E0 ') c51.stability_plot(fit_boot0, 'A0', params.hadron+' A0 ') if params.print_tbl_flag == 'on': tbl = c51.tabulate_result(fit_proc, ['A0', 'E0']) print tbl plt.show()
result = [g, fit] return result if __name__ == '__main__': # read parameters params = c51.process_params() # generate bootstrap list draw_n = 0 draws = params.bs_draws(draw_n) # bootstrap mres mres_pion_fit = mres_bs(params, 'pion', draws) #mres_etas_fit = mres_bs(params, 'etas', draws, mres_data_flag) # process bootstrap mres_pion_proc = c51.process_bootstrap(mres_pion_fit) #mres_etas_proc = c51.process_bootstrap(mres_etas_fit) # plot mres stability if params.plot_stab_flag == 'on': mres_pion_0, mres_pion_n = mres_pion_proc() #mres_etas_0, mres_etas_n = mres_etas_proc() c51.stability_plot(mres_pion_0, 'mres', 'pion mres') #c51.stability_plot(mres_etas_0, 'mres', 'etas mres') plt.show() # print results if params.print_tbl_flag == 'on': tblp = c51.tabulate_result(mres_pion_proc, ['mres']) #tble = c51.tabulate_result(mres_etas_proc, ['mres']) print params.ens print tblp #print tble