aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/fr.py2
-rw-r--r--utils/gf.py17
-rw-r--r--utils/plot.py14
3 files changed, 21 insertions, 12 deletions
diff --git a/utils/fr.py b/utils/fr.py
index 5acd6f8..64e2706 100644
--- a/utils/fr.py
+++ b/utils/fr.py
@@ -248,7 +248,7 @@ def fr_argparse(parser):
help='Fold in the spectral index when using GolemFit'
)
parser.add_argument(
- '--binning', default=[1e4, 1e7, 5], type=float, nargs=3,
+ '--binning', default=[6e4, 1e7, 5], type=float, nargs=3,
help='Binning for spectral energy dependance'
)
parser.add_argument(
diff --git a/utils/gf.py b/utils/gf.py
index b651b5a..7ded152 100644
--- a/utils/gf.py
+++ b/utils/gf.py
@@ -55,7 +55,8 @@ def fit_flags(llh_paramset):
def steering_params(args):
steering_categ = args.ast
- params = gf.SteeringParams()
+ # params = gf.SteeringParams(gf.sampleTag.HESE)
+ params = gf.SteeringParams(gf.sampleTag.MagicTau)
params.quiet = False
params.fastmode = True
params.simToLoad= steering_categ.name.lower()
@@ -65,12 +66,15 @@ def steering_params(args):
# For Tianlu
# params.years = [999]
+ params.minFitEnergy = 1.0e5 # GeV
+
return params
def set_up_as(fitter, params):
print 'Injecting the model', params
- asimov_params = gf.FitParameters(gf.sampleTag.HESE)
+ # asimov_params = gf.FitParameters(gf.sampleTag.HESE)
+ asimov_params = gf.FitParameters(gf.sampleTag.MagicTau)
for parm in params:
asimov_params.__setattr__(parm.name, float(parm.value))
fitter.SetupAsimov(asimov_params)
@@ -81,12 +85,14 @@ def setup_fitter(args, asimov_paramset):
sparams = steering_params(args)
npp = gf.NewPhysicsParams()
fitter = gf.GolemFit(datapaths, sparams, npp)
- set_up_as(fitter, asimov_paramset)
+ # comment to use data
+ # set_up_as(fitter, asimov_paramset)
return fitter
def get_llh(fitter, params):
- fitparams = gf.FitParameters(gf.sampleTag.HESE)
+ # fitparams = gf.FitParameters(gf.sampleTag.HESE)
+ fitparams = gf.FitParameters(gf.sampleTag.MagicTau)
for parm in params:
fitparams.__setattr__(parm.name, float(parm.value))
llh = -fitter.EvalLLH(fitparams)
@@ -95,7 +101,8 @@ def get_llh(fitter, params):
def get_llh_freq(fitter, params):
print 'setting to {0}'.format(params)
- fitparams = gf.FitParameters(gf.sampleTag.HESE)
+ # fitparams = gf.FitParameters(gf.sampleTag.HESE)
+ fitparams = gf.FitParameters(gf.sampleTag.MagicTau)
for parm in params:
fitparams.__setattr__(parm.name, float(parm.value))
fitter.SetFitParametersSeed(fitparams)
diff --git a/utils/plot.py b/utils/plot.py
index 8792cbb..fec8066 100644
--- a/utils/plot.py
+++ b/utils/plot.py
@@ -313,8 +313,8 @@ def plot_sens_full(data, outfile, outformat, args):
null = statistic[min_idx]
if args.stat_method is StatCateg.BAYESIAN:
reduced_ev = -(statistic - null)
- # al = scales[reduced_ev > np.log(10**(3/2.))] # Strong degree of belief
- al = scales[reduced_ev > 0.4] # Testing
+ al = scales[reduced_ev > np.log(10**(3/2.))] # Strong degree of belief
+ # al = scales[reduced_ev > 0.4] # Testing
elif args.stat_method is StatCateg.FREQUENTIST:
reduced_ev = -2*(statistic - null)
al = scales[reduced_ev > 2.71] # 90% CL for 1 DOF via Wilks
@@ -360,7 +360,8 @@ def plot_sens_fixed_angle(data, outfile, outformat, args):
print 'Making FIXED_ANGLE sensitivity plot'
colour = {0:'red', 1:'blue', 2:'green', 3:'purple', 4:'orange', 5:'black'}
- xticks = [r'$\mathcal{O}_{12}$', r'$\mathcal{O}_{13}$', r'$\mathcal{O}_{23}$']
+ # xticks = [r'$\mathcal{O}_{12}$', r'$\mathcal{O}_{13}$', r'$\mathcal{O}_{23}$']
+ xticks = [r'$\mathcal{O}_{e\mu}$', r'$\mathcal{O}_{e\tau}$', r'$\mathcal{O}_{\mu\tau}$']
argsc = deepcopy(args)
for idim in xrange(len(data)):
dim = args.dimensions[idim]
@@ -390,6 +391,7 @@ def plot_sens_fixed_angle(data, outfile, outformat, args):
if args.stat_method is StatCateg.BAYESIAN:
reduced_ev = -(statistic - null)
al = scales[reduced_ev > np.log(10**(3/2.))] # Strong degree of belief
+ # al = scales[reduced_ev > np.log(10**(1/2.))]
elif args.stat_method is StatCateg.FREQUENTIST:
reduced_ev = -2*(statistic - null)
al = scales[reduced_ev > 2.71] # 90% CL for 1 DOF via Wilks
@@ -403,7 +405,8 @@ def plot_sens_fixed_angle(data, outfile, outformat, args):
print 'limit = {0}'.format(lim)
label = '[{0}, {1}, {2}]'.format(*misc_utils.solve_ratio(src))
if lim < yranges[0]: yranges[0] = lim
- if lim > yranges[1]: yranges[1] = lim+4
+ # if lim > yranges[1]: yranges[1] = lim+5
+ if lim > yranges[1]: yranges[1] = lim
line = plt.Line2D(
(ian+1-0.1, ian+1+0.1), (lim, lim), lw=3, color=colour[isrc], label=label
)
@@ -417,7 +420,7 @@ def plot_sens_fixed_angle(data, outfile, outformat, args):
)
try:
- yranges = (myround(yranges[0], up=True), myround(yranges[1], down=True))
+ # yranges = (myround(yranges[0], up=True), myround(yranges[1], down=True))
ax.set_ylim(yranges)
except: pass
@@ -433,7 +436,6 @@ def plot_sens_fixed_angle(data, outfile, outformat, args):
print 'Saving plot as {0}'.format(out+'.'+of)
fig.savefig(out+'.'+of, bbox_inches='tight', dpi=150)
-
for ymaj in ax.yaxis.get_majorticklocs():
ax.axhline(y=ymaj, ls=':', color='gray', alpha=0.4, linewidth=1)
for xmaj in ax.xaxis.get_majorticklocs():