From f0189cde321f9fa91109829f7430ecfc06c96e97 Mon Sep 17 00:00:00 2001 From: shivesh Date: Mon, 23 Sep 2019 11:14:30 -0500 Subject: plot --- contour.py | 35 +++++++++++++++++++++++------------ submitter/fr_dag.py | 4 ++-- utils/plot.py | 30 +++++++++++++++--------------- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/contour.py b/contour.py index b02696f..5e01157 100755 --- a/contour.py +++ b/contour.py @@ -138,17 +138,17 @@ def gen_identifier(args): return f -def gen_figtext(args, asimov_paramset): - f = '' +def gen_figtext(args): + """Generate the figure text.""" + t = r'$' if args.data is DataType.REAL: - f += 'IceCube Preliminary' - else: - f += '_INJ_{0}'.format(misc_utils.solve_ratio(args.injected_ratio)) - for param in asimov_paramset: - f += '\nInjected {0:20s} = {1:.3f}'.format( - param.name, param.nominal_value - ) - return f + t += r'\textbf{IceCube\:Preliminary}$' + elif args.data in [DataType.ASIMOV, DataType.REALISATION]: + t += r'{\rm\bf IceCube\:Simulation}' + '$\n$' + t += r'\rm{Injected\:composition}'+r'\:=\:({0})_\oplus'.format( + solve_ratio(args.injected_ratio).replace('_', ':') + ) + '$' + return t def triangle_llh(theta, args, hypo_paramset): @@ -229,14 +229,25 @@ def main(): ) mcmc_utils.save_chains(samples, outfile) + labels = [ + r'$N_{\rm conv}$', + r'$N_{\rm prompt}$', + r'$N_{\rm muon}$', + r'$N_{\rm astro}$', + r'$\gamma_{\rm astro}$', + r'$\text{sin}^4\phi_\oplus$', + r'$\text{cos}\left(2\psi\right)_\oplus$', + ] + of = outfile[:5]+outfile[5:].replace('data', 'plots')+'_posterior' plot_utils.chainer_plot( infile = outfile+'.npy', outfile = of, - outformat = ['png'], + outformat = ['pdf'], args = args, llh_paramset = hypo_paramset, - fig_text = gen_figtext(args, hypo_paramset) + fig_text = gen_figtext(args), + labels = labels ) print "DONE!" diff --git a/submitter/fr_dag.py b/submitter/fr_dag.py index b93ad86..bf8c708 100644 --- a/submitter/fr_dag.py +++ b/submitter/fr_dag.py @@ -37,8 +37,8 @@ GLOBAL_PARAMS.update(dict( # Emcee GLOBAL_PARAMS.update(dict( run_mcmc = 'True', - burnin = 500, - nsteps = 2000, + burnin = 1000, + nsteps = 8000, nwalkers = 60, mcmc_seed_type = 'uniform' )) diff --git a/utils/plot.py b/utils/plot.py index 175d0fb..6b10521 100644 --- a/utils/plot.py +++ b/utils/plot.py @@ -92,12 +92,12 @@ def gen_figtext(args): t += r'\textbf{IceCube\:Preliminary}' + '$\n$' elif args.data in [DataType.ASIMOV, DataType.REALISATION]: t += r'{\rm\bf IceCube\:Simulation}' + '$\n$' - t += r'\rm{Injected\:flavour\:ratio}'+r'\:=\:({0})_\oplus'.format( + t += r'\rm{Injected\:composition}'+r'\:=\:({0})_\oplus'.format( solve_ratio(args.injected_ratio).replace('_', ':') ) + '$\n$' - t += r'{\rm Source\:flavour\:ratio}'+r'\:=\:({0})_S'.format( + t += r'{\rm Source\:composition}'+r'\:=\:({0})'.format( solve_ratio(args.source_ratio).replace('_', ':') - ) + ) + r'_\text{S}' t += '$\n$' + r'{\rm Dimension}'+r' = {0}$'.format(args.dimension) return t @@ -771,7 +771,7 @@ def plot_x(data, outfile, outformat, args, normalise=False): ax = fig.add_subplot(111) if normalise: - ylims = (-10, 8) + ylims = (-12, 8) else: ylims = (-60, -20) xlims = (0, 1) @@ -792,24 +792,24 @@ def plot_x(data, outfile, outformat, args, normalise=False): ax.set_xticks([], minor=True) ax.set_xticks(xticks, minor=False) ax.set_xticklabels(xlabels, fontsize=largesize) - for ymaj in ax.yaxis.get_majorticklocs(): - ax.axhline(y=ymaj, ls=':', color='gray', alpha=0.2, linewidth=1) + # for ymaj in ax.yaxis.get_majorticklocs(): + # ax.axhline(y=ymaj, ls=':', color='gray', alpha=0.2, linewidth=1) for xmaj in xticks: if xmaj == 1/3.: - ax.axvline(x=xmaj, ls='-', color='gray', alpha=0.5, linewidth=1) - else: - ax.axvline(x=xmaj, ls=':', color='gray', alpha=0.2, linewidth=1) + ax.axvline(x=xmaj, ls='--', color='gray', alpha=0.5, linewidth=0.7) + # else: + # ax.axvline(x=xmaj, ls=':', color='gray', alpha=0.2, linewidth=1) ax.text( - (1/3.)+0.01, 0.01, r'$f_{\alpha}^S=(1:2:0)$', fontsize=labelsize, + (1/3.)+0.01, 0.01, r'$(1:2:0)_\text{S}$', fontsize=labelsize, transform=ax.transAxes, rotation='vertical', va='bottom' ) ax.text( - 0.96, 0.01, r'$f_{\alpha}^S=(1:0:0)$', fontsize=labelsize, + 0.96, 0.01, r'$(1:0:0)_\text{S}$', fontsize=labelsize, transform=ax.transAxes, rotation='vertical', va='bottom', ha='left' ) ax.text( - 0.01, 0.01, r'$f_{\alpha}^S=(0:1:0)$', fontsize=labelsize, + 0.01, 0.01, r'$(0:1:0)_\text{S}$', fontsize=labelsize, transform=ax.transAxes, rotation='vertical', va='bottom' ) ax.text( @@ -897,8 +897,8 @@ def plot_x(data, outfile, outformat, args, normalise=False): if normalise: fig.text( 0.02, 0.5, - r'${\rm New\:Physics\:Scale}\:[\:{\rm log}_{10} \left (\Lambda^{-1}_{(' + - r'\:{0}'.format(args.dimension)+r')}\:\cdot\:{\rm M}_{\:\rm Planck}^{\:'+ + r'${\rm New\:Physics\:Scale}\:[\:{\rm log}_{10} \left (\Lambda^{-1}_{' + + r'\:{0}'.format(args.dimension)+r'}\:\cdot\:{\rm M}_{\:\rm Planck}^{\:'+ r'{0}'.format(args.dimension-4)+ r'}\right )\: ]$', ha='left', va='center', rotation='vertical', fontsize=largesize ) @@ -912,7 +912,7 @@ def plot_x(data, outfile, outformat, args, normalise=False): ) ax.set_xlabel( - r'${\rm Source\:Flavour\:Ratio}\:[\:f_{\alpha}^S=\left (\:x:1-x:0\:\right )\:]$', + r'${\rm Source\:Composition}\:[\:f_{\alpha,\text{S}}=\left (\:x:1-x:0\:\right )_\text{S}\:]$', fontsize=largesize ) ax.tick_params(axis='x', labelsize=largesize-1) -- cgit v1.2.3