diff --git a/Likelihood/Full_likelihood.py b/Likelihood/Full_likelihood.py index 2d96e48..911976f 100644 --- a/Likelihood/Full_likelihood.py +++ b/Likelihood/Full_likelihood.py @@ -1,30 +1,25 @@ from Prob_dist_astro import * from Prob_dist_atm import * +ID_sh, lst_energy_sh, uncertainty_minus_sh, uncertainty_plus_sh, time_sh, declination_sh, RA_sh, Med_sh = Read_Data_File(os.getcwd()+'/'+'data_shower.txt') +ID_tr, lst_energy_tr, uncertainty_minus_tr, uncertainty_plus_tr, time_tr, declination_tr, RA_tr, Med_tr = Read_Data_File(os.getcwd()+'/'+'data_track.txt') -Initialize_All_Cross_Sections(prefix_dsdy_nu_nucleon='dsdy_ct14nn', - prefix_dsdy_nu_electron='dsdy_electron', - prefix_cs_nu_electron='cs_electron', kx=1, ky=1, k=1, s=0, - verbose=0) - - -def Partial_likelihood_showers(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, - costhz_val, costhz_npts, energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, +def Partial_likelihood_showers(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, + costhz_val, costhz_npts, energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose): - pdastro_sh = Prob_dist_astro(g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, costhz_val, costhz_npts, energy_dep, - log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, + pdastro_sh = Prob_dist_astro(g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, costhz_val, costhz_npts, energy_dep, + log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, flag_compute_shower_rate = True, flag_compute_track_rate = False) pdatm_conv_sh = Prob_dist_atm_conv_pr(nu_energy_min, nu_energy_max, nu_energy_num_nodes, costhz_val, costhz_npts, energy_dep,log10_energy_dep_int_min, log10_energy_dep_int_max, - log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, + log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, flag_use_atm_fluxes_conv = True, flag_use_atm_fluxes_pr = False, flag_apply_self_veto = True, flag_compute_shower_rate = True, flag_compute_track_rate = False) - pdatm_pr_sh = Prob_dist_atm_conv_pr(nu_energy_min, nu_energy_max, nu_energy_num_nodes, costhz_val, costhz_npts, energy_dep,log10_energy_dep_int_min, log10_energy_dep_int_max, - log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, - flag_use_atm_fluxes_conv = False, flag_use_atm_fluxes_pr = True, flag_apply_self_veto = True, flag_compute_shower_rate = True, flag_compute_track_rate = False) + log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, + flag_use_atm_fluxes_conv = False, flag_use_atm_fluxes_pr = True, flag_apply_self_veto = True, flag_compute_shower_rate = True, flag_compute_track_rate = False) pdatm_muon_sh = 0 #Probabillity distribution of atmospheric muons (showers) @@ -35,22 +30,22 @@ def Partial_likelihood_showers(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_mi -def Partial_likelihood_tracks(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, - costhz_val, costhz_npts, energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, +def Partial_likelihood_tracks(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, + costhz_val, costhz_npts, energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose): - pdastro_tr = Prob_dist_astro(g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, costhz_val, costhz_npts, energy_dep, - log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, + pdastro_tr = Prob_dist_astro(g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, costhz_val, costhz_npts, energy_dep, + log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, flag_compute_shower_rate = False, flag_compute_track_rate = True) pdatm_conv_tr = Prob_dist_atm_conv_pr(nu_energy_min, nu_energy_max, nu_energy_num_nodes, costhz_val, costhz_npts, energy_dep,log10_energy_dep_int_min, log10_energy_dep_int_max, - log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, + log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, flag_use_atm_fluxes_conv = True, flag_use_atm_fluxes_pr = False, flag_apply_self_veto = True, flag_compute_shower_rate = False, flag_compute_track_rate = True) pdatm_pr_tr = Prob_dist_atm_conv_pr(nu_energy_min, nu_energy_max, nu_energy_num_nodes, costhz_val, costhz_npts, energy_dep,log10_energy_dep_int_min, log10_energy_dep_int_max, - log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, - flag_use_atm_fluxes_conv = False, flag_use_atm_fluxes_pr = True, flag_apply_self_veto = True, flag_compute_shower_rate = False, flag_compute_track_rate = True) + log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose, + flag_use_atm_fluxes_conv = False, flag_use_atm_fluxes_pr = True, flag_apply_self_veto = True, flag_compute_shower_rate = False, flag_compute_track_rate = True) pdatm_muon_tr = Prob_dist_atm_muon(energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, epsabs, epsrel, verbose) @@ -60,33 +55,30 @@ def Partial_likelihood_tracks(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min return likelihood -def Full_likelihood(N_a, N_conv, N_pr, N_mu, g, M, gamma, nu_energy_min, nu_energy_max, z_min, z_max, E_min, E_max, E_npts, nu_energy_num_nodes, - costhz_npts, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, - time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose): +def Full_likelihood(N_a, N_conv, N_pr, N_mu, g, M, gamma, nu_energy_min, nu_energy_max, z_min, z_max, E_min, E_max, E_npts, nu_energy_num_nodes, + costhz_npts, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, + time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose): - ID_sh, lst_energy_sh, uncertainty_minus_sh, uncertainty_plus_sh, time_sh, declination_sh, RA_sh, Med_sh = Read_Data_File(os.getcwd()+'/'+'data_shower.txt') - - ID_tr, lst_energy_tr, uncertainty_minus_tr, uncertainty_plus_tr, time_tr, declination_tr, RA_tr, Med_tr = Read_Data_File(os.getcwd()+'/'+'data_track.txt') FL_sh = 1 - for i in range(3): #len(lst_energy_sh)): + for i in range(3): #len(lst_energy_sh)): costhz_val = np.cos((declination_sh[i] + 90)*np.pi/180) energy_dep = lst_energy_sh[i]*1000 - FL_sh = FL_sh * Partial_likelihood_showers(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, - costhz_val, costhz_npts, energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, + FL_sh = FL_sh * Partial_likelihood_showers(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, + costhz_val, costhz_npts, energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose) - FL_tr = 1 + FL_tr = 1 - for i in range(3): #len(lst_energy_tr)): + for i in range(3): #len(lst_energy_tr)): costhz_val = np.cos((declination_tr[i] + 90)*np.pi/180) energy_dep = lst_energy_tr[i]*1000 - FL_tr = FL_tr * Partial_likelihood_tracks(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, - costhz_val, costhz_npts, energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, + FL_tr = FL_tr * Partial_likelihood_tracks(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, + costhz_val, costhz_npts, energy_dep, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose) FL = np.exp(- N_a - N_conv - N_pr - N_mu) * FL_sh * FL_tr @@ -97,10 +89,10 @@ def Full_likelihood(N_a, N_conv, N_pr, N_mu, g, M, gamma, nu_energy_min, nu_ener log10_nu_energy_min = 2.8 log10_nu_energy_max = 9.2 -test = Full_likelihood(20, 20, 20, 20, 0.03, 0.01, 2, nu_energy_min = 10**log10_nu_energy_min, nu_energy_max = 10**log10_nu_energy_max, - z_min = 0, z_max = 4, E_min = 3, E_max = 8, E_npts = 10, nu_energy_num_nodes = 150, - costhz_npts = 2, log10_energy_dep_int_min = 4, log10_energy_dep_int_max = 7, log10_energy_dep_min = 3.8, log10_energy_dep_max = 7.2, log10_energy_dep_npts = 50, +test = Full_likelihood(20, 20, 20, 20, 0.03, 0.01, 2, nu_energy_min = 10**log10_nu_energy_min, nu_energy_max = 10**log10_nu_energy_max, + z_min = 0, z_max = 4, E_min = 3, E_max = 8, E_npts = 10, nu_energy_num_nodes = 150, + costhz_npts = 2, log10_energy_dep_int_min = 4, log10_energy_dep_int_max = 7, log10_energy_dep_min = 3.8, log10_energy_dep_max = 7.2, log10_energy_dep_npts = 50, time_det_yr = 8, volume_total = 6.44e14, energy_nu_max = 1e8, epsabs =1e-3, epsrel = 1e-3, verbose=1) print(test) -""" \ No newline at end of file +""" diff --git a/Likelihood/Likelihood_analysis.py b/Likelihood/Likelihood_analysis.py new file mode 100644 index 0000000..9fd4a53 --- /dev/null +++ b/Likelihood/Likelihood_analysis.py @@ -0,0 +1,93 @@ +import json +import numpy +from numpy import * +import scipy.stats, scipy +import pymultinest +from Full_likelihood import * + + +def Prior(cube, ndim, nparams): + + #Spectral index. Uniform prior between 2 and 3. + cube[0] = cube[0] + 2 + + #Mass of mediator. Log uniform prior between 10^-5 and 10^2 + cube[1] = 10**(cube[1]*7 - 5) + + #Coupling constant. Log uniform prior between 10^-3 and 1. + cube[2] = 10**(cube[2]*3 -3) + + #Expected number of astrophysical neutrinos. Uniform distribution between 0 and 80. + cube[3] = cube[3] * 80 + + #Expected number of conv. atm. neutrinos. Uniform distribution between 0 and 80. + cube[4] = cube[4] * 80 + + #Expected number of prompt atm. neutrinos. Uniform distribution between 0 and 80. + cube[5] = cube[5] * 80 + + #Expected number of atm. muons. Uniform distribution between 0 and 80. + cube[6] = cube[6] * 80 + + return 0 + + +def Log_Like(cube, ndim, nparams): + + gamma = cube[0] + M = cube[1] + g = cube[2] + N_a = cube[3] + N_conv = cube[4] + N_pr = cube[5] + N_mu = cube[6] + + z_min = 0 + z_max = 4 + E_min = 3 + E_max = 8 + E_npts = 5 #200 + + log10_nu_energy_min = 2.8 + log10_nu_energy_max = 9.2 + + nu_energy_min = 10**log10_nu_energy_min + nu_energy_max = 10**log10_nu_energy_max + nu_energy_num_nodes = 20 #150 + costhz_npts = 2 #50 + log10_energy_dep_int_min = 4 + log10_energy_dep_int_max = 7 + log10_energy_dep_min = 3.8 + log10_energy_dep_max = 7.2 + log10_energy_dep_npts = 10 #50 + time_det_yr = 8 + volume_total = 6.44e14 + energy_nu_max = 1e8 + epsabs = 1e-3 + epsrel = 1e-3 + verbose = 1 + + likelihood = Full_likelihood(N_a, N_conv, N_pr, N_mu, g, M, z_min, z_max, E_min, E_max, E_npts, gamma, nu_energy_min, nu_energy_max, nu_energy_num_nodes, + costhz_npts, log10_energy_dep_int_min, log10_energy_dep_int_max, log10_energy_dep_min, log10_energy_dep_max, log10_energy_dep_npts, + time_det_yr, volume_total, energy_nu_max, epsabs, epsrel, verbose) + + log_l = np.log10(likelihood) + print('Log_l=',log_l) + return log_l + + + + +parameters = ["gamma", "M", "g", "N_a", "N_conv", "N_pr", "N_mu"] +n_params = len(parameters) + + + + +# Run MultiNest +pymultinest.run(Log_Like, Prior, n_params, outputfiles_basename='out/', + resume=True, verbose=True, n_live_points=100, seed=1, + evidence_tolerance=0.1, importance_nested_sampling=True) + +json.dump(parameters, open('out/params.json', 'w')) # Save parameter names + diff --git a/Likelihood/Likelihood_analysis.sh b/Likelihood/Likelihood_analysis.sh index b8d21c8..44683cf 100644 --- a/Likelihood/Likelihood_analysis.sh +++ b/Likelihood/Likelihood_analysis.sh @@ -3,21 +3,28 @@ #SBATCH --job-name=likelihood # shows up in the output of 'squeue' #SBATCH --time=4-23:59:59 # specify the requested wall-time #SBATCH --partition=astro_long # specify the partition to run on -#SBATCH --nodes=4 # number of nodes allocated for this job +#SBATCH --nodes=1 # number of nodes allocated for this job #SBATCH --ntasks-per-node=20 # number of MPI ranks per node #SBATCH --cpus-per-task=1 # number of OpenMP threads per MPI rank #SBATCH --mail-type=ALL,TIME_LIMIT_90,TIME_LIMIT,ARRAY_TASKS #SBATCH --mail-user=vkc652@alumni.ku.dk -#SBATCH -o %A_%a.out # Standard output -#SBATCH -e %A_%a.err # Standard error +#SBATCH -o %A.out # Standard output +#SBATCH -e %A.err # Standard error ##SBATCH --exclude= # avoid nodes (e.g. --exclude=node786) # Move to directory job was submitted from cd $SLURM_SUBMIT_DIR -# Command to run -mpiexec -n 4 python Likelihood_analysis_parser.py --E_npts=2 --nu_energy_num_nodes=10 --costhz_npts=2 --log10_energy_dep_npts=5 --epsabs=1.e-1 --epsrel=1.e-1 --n_live_points=5 --evidence_tolerance=0.5 +export LD_LIBRARY_PATH=/groups/astro/vkc652/MultiNest/lib/:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/groups/astro/vkc652/nuSQuIDS/lib/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/groups/astro/vkc652/SQuIDS/lib/ +# Command to run +python -u Likelihood_analysis_parser.py --E_npts=10 --costhz_npts=3 --log10_energy_dep_npts=5 --epsabs=1.e-1 --epsrel=1.e-1 --n_live_points=5 --evidence_tolerance=5 --verbose=2 + +# python -u Likelihood_analysis_parser.py --E_npts=3 --nu_energy_num_nodes=10 --costhz_npts=3 --log10_energy_dep_npts=5 --epsabs=1.e-1 --epsrel=1.e-1 --n_live_points=5 --evidence_tolerance=0.5 --verbose=2 + +# mpiexec -n 1 python Likelihood_analysis_parser.py --E_npts=2 --nu_energy_num_nodes=10 --costhz_npts=2 --log10_energy_dep_npts=5 --epsabs=1.e-1 --epsrel=1.e-1 --n_live_points=5 --evidence_tolerance=0.5 --verbose=2 diff --git a/Likelihood/Likelihood_analysis_parser.py b/Likelihood/Likelihood_analysis_parser.py index 1422886..d8fbbb6 100644 --- a/Likelihood/Likelihood_analysis_parser.py +++ b/Likelihood/Likelihood_analysis_parser.py @@ -4,7 +4,7 @@ import scipy.stats, scipy import pymultinest from Full_likelihood import * -import argparse +import argparse parser = argparse.ArgumentParser(description='Likelihood Analysis') @@ -79,38 +79,70 @@ evidence_tolerance = args.evidence_tolerance +Initialize_All_Cross_Sections(prefix_dsdy_nu_nucleon='dsdy_ct14nn', + prefix_dsdy_nu_electron='dsdy_electron', + prefix_cs_nu_electron='cs_electron', kx=1, ky=1, k=1, s=0, + verbose=verbose) -def Prior(cube, ndim, nparams): +# ## >>> Initialize atm. fluxes, passing fractions - #Spectral index. Uniform prior between 2 and 3. +# lst_costhz_sel, lst_energy_sel, flux_mum_conv, flux_mup_conv, \ +# flux_mum_pr, flux_mup_pr, flux_nue_conv, flux_nuebar_conv, \ +# flux_nue_pr, flux_nuebar_pr, flux_numu_conv, flux_numubar_conv, \ +# flux_numu_pr, flux_numubar_pr, flux_nutau_pr, flux_nutaubar_pr = \ +# Initialize_Atm_Fluxes(flux_set='avg', flag_return_total=False, +# flag_return_plus_minus=False, kx=1, ky=1, s=0, verbose=verbose) + +# # Passing fractions +# # Call the interpolating functions as pf_spl(energy, costhz) +# lst_energy_pf, lst_costhz_pf, pf_nue_conv, pf_nuebar_conv, pf_numu_conv, \ +# pf_numubar_conv, pf_nue_pr, pf_nuebar_pr, pf_numu_pr, pf_numubar_pr = \ +# Initialize_Passing_Fractions(kx=1, ky=1, s=0, verbose=verbose) + +# mix_params_data_set ='nufit_4_0_with_sk' +# mix_params_mass_ordering ='no' + +# # lst_mix_params is passed to NuSQuIDS and contains the mixing parameters +# # [s12sq_bf, s23sq_bf, s13sq_bf, deltaCP_bf, Delta_m2_21_bf, Delta_m2_31_bf, Delta_m2_32_bf] +# global lst_mix_params +# lst_mix_params = Mixing_Parameters(mix_params_data_set, mix_params_mass_ordering)[0] + +# ID_sh, lst_energy_sh, uncertainty_minus_sh, uncertainty_plus_sh, time_sh, declination_sh, RA_sh, Med_sh = Read_Data_File(os.getcwd()+'/'+'data_shower.txt') + +# ID_tr, lst_energy_tr, uncertainty_minus_tr, uncertainty_plus_tr, time_tr, declination_tr, RA_tr, Med_tr = Read_Data_File(os.getcwd()+'/'+'data_track.txt') + + +def Prior(cube, ndim, nparams): + + #Spectral index. Uniform prior between 2 and 3. cube[0] = cube[0] + 2 - """ + #Mass of mediator. Log uniform prior between 10^-5 and 10^2 cube[1] = 10**(cube[1]*7 - 5) - - #Coupling constant. Log uniform prior between 10^-3 and 1. + """ + #Coupling constant. Log uniform prior between 10^-3 and 1. cube[2] = 10**(cube[2]*3 -3) #Expected number of astrophysical neutrinos. Uniform distribution between 0 and 80. - cube[3] = cube[3] * 80 + cube[3] = cube[3] * 80 #Expected number of conv. atm. neutrinos. Uniform distribution between 0 and 80. - cube[4] = cube[4] * 80 + cube[4] = cube[4] * 80 #Expected number of prompt atm. neutrinos. Uniform distribution between 0 and 80. - cube[5] = cube[5] * 80 + cube[5] = cube[5] * 80 #Expected number of atm. muons. Uniform distribution between 0 and 80. - cube[6] = cube[6] * 80 + cube[6] = cube[6] * 80 """ return 0 -def Log_Like(cube, ndim, nparams): +def Log_Like(cube, ndim, nparams): gamma = cube[0] - M = 0.01 #cube[1] + M = cube[1] g = 0.03 #cube[2] N_a = 20 #cube[3] N_conv = 20 #cube[4] @@ -121,8 +153,8 @@ def Log_Like(cube, ndim, nparams): nu_energy_max = 10**log10_nu_energy_max likelihood = Full_likelihood(N_a, N_conv, N_pr, N_mu, g, M, gamma, nu_energy_min, nu_energy_max, z_min=z_min, z_max=z_max, E_min=E_min, E_max=E_max, E_npts=E_npts, - nu_energy_num_nodes=nu_energy_num_nodes, costhz_npts=costhz_npts, log10_energy_dep_int_min=log10_energy_dep_int_min, log10_energy_dep_int_max=log10_energy_dep_int_max, - log10_energy_dep_min=log10_energy_dep_min, log10_energy_dep_max=log10_energy_dep_max, log10_energy_dep_npts=log10_energy_dep_npts, + nu_energy_num_nodes=nu_energy_num_nodes, costhz_npts=costhz_npts, log10_energy_dep_int_min=log10_energy_dep_int_min, log10_energy_dep_int_max=log10_energy_dep_int_max, + log10_energy_dep_min=log10_energy_dep_min, log10_energy_dep_max=log10_energy_dep_max, log10_energy_dep_npts=log10_energy_dep_npts, time_det_yr=time_det_yr, volume_total=volume_total, energy_nu_max=energy_nu_max, epsabs=epsabs, epsrel=epsrel, verbose=verbose) log_l = np.log10(likelihood) @@ -132,15 +164,15 @@ def Log_Like(cube, ndim, nparams): -parameters = ["gamma"]#, "M", "g", "N_a", "N_conv", "N_pr", "N_mu"] +parameters = ["gamma", "M"]#, "g", "N_a", "N_conv", "N_pr", "N_mu"] n_params = len(parameters) # Run MultiNest -pymultinest.run(Log_Like, Prior, n_params, outputfiles_basename='Likelihood_out_1D/', - resume=True, verbose=True, n_live_points=n_live_points, seed=1, - evidence_tolerance=evidence_tolerance, importance_nested_sampling=True) +pymultinest.run(Log_Like, Prior, n_params, outputfiles_basename='Likelihood_out_2D/', + resume=True, verbose=True, n_live_points=n_live_points, seed=1, + evidence_tolerance=evidence_tolerance, importance_nested_sampling=True, log_zero=-300) -json.dump(parameters, open('Likelihood_out_1D/params.json', 'w')) # Save parameter names \ No newline at end of file +json.dump(parameters, open('Likelihood_out_2D/params.json', 'w')) # Save parameter names