Include all the stupid tools required for BORG analysis and plotting
This commit is contained in:
parent
81f4b642e4
commit
a56eb021c4
8 changed files with 401 additions and 2 deletions
42
python_sample/gen_2lpt_density.py
Normal file
42
python_sample/gen_2lpt_density.py
Normal file
|
@ -0,0 +1,42 @@
|
|||
import numpy as np
|
||||
import cosmotool as ct
|
||||
import icgen as bic
|
||||
import icgen.cosmogrowth as cg
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
cosmo={'omega_M_0':0.3175, 'h':0.6711}
|
||||
cosmo['omega_lambda_0']=1-cosmo['omega_M_0']
|
||||
cosmo['omega_k_0'] = 0
|
||||
cosmo['omega_B_0']=0.049
|
||||
cosmo['SIGMA8']=0.8344
|
||||
cosmo['ns']=0.9624
|
||||
N0=256
|
||||
|
||||
doSimulation=True
|
||||
|
||||
astart=1.
|
||||
|
||||
parser=argparse.ArgumentParser(description="Generate CIC density from 2LPT")
|
||||
parser.add_argument('--start', type=int, required=True)
|
||||
parser.add_argument('--end', type=int, required=True)
|
||||
parser.add_argument('--step', type=int, required=True)
|
||||
parser.add_argument('--base', type=str, required=True)
|
||||
parser.add_argument('--N', type=int, default=256)
|
||||
parser.add_argument('--output', type=str, default="dcic_%d.npy")
|
||||
parser.add_argument('--supersample', type=int, default=1)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
|
||||
for i in xrange(args.start, args.end, args.step):
|
||||
print i
|
||||
# pos,_,density,N,L,_ = bic.run_generation("/nethome/lavaux/remote/borg_2m++_128/initial_density_%d.dat" % i, 0.001, astart, cosmo, supersample=2, do_lpt2=True)
|
||||
pos,_,density,N,L,_ = bic.run_generation("%s/initial_density_%d.dat" % (args.base,i), 0.001, astart,
|
||||
cosmo, supersample=args.supersample, do_lpt2=True)
|
||||
|
||||
dcic = ct.cicParticles(pos, L, args.N)
|
||||
dcic /= np.average(np.average(np.average(dcic, axis=0), axis=0), axis=0)
|
||||
dcic -= 1
|
||||
|
||||
np.save(args.output % i, dcic)
|
Loading…
Add table
Add a link
Reference in a new issue