diff options
| author | shivesh <s.p.mandalia@qmul.ac.uk> | 2018-11-06 17:49:17 -0600 |
|---|---|---|
| committer | shivesh <s.p.mandalia@qmul.ac.uk> | 2018-11-06 17:49:17 -0600 |
| commit | eb98a187b1bc4ee8e8c962d0e5d1a3d0ae77bc35 (patch) | |
| tree | d9f8d4f65c9fedf0733653ea529da407fe227783 /utils | |
| parent | 84c05583ad3d582d107fe09be700311ea466b1af (diff) | |
| download | GolemFlavor-eb98a187b1bc4ee8e8c962d0e5d1a3d0ae77bc35.tar.gz GolemFlavor-eb98a187b1bc4ee8e8c962d0e5d1a3d0ae77bc35.zip | |
plotting
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/fr.py | 4 | ||||
| -rw-r--r-- | utils/gf.py | 6 | ||||
| -rw-r--r-- | utils/likelihood.py | 4 | ||||
| -rw-r--r-- | utils/misc.py | 8 | ||||
| -rw-r--r-- | utils/plot.py | 5 |
5 files changed, 16 insertions, 11 deletions
diff --git a/utils/fr.py b/utils/fr.py index c6d7a52..a2c2356 100644 --- a/utils/fr.py +++ b/utils/fr.py @@ -266,11 +266,11 @@ def estimate_scale(args): def fr_argparse(parser): parser.add_argument( - '--measured-ratio', type=int, nargs=3, default=[1, 1, 1], + '--measured-ratio', type=float, nargs=3, default=[1, 1, 1], help='Set the central value for the measured flavour ratio at IceCube' ) parser.add_argument( - '--source-ratio', type=int, nargs=3, default=[2, 1, 0], + '--source-ratio', type=float, nargs=3, default=[2, 1, 0], help='Set the source flavour ratio for the case when you want to fix it' ) parser.add_argument( diff --git a/utils/gf.py b/utils/gf.py index a288622..ddf3fdd 100644 --- a/utils/gf.py +++ b/utils/gf.py @@ -13,7 +13,11 @@ from functools import partial import numpy as np -import GolemFitPy as gf +try: + import GolemFitPy as gf +except: + print 'Running without GolemFit' + pass from utils.enums import DataType, SteeringCateg from utils.misc import enum_parse, thread_factors diff --git a/utils/likelihood.py b/utils/likelihood.py index ee4ec6e..4580b67 100644 --- a/utils/likelihood.py +++ b/utils/likelihood.py @@ -126,7 +126,9 @@ def triangle_llh(theta, args, asimov_paramset, llh_paramset, fitter): mass_eigenvalues = fr_utils.MASS_EIGENVALUES sm_u = fr_utils.NUFIT_U - if args.energy_dependance is EnergyDependance.MONO: + if args.no_bsm: + fr = fr_utils.u_to_fr(source_flux, np.array(sm_u, dtype=np.complex256)) + elif args.energy_dependance is EnergyDependance.MONO: u = fr_utils.params_to_BSMu( theta = bsm_angles, dim = args.dimension, diff --git a/utils/misc.py b/utils/misc.py index ed14941..26bd828 100644 --- a/utils/misc.py +++ b/utils/misc.py @@ -42,20 +42,16 @@ def gen_identifier(args): f += '_sfr_{0:G}_{1:G}_{2:G}_mfr_{3:G}_{4:G}_{5:G}'.format( sr1, sr2, sr3, mr1, mr2, mr3 ) - if args.fix_mixing is not MixingScenario.NONE: - f += '_{0}'.format(args.fix_mixing) - elif args.fix_mixing_almost: - f += '_fix_mixing_almost' - elif args.fix_scale: - f += '_fix_scale_{0}'.format(args.scale) else: f += '_mfr_{3:03d}_{4:03d}_{5:03d}'.format(mr1, mr2, mr3) + if args.fix_mixing is not MixingScenario.NONE: f += '_{0}'.format(args.fix_mixing) elif args.fix_mixing_almost: f += '_fix_mixing_almost' elif args.fix_scale: f += '_fix_scale_{0}'.format(args.scale) + if args.likelihood is Likelihood.FLAT: f += '_flat' elif args.likelihood is Likelihood.GAUSSIAN: f += '_sigma_{0:03d}'.format(int(args.sigma_ratio*1000)) diff --git a/utils/plot.py b/utils/plot.py index fb58176..540ed25 100644 --- a/utils/plot.py +++ b/utils/plot.py @@ -34,7 +34,10 @@ from utils.enums import DataType, EnergyDependance from utils.enums import Likelihood, MixingScenario, ParamTag, StatCateg from utils.fr import angles_to_u, angles_to_fr -plt.style.use(os.environ['GOLEMSOURCEPATH']+'/GolemFit/scripts/paper/paper.mplstyle') +if os.environ.get('GOLEMSOURCEPATH') is not None: + plt.style.use(os.environ['GOLEMSOURCEPATH']+'/GolemFit/scripts/paper/paper.mplstyle') +elif os.path.isfile('./paper.mplstyle'): + plt.style.use('./paper.mplstyle') if 'submitter' in socket.gethostname(): rc('text', usetex=False) |
