-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.py
More file actions
67 lines (58 loc) · 1.57 KB
/
main.py
File metadata and controls
67 lines (58 loc) · 1.57 KB
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
import numpy as np
import matplotlib.pyplot as plt
import common as com
import sys as sys
import os as os
if len(sys.argv)!=2:
sys.exit("Usage: python main.py fname_params")
fname_params=sys.argv[1]
#sys.stderr=open('errorlog.txt','w')
print " "
print "__________________________"
print "| ------- GoFish ------- |"
print "| |"
print "| _///_ _///_ |"
print "| /o \/ /o \/ |"
print "| > ))_./\ > ))_./\ |"
print "| < < |"
print "|------------------------|"
print " "
print " "
print "<> Reading parameters"
par=com.ParamRun(fname_params)
print " "
if (not os.path.isfile(par.output_dir+"/"+par.output_fisher+"/fisher_raw.npz")) :
print "<> Computing/reading relevant signal power spectra"
par.get_cls_all()
if par.just_run_cls==False :
print "<> Computing relevant noise power spectra"
par.get_cls_noise()
print " "
if par.just_run_cls==False :
par.plot_cls()
print " "
if par.just_run_cls==False :
print "<> Computing Fisher matrix"
par.get_fisher_cls()
# par.get_signal_to_noise()
par.get_fisher_bao()
par.get_fisher_prior()
par.get_bias()
par.join_fishers()
par.plot_fisher()
print " "
#sys.stderr.close()
#sys.stderr=sys.__stderr__
#print "<> Contents of the error log :"
#print "### "
#print " "
#eos.system("cat errorlog.txt")
#os.system("rm errorlog.txt")
#print " "
#print "### "
#print " "
print " "
print "__________________________"
print "| Done! |"
print "|------------------------|"
print " "