# fit fitfcn = c51.fit_function(T, nstates=2) fit = c51.fitscript_v2(trange, T, decay_axial_ss, bsp, fitfcn.axial_twoptss_fitfcn, result_flag='off') # record nbs fit = [g, fit] return fit if __name__ == '__main__': # read parameters pr = c51.process_params() # bootstrap draws # if draw number = 0, draws boot0 draw_n = 1000 draws = pr.bs_draws(draw_n) # bootstrap axial_ll fpi = decay_axial(pr, 'pion', draws) # bootstrap axial_ls fk = decay_axial(pr, 'kaon', draws) # process output and plot distribution fpi_proc = c51.process_bootstrap(fpi) fk_proc = c51.process_bootstrap(fk) fpi_boot0, fpi_bs = fpi_proc() fk_boot0, fk_bs = fk_proc() print fpi_boot0 if pr.plot_hist_flag == 'on':
def decay_axial_fit(args): g, trange, T, decay_axial_ss, priors, draws = args # resample decay_axial_ss = c51.make_gvars(decay_axial_ss[draws[g]]) # make priors bsp = c51.dict_of_tuple_to_gvar(priors) # fit fitfcn = c51.fit_function(T, nstates=2) fit = c51.fitscript_v2(trange, T, decay_axial_ss, bsp, fitfcn.axial_twoptss_fitfcn, result_flag='off') # record nbs fit = [g, fit] return fit if __name__=='__main__': # read parameters pr = c51.process_params() # bootstrap draws # if draw number = 0, draws boot0 draw_n = 1000 draws = pr.bs_draws(draw_n) # bootstrap axial_ll fpi = decay_axial(pr, 'pion', draws) # bootstrap axial_ls fk = decay_axial(pr, 'kaon', draws) # process output and plot distribution fpi_proc = c51.process_bootstrap(fpi) fk_proc = c51.process_bootstrap(fk) fpi_boot0, fpi_bs = fpi_proc() fk_boot0, fk_bs = fk_proc() print fpi_boot0 if pr.plot_hist_flag == 'on':