Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
run_all.py
Go to the documentation of this file.
1 import os
2 #Produces all angular power spectrum benchmarks
3 #Contact david.alonso@physics.ox.ac.uk if you have issues running this script
4 
5 def run_task(window_type,bins_type,b1,b2) :
6  do_logbin=0
7  if bins_type=="lin" :
8  do_logbin=0
9  elif bins_type=="log" :
10  do_logbin=1
11  else :
12  print "Wrong binning scheme "+bins_type
13 
14  strout="#Cosmological parameters\n"
15  strout+="omega_m= 0.3\n"
16  strout+="omega_l= 0.7\n"
17  strout+="omega_b= 0.0\n"
18  strout+="w0= -1.\n"
19  strout+="wa= 0.\n"
20  strout+="h= 0.7\n"
21  strout+="ns= 0.96\n"
22  strout+="s8= 0.8\n"
23  strout+="\n"
24  strout+="#Radial resolution\n"
25  strout+="d_chi= 5.\n"
26  strout+="\n"
27  strout+="#Maximum multipole\n"
28  strout+="l_max= 30000\n"
29  strout+="\n"
30  strout+="#Behavioural flags (include number counts? include lensing shear? include CMB lensing?)\n"
31  strout+="do_nc= 1\n"
32  strout+="has_nc_dens= 1\n"
33  strout+="has_nc_rsd= 0\n"
34  strout+="has_nc_lensing= 0\n"
35  strout+="do_shear= 1\n"
36  strout+="do_cmblens= 1\n"
37  strout+="\n"
38  strout+="#Angular correlation function\n"
39  strout+="do_w_theta= 1\n"
40  strout+="use_logbin= %d\n"%do_logbin
41  strout+="theta_min= 0\n"
42  strout+="theta_max= 10.\n"
43  strout+="n_bins_theta= 15\n"
44  strout+="n_bins_decade= 5\n"
45  strout+="\n"
46  strout+="#File names (window function, bias, magnification bias, power spectrum)\n"
47  strout+="window_1_fname= curves/bin%d_"%b1+window_type+".txt\n"
48  strout+="window_2_fname= curves/bin%d_"%b2+window_type+".txt\n"
49  strout+="bias_fname= curves/bias.txt\n"
50  strout+="sbias_fname= nothing\n"
51  strout+="pk_fname= BBKS\n"
52  strout+="\n"
53  strout+="#Output prefix\n"
54  strout+="prefix_out= output/run_b%d"%b1+"b%d"%b2+window_type+"_"+bins_type
55 
56  parname="param_limberjack_b%d"%b1+"b%d"%b2+window_type+"_"+bins_type+".ini"
57  f=open(parname,"w")
58  f.write(strout)
59  f.close()
60 
61  os.system("./limberjack "+parname)
62 
63 run_task("analytic","log",1,1)
64 run_task("analytic","log",1,2)
65 run_task("analytic","log",2,2)
66 run_task("histo","log",1,1)
67 run_task("histo","log",1,2)
68 run_task("histo","log",2,2)
69 
def run_task(window_type, bins_type, b1, b2)
Definition: run_all.py:5