-
Notifications
You must be signed in to change notification settings - Fork 0
/
ComputeFullLikelihoods.py
94 lines (71 loc) · 3.75 KB
/
ComputeFullLikelihoods.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import numpy as np, sys
from PreFRBLE.likelihood import ComputeFullLikelihood, ComputeTelescopeLikelihood, LikelihoodTelescope
from PreFRBLE.parameter import telescopes, populations
### This execution file is used to compute and write to file all likelihoods for full LoS scenarios and telescope observations
### in case that the computing cluster does not allow to use jupyter notebooks...
### After these calculations are done, other calculations will be finished much fast
scenario = {
'IGM' : ['primordial'],
'Host' : ['Rodrigues18'],
'Inter' : ['Rodrigues18'],
'Local' : ['Piro18/wind'],
'N_inter' : True
}
'''
scenario = {
'IGM' : ['primordial'],
'Host': ['Heesen11/dirty'],
'Local': ['Piro18/wind'],
}
'''
scenarios = [
{'IGM' : ['primordial'],'Host' : ['Rodrigues18'],'Local' : ['Piro18/wind'],}, ## no intervening galaxy
{'IGM' : ['primordial'],'Host' : ['Rodrigues18'],'Local' : ['Piro18/wind'],'Inter' : ['Rodrigues18']}, ## certain intervening galaxy
# {'IGM' : ['primordial'],'Host' : ['Rodrigues18'],'Local' : ['Piro18/wind'],'Inter' : ['Rodrigues18'],'N_inter':True}, ## NInter intervening galaxies (realistic estimate for unknown interveners)
]
## force new computation of existing results for full likelihood at different redshifts
force=True ## should be True in case old likelihoods shall be replaced, can be set to False if computation of new likelihoods crashes, in order to not compute results twice
models_IGMF = [ 'alpha%i-3rd' % i for i in range(1,10) ]
f_IGMs = np.arange(0.3,1.01,0.1) #[-1:] ## !!!!!!!!!
## start with measures that do not depend on B (only one IGM model needed)
model = 'primordial'
'''
## tau only for primordial with f_IGM=1, since tau_IGM << tau, hence not sensible to changes in f_IGM. However, should be considered for smaller choices of outer scale in the IGM than 50 kpc
for scenario_tmp in scenarios:
for telescope in telescopes:
for population in populations:
print( 'tau', scenario_tmp, telescope, population, file=sys.stdout)
print( 'tau', scenario_tmp, telescope, population, file=sys.stderr)
LikelihoodTelescope( measure='tau', telescope=telescope, population=population, force=population == populations[0] and telescope==telescopes[0] and force, dev=True, progres_bar=True, **scenario_tmp)
#'''
#'''
for f_IGM in f_IGMs:
tmp = scenario.copy()
if f_IGM < 1:
tmp['IGM'] = ["%s_C%.0f" % (model, 1000*f_IGM) ]
for telescope in telescopes:
for population in populations:
print( 'DM', tmp, telescope, population, file=sys.stdout)
print( 'DM', tmp, telescope, population, file=sys.stderr)
LikelihoodTelescope( measure='DM', telescope=telescope, population=population, force=population == populations[0] and telescope==telescopes[0] and force, dev=True, progres_bar=True, **tmp )
#'''
#'''
## then measures that depend on B
#if len(sys.argv) != 2:
# raise ValueError( "Please provide number of IGMF model [0-8]" )
#i=int(sys.argv[1])
i=8
#for model in models_IGMF[i:i+1]:
for model in models_IGMF:
for f_IGM in f_IGMs[6:7]:
tmp = scenario.copy()
if f_IGM < 1:
tmp['IGM'] = ["%s_C%.0f" % (model, 1000*f_IGM) ]
else:
tmp['IGM'] = [model]
for telescope in telescopes:
for population in populations:
print( 'RM', tmp, telescope, population, file=sys.stdout)
print( 'RM', tmp, telescope, population, file=sys.stderr)
LikelihoodTelescope( measure='RM', telescope=telescope, population=population, force=population == populations[0] and telescope==telescopes[0] and force, dev=True, progres_bar=True, **tmp )
#'''