aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xfr.py4
-rwxr-xr-xplot_sens.py4
-rwxr-xr-xsens.py9
-rw-r--r--[-rwxr-xr-x]submitter/clean.sh0
-rw-r--r--submitter/contour_dag.py2
-rw-r--r--submitter/fr_dag.py2
-rw-r--r--submitter/sens_dag.py9
-rw-r--r--submitter/sens_submit.sub2
-rw-r--r--utils/plot.py41
9 files changed, 38 insertions, 35 deletions
diff --git a/fr.py b/fr.py
index ef0b775..9802b55 100755
--- a/fr.py
+++ b/fr.py
@@ -226,8 +226,8 @@ def main():
r'$N_{\rm muon}$',
r'$N_{\rm astro}$',
r'$\gamma_{\rm astro}$',
- r'${\rm log}_{10}\left[\Lambda^{-1}_{('+ \
- r'{0}'.format(args.dimension)+r')}'+ \
+ r'${\rm log}_{10}\left[\Lambda^{-1}_{'+ \
+ r'{0}'.format(args.dimension)+r'}'+ \
misc_utils.get_units(args.dimension)+r'\right]$'
]
diff --git a/plot_sens.py b/plot_sens.py
index 42b711f..79aa6a9 100755
--- a/plot_sens.py
+++ b/plot_sens.py
@@ -27,7 +27,7 @@ from utils.misc import gen_identifier, SortingHelpFormatter
from utils.param import Param, ParamSet
-MASK_X = (0.3, 0.89)
+MASK_X = (0.3, 0.7)
def process_args(args):
@@ -212,7 +212,7 @@ def main():
outfile = basename[:5]+basename[5:].replace('data', 'plots')
outfile += '/' + os.path.basename(base_infile)
- label = plot_utils.texture_label(texture)[:-1]+r'=\pi/4$'
+ label = r'$\text{Texture}=' + plot_utils.texture_label(texture)[1:]
plot_utils.plot_statistic(
data = data[idim][isrc][itex],
outfile = outfile,
diff --git a/sens.py b/sens.py
index 74eef61..9e58c2f 100755
--- a/sens.py
+++ b/sens.py
@@ -167,6 +167,10 @@ def parse_args(args=None):
'--eval-segment', type=str, default='all',
help='Which point to evalaute'
)
+ parser.add_argument(
+ '--overwrite', type=misc_utils.parse_bool, default='False',
+ help='Overwrite chains'
+ )
fr_utils.fr_argparse(parser)
gf_utils.gf_argparse(parser)
llh_utils.llh_argparse(parser)
@@ -204,6 +208,11 @@ def main():
*map(misc_utils.parse_enum, [args.stat_method, args.data])
) + misc_utils.gen_identifier(args)
+ if not args.overwrite and os.path.isfile(outfile+'.npy'):
+ print 'FILE EXISTS {0}'.format(outfile+'.npy')
+ print 'Exiting...'
+ return
+
# Setup Golemfit.
if args.run_mn:
gf_utils.setup_fitter(args, asimov_paramset)
diff --git a/submitter/clean.sh b/submitter/clean.sh
index a56d7f1..a56d7f1 100755..100644
--- a/submitter/clean.sh
+++ b/submitter/clean.sh
diff --git a/submitter/contour_dag.py b/submitter/contour_dag.py
index 178bf4f..6c87e2f 100644
--- a/submitter/contour_dag.py
+++ b/submitter/contour_dag.py
@@ -29,7 +29,7 @@ GLOBAL_PARAMS.update(dict(
GLOBAL_PARAMS.update(dict(
run_mcmc = 'True',
burnin = 1000,
- nsteps = 8000,
+ nsteps = 10000,
nwalkers = 60,
mcmc_seed_type = 'uniform'
))
diff --git a/submitter/fr_dag.py b/submitter/fr_dag.py
index bf8c708..ccfce50 100644
--- a/submitter/fr_dag.py
+++ b/submitter/fr_dag.py
@@ -38,7 +38,7 @@ GLOBAL_PARAMS.update(dict(
GLOBAL_PARAMS.update(dict(
run_mcmc = 'True',
burnin = 1000,
- nsteps = 8000,
+ nsteps = 10000,
nwalkers = 60,
mcmc_seed_type = 'uniform'
))
diff --git a/submitter/sens_dag.py b/submitter/sens_dag.py
index 5d3d6a3..6001d2c 100644
--- a/submitter/sens_dag.py
+++ b/submitter/sens_dag.py
@@ -6,11 +6,11 @@ import numpy as np
x_segments = 100
scenarios = [
[(0.00, 0.30), 'OET'],
- [(0.89, 1.00), 'OUT']
+ [(0.70, 1.00), 'OUT']
]
dims = [
- 6
+ 3
]
for i, (xlims, tex) in enumerate(scenarios):
@@ -23,7 +23,7 @@ for i, (xlims, tex) in enumerate(scenarios):
datadir = '/data/user/smandalia/flavour_ratio/data/sensitivity'
-prefix = ''
+prefix = '_dim3'
golemfitsourcepath = os.environ['GOLEMSOURCEPATH'] + '/GolemFit'
condor_script = golemfitsourcepath + '/scripts/flavour_ratio/submitter/sens_submit.sub'
@@ -34,7 +34,8 @@ GLOBAL_PARAMS = {}
GLOBAL_PARAMS.update(dict(
stat_method = 'bayesian',
segments = 10,
- seed = 26
+ seed = 26,
+ overwrite = 'False'
))
# MultiNest
diff --git a/submitter/sens_submit.sub b/submitter/sens_submit.sub
index 7d543d8..d354eb1 100644
--- a/submitter/sens_submit.sub
+++ b/submitter/sens_submit.sub
@@ -1,5 +1,5 @@
Executable = /data/user/smandalia/GolemTools/sources/GolemFit/scripts/flavour_ratio/sens.py
-Arguments = "--ast $(ast) --data $(data) --dimension $(dimension) --no-bsm $(no_bsm) --datadir $(datadir) --seed $(seed) --source-ratio $(sr0) $(sr1) $(sr2) --threads $(threads) --binning $(binning) --texture $(texture) --segments $(segments) --eval-segment $(eval_segment) --stat-method $(stat_method) --mn-live-points $(mn_live_points) --mn-tolerance $(mn_tolerance) --mn-efficiency $(mn_efficiency) --mn-output $(mn_output) --run-mn $(run_mn)"
+Arguments = "--ast $(ast) --data $(data) --dimension $(dimension) --no-bsm $(no_bsm) --datadir $(datadir) --seed $(seed) --source-ratio $(sr0) $(sr1) $(sr2) --threads $(threads) --binning $(binning) --texture $(texture) --segments $(segments) --eval-segment $(eval_segment) --stat-method $(stat_method) --mn-live-points $(mn_live_points) --mn-tolerance $(mn_tolerance) --mn-efficiency $(mn_efficiency) --mn-output $(mn_output) --run-mn $(run_mn) --overwrite $(overwrite)"
# All logs will go to a single file
log = /scratch/smandalia/flavour_ratio/submitter/logs/job_$(Cluster).log
diff --git a/utils/plot.py b/utils/plot.py
index aa3b57d..f8387cc 100644
--- a/utils/plot.py
+++ b/utils/plot.py
@@ -164,7 +164,7 @@ def get_limit(scales, statistic, args, mask_initial=False):
'DIM {0} [{1}, {2}, {3}]!'.format(
args.dimension, *args.source_ratio
)
- # return None
+ return None
lim = al[0]
print 'limit = {0}'.format(lim)
return lim
@@ -536,12 +536,14 @@ def plot_statistic(data, outfile, outformat, args, scale_param, label=None):
print 'data', data
print 'data.shape', data.shape
- scales, statistic = ma.compress_rows(data).T
+ print 'outfile', outfile
try:
+ scales, statistic = ma.compress_rows(data).T
+ lim = get_limit(scales, statistic, args, mask_initial=True)
tck, u = splprep([scales, statistic], s=0)
except:
return
- sc, st = splev(np.linspace(0, 1, 10000), tck)
+ sc, st = splev(np.linspace(0, 1, 1000), tck)
scales_rm = sc[sc >= scales[1]]
statistic_rm = st[sc >= scales[1]]
@@ -559,10 +561,12 @@ def plot_statistic(data, outfile, outformat, args, scale_param, label=None):
xlims = SCALE_BOUNDARIES[args.dimension]
ax.set_xlim(xlims)
- ax.set_xlabel(r'${\mathrm {log}}_{10} \left (\Lambda^{-1}' + \
- get_units(args.dimension) +r'\right )$', fontsize=16)
+ ax.set_xlabel(r'${\rm log}_{10}\left[\Lambda^{-1}_{'+ \
+ r'{0}'.format(args.dimension)+r'}'+ \
+ get_units(args.dimension)+r'\right]$', fontsize=16)
+
if args.stat_method is StatCateg.BAYESIAN:
- ax.set_ylabel(r'log(Bayes Factor)')
+ ax.set_ylabel(r'$\text{Bayes\:Factor}\:\left[\text{ln}\left(B_{0/1}\right)\right]$')
elif args.stat_method is StatCateg.FREQUENTIST:
ax.set_ylabel(r'$-2\Delta {\rm LLH}$')
@@ -570,21 +574,10 @@ def plot_statistic(data, outfile, outformat, args, scale_param, label=None):
# ymax = np.round(np.max(reduced_ev) + 1.5)
# ax.set_ylim((ymin, ymax))
- ax.plot(scales_rm, reduced_ev)
+ ax.plot(scales_rm, reduced_ev, color='k', linewidth=1, alpha=1, ls='-')
- ax.axhline(y=np.log(10**(BAYES_K)), color='red', alpha=1., linewidth=1.3)
-
- for ymaj in ax.yaxis.get_majorticklocs():
- ax.axhline(y=ymaj, ls=':', color='gray', alpha=0.3, linewidth=1)
- for xmaj in ax.xaxis.get_majorticklocs():
- ax.axvline(x=xmaj, ls=':', color='gray', alpha=0.3, linewidth=1)
-
- if args.data is DataType.REAL:
- fig.text(0.8, 0.14, 'IceCube Preliminary', color='red', fontsize=9,
- ha='center', va='center')
- elif args.data in [DataType.ASIMOV, DataType.REALISATION]:
- fig.text(0.8, 0.14, 'IceCube Simulation', color='red', fontsize=9,
- ha='center', va='center')
+ ax.axhline(y=np.log(10**(BAYES_K)), color='red', alpha=1., linewidth=1.2, ls='--')
+ ax.axvline(x=lim, color='red', alpha=1., linewidth=1.2, ls='--')
at = AnchoredText(
fig_text, prop=dict(size=10), frameon=True, loc=4
@@ -777,7 +770,7 @@ def plot_x(data, outfile, outformat, args, normalise=False):
ax = fig.add_subplot(111)
if normalise:
- ylims = (-12, 8)
+ ylims = (-10, 8)
else:
ylims = (-60, -20)
xlims = (0, 1)
@@ -802,7 +795,7 @@ def plot_x(data, outfile, outformat, args, normalise=False):
# 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=0.7)
+ 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)
@@ -819,11 +812,11 @@ def plot_x(data, outfile, outformat, args, normalise=False):
transform=ax.transAxes, rotation='vertical', va='bottom'
)
ax.text(
- 0.07, 0.46, r'${\rm \bf Excluded}$', fontsize=largesize,
+ 0.05, 0.47, r'${\rm \bf Excluded}$', fontsize=largesize,
transform=ax.transAxes, color = 'g', rotation='vertical', zorder=10
)
ax.text(
- 0.95, 0.46, r'${\rm \bf Excluded}$', fontsize=largesize,
+ 0.95, 0.47, r'${\rm \bf Excluded}$', fontsize=largesize,
transform=ax.transAxes, color = 'b', rotation='vertical', zorder=10
)