From 71663485bffe087e5247cdbf1d295348ab0609e1 Mon Sep 17 00:00:00 2001 From: shivesh Date: Tue, 15 Jan 2019 22:22:35 -0600 Subject: scan at scale of 1E-100 to get the NULL --- plot_sens.py | 7 +++++-- sens.py | 7 +++++++ submitter/sens_dag.py | 13 +++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/plot_sens.py b/plot_sens.py index 819fb6d..2e3bcd0 100755 --- a/plot_sens.py +++ b/plot_sens.py @@ -222,6 +222,7 @@ def main(): scan_scales = np.linspace( np.log10(scale_region[0]), np.log10(scale_region[1]), args.sens_bins ) + scan_scales = np.concatenate([[-100.], scan_scales]) for isrc, src in enumerate(args.source_ratios): argsc.source_ratio = src @@ -232,7 +233,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/{1}/{2}/{3}/fr_stat'.format( + infile += '/DIM{0}/fix_ifr/prior/{1}/{2}/{3}/fr_stat'.format( # infile += '/DIM{0}/fix_ifr/{1}/{2}/{3}/old/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( @@ -281,7 +283,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'.format(dim) + base_infile += '/DIM{0}/fix_ifr/prior'.format(dim) # base_infile += '/DIM{0}/fix_ifr/seed2'.format(dim) # base_infile += '/DIM{0}/fix_ifr/100TeV'.format(dim) diff --git a/sens.py b/sens.py index b5f5403..0646e6e 100755 --- a/sens.py +++ b/sens.py @@ -194,6 +194,8 @@ def main(): scan_scales = np.linspace( np.log10(args.scale_region[0]), np.log10(args.scale_region[1]), args.sens_bins ) + scan_scales = np.concatenate([[-100.], scan_scales]) + # scan_scales = np.array([-100.]) corr_angles_categ = [SensitivityCateg.CORR_ANGLE, SensitivityCateg.CORR_ONE_ANGLE] fixed_angle_categ = [SensitivityCateg.FIXED_ANGLE, SensitivityCateg.FIXED_ONE_ANGLE] @@ -270,6 +272,10 @@ def main(): out += '_angle_{0:<04.2}'.format(an) else: continue + sc_param = llh_paramset.from_tag(ParamTag.SCALE)[0] + if sc < sc_param.ranges[0]: + sc_param.ranges = (sc, sc_param.ranges[1]) + if idx_sc == 0 or args.sens_eval_bin is not None: print '|||| ANGLE = {0:<04.2}'.format(float(an)) print '|||| SCALE = {0:.0E}'.format(np.power(10, sc)) @@ -294,6 +300,7 @@ def main(): print '## Evidence = {0}'.format(stat) elif args.stat_method is StatCateg.FREQUENTIST: def fn(x): + # TODO(shivesh): should be seed or ranges? # Force prior ranges to be inside "seed" for el in x: if el < 0 or el > 1: return np.inf diff --git a/submitter/sens_dag.py b/submitter/sens_dag.py index ab6a5e0..bfab194 100644 --- a/submitter/sens_dag.py +++ b/submitter/sens_dag.py @@ -35,16 +35,17 @@ GLOBAL_PARAMS.update(dict( # MultiNest GLOBAL_PARAMS.update(dict( - mn_live_points = 1000, + # mn_live_points = 1000, + mn_live_points = 500, # mn_tolerance = 0.1, mn_tolerance = 0.3, mn_output = './mnrun' )) # FR -# dimension = [6] +dimension = [6] # dimension = [3, 6] -dimension = [3, 4, 5, 6, 7, 8] +# dimension = [3, 4, 5, 6, 7, 8] GLOBAL_PARAMS.update(dict( threads = 1, binning = '6e4 1e7 20', @@ -82,15 +83,18 @@ outfile = 'dagman_FR_SENS_{0}_{1}_{2}_{3}'.format( ) # outfile += '_seed2' # outfile += '_tol03' +# outfile += '_NULL' +outfile += '_prior' outfile += '.submit' golemfitsourcepath = os.environ['GOLEMSOURCEPATH'] + '/GolemFit' condor_script = golemfitsourcepath + '/scripts/flavour_ratio/submitter/sens_submit.sub' if sens_eval_bin.lower() != 'all': if GLOBAL_PARAMS['run_method'].lower() == 'corr_angle': + raise NotImplementedError sens_runs = GLOBAL_PARAMS['sens_bins']**2 else: - sens_runs = GLOBAL_PARAMS['sens_bins'] + sens_runs = GLOBAL_PARAMS['sens_bins'] + 1 else: sens_runs = 1 with open(outfile, 'w') as f: @@ -108,6 +112,7 @@ with open(outfile, 'w') as f: # output += 'seed2/' # output += 'mn_noverlap/' # output += 'tol_03/' + output += 'prior/' for r in xrange(sens_runs): print 'run', r f.write('JOB\tjob{0}\t{1}\n'.format(job_number, condor_script)) -- cgit v1.2.3