diff options
| author | shivesh <s.p.mandalia@qmul.ac.uk> | 2018-11-06 14:23:10 -0600 |
|---|---|---|
| committer | shivesh <s.p.mandalia@qmul.ac.uk> | 2018-11-06 14:23:10 -0600 |
| commit | 441e5e8101b03d6c15bc2370700ee14d07375e92 (patch) | |
| tree | 543544161ceb6c5a1732cfa084191b61fedd99d2 | |
| parent | 84c05583ad3d582d107fe09be700311ea466b1af (diff) | |
| download | GolemFlavor-441e5e8101b03d6c15bc2370700ee14d07375e92.tar.gz GolemFlavor-441e5e8101b03d6c15bc2370700ee14d07375e92.zip | |
Tue 6 Nov 14:23:10 CST 2018
| -rwxr-xr-x | plot_sens.py | 12 | ||||
| -rw-r--r-- | submitter/mcmc_dag.py | 13 | ||||
| -rw-r--r-- | utils/plot.py | 99 |
3 files changed, 74 insertions, 50 deletions
diff --git a/plot_sens.py b/plot_sens.py index a297e17..2ecde12 100755 --- a/plot_sens.py +++ b/plot_sens.py @@ -72,9 +72,9 @@ def nuisance_argparse(parser): def process_args(args): """Process the input args.""" - if args.fix_mixing not MixingScenario.NONE and args.fix_scale: + if args.fix_mixing is not MixingScenario.NONE and args.fix_scale: raise NotImplementedError('Fixed mixing and scale not implemented') - if args.fix_mixing not MixingScenario.NONE and args.fix_mixing_almost: + if args.fix_mixing is not MixingScenario.NONE and args.fix_mixing_almost: raise NotImplementedError( '--fix-mixing and --fix-mixing-almost cannot be used together' ) @@ -231,8 +231,8 @@ def main(): infile += '/gaussian/' if args.likelihood is Likelihood.GAUSSIAN: infile += '{0}/'.format(str(args.sigma_ratio).replace('.', '_')) - # infile += '/DIM{0}/fix_ifr/{1}/{2}/{3}/fr_stat'.format( - infile += '/DIM{0}/fix_ifr/seed2/{1}/{2}/{3}/fr_stat'.format( + infile += '/DIM{0}/fix_ifr/{1}/{2}/{3}/fr_stat'.format( + # infile += '/DIM{0}/fix_ifr/seed2/{1}/{2}/{3}/fr_stat'.format( # infile += '/DIM{0}/fix_ifr/100TeV/{1}/{2}/{3}/fr_stat'.format( dim, *map(misc_utils.parse_enum, [args.stat_method, args.run_method, args.data]) ) + misc_utils.gen_identifier(argsc) @@ -279,8 +279,8 @@ def main(): base_infile += '/gaussian/' if args.likelihood is Likelihood.GAUSSIAN: base_infile += '{0}/'.format(str(args.sigma_ratio).replace('.', '_')) - # base_infile += '/DIM{0}/fix_ifr'.format(dim) - base_infile += '/DIM{0}/fix_ifr/seed2'.format(dim) + base_infile += '/DIM{0}/fix_ifr'.format(dim) + # base_infile += '/DIM{0}/fix_ifr/seed2'.format(dim) # base_infile += '/DIM{0}/fix_ifr/100TeV'.format(dim) for isrc, src in enumerate(args.source_ratios): diff --git a/submitter/mcmc_dag.py b/submitter/mcmc_dag.py index b7e2c84..5a44411 100644 --- a/submitter/mcmc_dag.py +++ b/submitter/mcmc_dag.py @@ -25,7 +25,7 @@ GLOBAL_PARAMS = {} # MCMC GLOBAL_PARAMS.update(dict( - run_mcmc = 'False', + run_mcmc = 'True', burnin = 250, nsteps = 1000, nwalkers = 60, @@ -34,9 +34,9 @@ GLOBAL_PARAMS.update(dict( )) # FR -# dimension = [3, 6] +dimension = [6] # dimension = [4, 5, 7, 8] -dimension = [3, 4, 5, 6, 7, 8] +# dimension = [3, 4, 5, 6, 7, 8] GLOBAL_PARAMS.update(dict( threads = 1, binning = '6e4 1e7 20', @@ -44,7 +44,7 @@ GLOBAL_PARAMS.update(dict( scale_region = "1E10", energy_dependance = 'spectral', spectral_index = -2, - fix_mixing = 'None', + fix_mixing = 'T23', fix_mixing_almost = 'False', fold_index = 'True' )) @@ -67,7 +67,8 @@ GLOBAL_PARAMS.update(dict( plot_elements = 'False', )) -outfile = 'dagman_FR_MCMC_{0}.submit'.format(GLOBAL_PARAMS['likelihood']) +outfile = 'dagman_FR_MCMC_{0}_{1}.submit'.format(GLOBAL_PARAMS['likelihood'], + GLOBAL_PARAMS['fix_mixing']) golemfitsourcepath = os.environ['GOLEMSOURCEPATH'] + '/GolemFit' condor_script = golemfitsourcepath + '/scripts/flavour_ratio/submitter/mcmc_submit.sub' @@ -80,7 +81,7 @@ with open(outfile, 'w') as f: ) for frs in fix_sfr_mfr: print 'frs', frs - outchains = outchain_head + '/fix_ifr/' + outchains = outchain_head + '/fix_ifr/' + '{0}/'.format(GLOBAL_PARAMS['fix_mixing']) if GLOBAL_PARAMS['likelihood'].lower() == 'gaussian': outchains += '{0}/'.format(str(GLOBAL_PARAMS['sigma_ratio']).replace('.', '_')) outchains += '{0}/'.format(GLOBAL_PARAMS['data'].lower()) diff --git a/utils/plot.py b/utils/plot.py index fb58176..610b179 100644 --- a/utils/plot.py +++ b/utils/plot.py @@ -437,6 +437,8 @@ def plot_sens_fixed_angle_pretty(data, outfile, outformat, args): 8: (-21-(en[0]*6), -21-(en[1]+en[1]*6)) } + angles = 2 + colour = {0:'red', 1:'blue', 2:'green'} rgb_co = {0:[1,0,0], 1:[0,0,1], 2:[0.0, 0.5019607843137255, 0.0]} yticks = [r'$\mathcal{O}_{e\mu}$', r'$\mathcal{O}_{e\tau}$', r'$\mathcal{O}_{\mu\tau}$'] @@ -454,13 +456,22 @@ def plot_sens_fixed_angle_pretty(data, outfile, outformat, args): dim = args.dimensions[idim] print '== dim', dim argsc.dimension = dim - gs0 = gridspec.GridSpecFromSubplotSpec( - len(yticks), 1, subplot_spec=gs[idim], hspace=0 - ) + if angles == 3: + gs0 = gridspec.GridSpecFromSubplotSpec( + len(yticks), 1, subplot_spec=gs[idim], hspace=0 + ) + elif angles == 2: + gs0 = gridspec.GridSpecFromSubplotSpec( + len(yticks)-1, 1, subplot_spec=gs[idim], hspace=0 + ) for ian in xrange(len(yticks)): + if angles == 2 and ian == 0: continue print '=== an', ian - ax = fig.add_subplot(gs0[ian]) + if angles == 3: + ax = fig.add_subplot(gs0[ian]) + elif angles == 2: + ax = fig.add_subplot(gs0[ian-1]) if first_ax is None: first_ax = ax ax.set_xlim(xlims) ylim = (0.5, 1.5) @@ -472,19 +483,31 @@ def plot_sens_fixed_angle_pretty(data, outfile, outformat, args): ax.axvline(x=xmaj, ls=':', color='gray', alpha=0.2, linewidth=1) ax.get_xaxis().set_visible(False) linestyle = (5, (10, 10)) - if ian == 0: - ax.spines['bottom'].set_alpha(0.6) - elif ian == 1: - ax.text( - -0.04, ylim[0], '$d = {0}$'.format(dim), fontsize=16, - rotation='90', verticalalignment='center', - transform=ax.transAxes - ) - dim_label_flag = False - ax.spines['top'].set_alpha(0.6) - ax.spines['bottom'].set_alpha(0.6) - elif ian == 2: - ax.spines['top'].set_alpha(0.6) + if angles == 3: + if ian == 1: + ax.spines['bottom'].set_alpha(0.6) + elif ian == 2: + ax.text( + -0.04, ylim[0], '$d = {0}$'.format(dim), fontsize=16, + rotation='90', verticalalignment='center', + transform=ax.transAxes + ) + dim_label_flag = False + ax.spines['top'].set_alpha(0.6) + ax.spines['bottom'].set_alpha(0.6) + elif ian == 2: + ax.spines['top'].set_alpha(0.6) + if angles == 2: + if ian == 0: + ax.spines['bottom'].set_alpha(0.6) + elif ian == 1: + ax.text( + -0.04, ylim[0], '$d = {0}$'.format(dim), fontsize=16, + rotation='90', verticalalignment='top', + transform=ax.transAxes + ) + dim_label_flag = False + ax.spines['top'].set_alpha(0.6) for isrc in xrange(len(data[idim])): src = args.source_ratios[isrc] @@ -497,10 +520,10 @@ def plot_sens_fixed_angle_pretty(data, outfile, outformat, args): else: alpha = 0.07 col = 'blue' - ax.add_patch(patches.Rectangle( - (bote[dim][1], ylim[0]), bote[dim][0]-bote[dim][1], np.diff(ylim), - fill=True, facecolor=col, alpha=alpha, linewidth=0 - )) + # ax.add_patch(patches.Rectangle( + # (bote[dim][1], ylim[0]), bote[dim][0]-bote[dim][1], np.diff(ylim), + # fill=True, facecolor=col, alpha=alpha, linewidth=0 + # )) bc_limit = best_limits[dim] # ax.axvline(x=np.log10(bc_limit[1]), color=bc_limit[2], alpha=0.7, linewidth=1.5) @@ -578,15 +601,15 @@ def plot_sens_fixed_angle_pretty(data, outfile, outformat, args): fontsize=19) ax.tick_params(axis='x', labelsize=16) - legend_elements.append( - Patch(facecolor=col, alpha=alpha+0.1, edgecolor='k', label='maximum reach') - ) + # legend_elements.append( + # Patch(facecolor=col, alpha=alpha+0.1, edgecolor='k', label='maximum reach') + # ) purple = [0.5019607843137255, 0.0, 0.5019607843137255] legend_elements.append( - Patch(facecolor=purple+[0.7], edgecolor=purple+[1], label='Planck Scale') + Patch(facecolor=purple+[0.7], edgecolor=purple+[1], label='Planck Scale Expectation') ) legend_elements.append( - Patch(facecolor='none', hatch='\\\\', edgecolor='k', label='IceCube arXiv:1709.03434') + Patch(facecolor='none', hatch='\\\\', edgecolor='k', label='IceCube, Nature.Phy.14,961(2018)') ) legend = first_ax.legend( @@ -598,18 +621,18 @@ def plot_sens_fixed_angle_pretty(data, outfile, outformat, args): plt.setp(legend.get_title(), fontsize='11') legend.get_frame().set_linestyle('-') - if show_data: ybound = 0.595 - else: ybound = 0.73 - if args.data is DataType.REAL and show_data: - # fig.text(0.295, 0.684, 'IceCube Preliminary', color='red', fontsize=13, - fig.text(0.278, ybound, r'\bf IceCube Preliminary', color='red', fontsize=13, - ha='center', va='center', zorder=11) - elif args.data is DataType.REALISATION: - fig.text(0.278, ybound-0.05, r'\bf IceCube Simulation', color='red', fontsize=13, - ha='center', va='center', zorder=11) - else: - fig.text(0.278, ybound, r'\bf IceCube Simulation', color='red', fontsize=13, - ha='center', va='center', zorder=11) + # if show_data: ybound = 0.595 + # else: ybound = 0.73 + # if args.data is DataType.REAL and show_data: + # # fig.text(0.295, 0.684, 'IceCube Preliminary', color='red', fontsize=13, + # fig.text(0.278, ybound, r'\bf IceCube Preliminary', color='red', fontsize=13, + # ha='center', va='center', zorder=11) + # elif args.data is DataType.REALISATION: + # fig.text(0.278, ybound-0.05, r'\bf IceCube Simulation', color='red', fontsize=13, + # ha='center', va='center', zorder=11) + # else: + # fig.text(0.278, ybound, r'\bf IceCube Simulation', color='red', fontsize=13, + # ha='center', va='center', zorder=11) misc_utils.make_dir(outfile) for of in outformat: |
